/*
 * IQP interface components.
 *
 * Each block below maps to one Phoenix function component. The class names
 * follow the pattern block__element--modifier, so a component owns its names.
 * context/interface-design.md gives the rules. tokens.css holds the values.
 */

@import url("tokens.css");

/* ----------------------------------------------------------------- Base -- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-ui);
  font-kerning: normal;
}

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

/* An inline symbol takes the size of the text around it. */
.icon { display: inline-block; width: 1em; height: 1em; flex: none; vertical-align: -0.125em; }

h1, h2, h3, h4, p, ul, ol, dl, figure, blockquote { margin: 0; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

::selection { background: var(--lens); color: var(--n-900); }

/* A person who asks for reduced motion gets none (SYS-180). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0s !important;
    animation-duration: 0s !important;
    scroll-behavior: auto !important;
  }
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -10rem;
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
}
.skip-link:focus { top: var(--space-4); }

/* --------------------------------------------------------------- Layout -- */

.page {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.page--full { max-width: none; }

.stack > * + * { margin-block-start: var(--stack, var(--space-4)); }
.stack--tight { --stack: var(--space-2); }
.stack--loose { --stack: var(--space-6); }

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--cluster, var(--space-3));
}

.measure { max-width: var(--measure); }

/* A main column and a side rail. The rail drops below on a narrow screen. */
.split {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 64rem) {
  .split { grid-template-columns: minmax(0, 1fr) var(--rail, 24rem); }
  .split--rail-left { grid-template-columns: var(--rail, 16rem) minmax(0, 1fr); }
}

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

.surface { background: var(--surface); }

[data-theme] { background: var(--bg); color: var(--text); }

/* ------------------------------------------------------------- Masthead -- */

.masthead {
  border-bottom: var(--hairline) solid var(--rule);
  background: var(--bg);
}
.masthead__inner {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  min-height: 4rem;
}
.masthead__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--text);
}
.masthead__brand:hover { color: var(--text); }
.masthead__nav { display: flex; gap: var(--space-5); margin-inline-start: auto; }
.masthead__actions { display: flex; align-items: center; gap: var(--space-3); }
@media (max-width: 48rem) {
  .masthead__nav { display: none; }
  .masthead__actions { margin-inline-start: auto; }
  .masthead__actions .caption { display: none; }
  .wordmark__surface { display: none; }
}
@media (max-width: 30rem) {
  .wordmark { font-size: 1.125rem; }
  .mark { height: 1.75rem; }
}

/* The console masthead is dense and dark, so the staff member always knows
   which surface is open. */
.masthead--console { background: var(--n-900); color: #e8e8e8; border-bottom: 0; }
.masthead--console .masthead__inner { min-height: 3rem; }
.masthead--console .masthead__brand { color: #e8e8e8; }

.mark { width: auto; height: 2.25rem; flex: none; }
.mark--small { height: 1.5rem; }
.mark__body { fill: var(--mark-body); }
.mark__letters { fill: var(--mark-letters); }
.mark__lens { fill: var(--lens); }

.wordmark {
  font-family: var(--font-serif);
  font-size: 1.375rem;
  font-weight: 560;
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
}
.wordmark__surface {
  font-family: var(--font-sans);
  font-stretch: 85%;
  font-weight: 600;
  font-size: var(--text-xs);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--text-2);
  margin-inline-start: var(--space-2);
}
.masthead--console .wordmark__surface { color: var(--lens); }

.nav-link {
  font-stretch: 85%;
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  text-decoration: none;
  padding-block: var(--space-2);
  border-bottom: 2px solid transparent;
}
.nav-link[aria-current="page"] { border-bottom-color: var(--accent); }

/* ----------------------------------------------------------- Typography -- */

/* Serif speaks: headlines and reading text. */
.display, .headline, .headline-2, .headline-3, .dek, .prose {
  font-family: var(--font-serif);
}
.display {
  font-size: var(--text-display);
  line-height: var(--leading-tight);
  font-weight: 500;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.headline {
  font-size: var(--text-3xl);
  line-height: var(--leading-tight);
  font-weight: 500;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.headline-2 {
  font-size: var(--text-2xl);
  line-height: var(--leading-snug);
  font-weight: 500;
  text-wrap: balance;
}
.headline-3 {
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  font-weight: 560;
}
.dek {
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  font-style: italic;
  font-weight: 400;
  color: var(--text-2);
  text-wrap: pretty;
}
.prose {
  font-size: var(--text-lg);
  line-height: var(--leading-read);
  max-width: var(--measure);
  text-wrap: pretty;
}
.prose > * + * { margin-block-start: 1em; }

/* Sans operates: labels, controls and captions. */
.kicker {
  font-family: var(--font-sans);
  font-stretch: 85%;
  font-weight: 600;
  font-size: var(--text-xs);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--accent);
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  border-top: 2px solid var(--rule-strong);
  padding-top: var(--space-2);
}
.section-head__title {
  font-stretch: 85%;
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}
.caption {
  font-size: var(--text-sm);
  line-height: var(--leading-ui);
  color: var(--text-2);
}
.credit {
  font-stretch: 85%;
  font-weight: 600;
  font-size: var(--text-xs);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--text-2);
}
.muted { color: var(--text-2); }

/* Mono records: identifiers, timestamps and audit entries. */
.mono {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0;
}

/* A value that the team has not decided. The example pages show it so that no
   reader takes it for a real figure. */
.undecided {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 0 0.3em;
  border: 1px dashed var(--control);
  color: var(--text-2);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- Money -- */

/* Each sum shows its ISO 4217 code and every minor unit (SYS-194, SYS-195).
   Tabular figures give each digit one width, so a column aligns (SYS-196). */
.money {
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
}
.money__code {
  font-size: 0.78em;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-2);
  margin-inline-end: 0.3em;
}
.money--large { font-size: var(--text-2xl); font-weight: 500; }

/* -------------------------------------------------------------- Buttons -- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 2.5rem;
  padding: 0 var(--space-4);
  border: var(--hairline) solid var(--control);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.button:hover { background: var(--surface-2); color: var(--text); }
.button--primary { background: var(--text); border-color: var(--text); color: var(--bg); }
.button--primary:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.button--quiet { border-color: transparent; }
.button--danger { border-color: var(--danger); color: var(--danger); }
.button--small { min-height: 2rem; padding: 0 var(--space-3); font-size: var(--text-xs); }
.button[disabled], .button[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
@media (pointer: coarse) { .button { min-height: var(--target); } }

/* A button on a photograph sits on its own backing, so it stays legible on any
   frame. */
.button--on-photo {
  background: var(--backing-chip);
  border-color: rgb(255 255 255 / 0.35);
  color: #fff;
}
.button--on-photo:hover { background: var(--n-1000); color: var(--lens); }

/* ---------------------------------------------------------------- Forms -- */

.field { display: grid; gap: var(--space-1); }
.field__label { font-size: var(--text-sm); font-weight: 600; }
.field__hint { font-size: var(--text-sm); color: var(--text-2); }

.input {
  width: 100%;
  min-height: var(--target);
  padding: 0 var(--space-3);
  border: var(--hairline) solid var(--control);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
textarea.input { padding-block: var(--space-2); min-height: 6rem; line-height: var(--leading-ui); }

/* The search field is the front door of the buyer surface. It carries a large
   size and a heavy bottom rule, like a headline. */
.search {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border-bottom: 2px solid var(--rule-strong);
}
.search__input {
  flex: 1;
  min-width: 0;
  min-height: 3.5rem;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-family: var(--font-serif);
  font-size: var(--text-xl);
}
.search__input:focus-visible { outline: none; }
.search:focus-within { border-bottom-color: var(--focus); }

/* A segmented control is a radio group that looks like one row of buttons. */
.segmented {
  display: inline-flex;
  border: var(--hairline) solid var(--control);
  border-radius: var(--radius);
}
.segmented__option { position: relative; }
.segmented__option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented__option span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 2.25rem;
  padding: 0 var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
}
.segmented__option + .segmented__option span { border-inline-start: var(--hairline) solid var(--control); }
.segmented__option input:checked + span { background: var(--text); color: var(--bg); }
.segmented__option input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

.checkbox { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); }
.checkbox input { width: 1.125rem; height: 1.125rem; accent-color: var(--accent); margin: 0; }

/* --------------------------------------------------------------- Labels -- */

/* A label states a state of an asset or an item. It always holds a word and
   a symbol, and never a color alone (SYS-192). */
.label {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.125rem 0.4rem;
  border: var(--hairline) solid currentColor;
  border-radius: var(--radius);
  font-stretch: 85%;
  font-weight: 600;
  font-size: var(--text-xs);
  line-height: 1.3;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text-2);
}
.label svg { width: 0.85rem; height: 0.85rem; flex: none; }
.label--embargo { color: var(--embargo); }
.label--danger { color: var(--danger); }
.label--ok { color: var(--ok); }
.label--suggest { color: var(--suggest); border-style: dashed; }

/* On a photograph, a label sits on a dark backing. The hue moves to the
   symbol and to a bar on the start edge. */
.label--on-photo {
  background: var(--backing-chip);
  border: 0;
  border-inline-start: 3px solid var(--n-400);
  color: #fff;
}
.label--on-photo.label--embargo { border-inline-start-color: var(--violet-glow); }
.label--on-photo.label--embargo svg { color: var(--violet-glow); }
.label--on-photo.label--danger { border-inline-start-color: var(--red-glow); }
.label--on-photo.label--danger svg { color: var(--red-glow); }
.label--on-photo.label--ok { border-inline-start-color: var(--green-glow); }
.label--on-photo.label--ok svg { color: var(--green-glow); }
.label--on-photo.label--suggest { border-inline-start-color: var(--blue-glow); }
.label--on-photo.label--suggest svg { color: var(--blue-glow); }

/* ----------------------------------------------------------------- Tags -- */

/* An entity or a keyword on an asset. */
.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 2rem;
  padding: 0 var(--space-3);
  border: var(--hairline) solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: var(--text-sm);
  text-decoration: none;
}
a.tag:hover { border-color: var(--text); color: var(--text); }
.tag svg { width: 0.875rem; height: 0.875rem; flex: none; color: var(--ok); }
.tag__kind {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-2);
}

/* A suggestion differs from a confirmed value by its dashed border and by its
   word, not by its hue alone (SYS-204). */
.tag--suggested {
  border: var(--hairline) dashed var(--suggest);
  background: color-mix(in srgb, var(--suggest) 7%, var(--bg));
}
.tag--suggested::before {
  content: "Suggested";
  font-stretch: 85%;
  font-weight: 600;
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--suggest);
}

/* ---------------------------------------------------------------- A set -- */

/* The toolbar above a set. The view, the size and the detail mode are URL
   parameters in the platform, so a person can share the exact view. */
.set-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-5);
  padding-block: var(--space-3);
}
.set-toolbar__count { font-size: var(--text-sm); color: var(--text-2); margin-inline-end: auto; }
.set-toolbar__group { display: flex; align-items: center; gap: var(--space-2); }
.set-toolbar__label {
  font-stretch: 85%;
  font-weight: 600;
  font-size: var(--text-xs);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--text-2);
}

.set {
  list-style: none;
  margin: 0;
  padding: 0;
  --row-h: var(--row-m);
  --cell: var(--cell-m);
}
.set[data-size="s"] { --row-h: var(--row-s); --cell: var(--cell-s); }
.set[data-size="l"] { --row-h: var(--row-l); --cell: var(--cell-l); }
@media (max-width: 40rem) {
  .set { --row-h: 120px; --cell: 140px; }
  .set[data-size="s"] { --row-h: 84px; --cell: 96px; }
  .set[data-size="l"] { --row-h: 200px; --cell: 100%; }
}

/* The mosaic view (SYS-182). Each tile carries its aspect ratio in --ar, from
   the dimensions of the derivative. Each tile grows in proportion to its
   ratio, so every tile in a row has one height and the row fills the width.
   The pseudo-element takes the free space of the last row, so that row keeps
   the target height. The order of the source is the visual order (SYS-193),
   and the server knows each ratio, so no space moves while a file arrives
   (SYS-200). No script is necessary. */
.set[data-view="mosaic"] {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--mosaic-gap);
}
.set[data-view="mosaic"]::after {
  content: "";
  flex: 999999 1 0;
}
.set[data-view="mosaic"] > .tile {
  flex: var(--ar) 1 calc(var(--ar) * var(--row-h));
  aspect-ratio: var(--ar);
}

/* The grid view (SYS-187). Each cell is square, so a portrait frame and a
   landscape frame get the same longest side. */
.set[data-view="grid"] {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(var(--cell), 100%), 1fr));
  gap: var(--space-2);
}
.set[data-view="grid"] > .tile {
  aspect-ratio: 1;
  background: var(--surface-2);
}
.set[data-view="grid"] .tile__link { inset: var(--space-4); }

/* -------------------------------------------------------------- A tile -- */

.tile {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: var(--surface-2);
  container-type: inline-size;
}
.tile__link {
  position: absolute;
  inset: 0;
  display: block;
  color: inherit;
}
.tile__link:focus-visible { outline: none; }

/* The frame scales to fit and keeps every pixel (SYS-181). */
.tile__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* The focus ring and the selection ring sit above the photograph. Two rings,
   one light and one dark, keep a contrast of 3:1 on any frame. */
.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}
.tile:has(.tile__link:focus-visible)::after {
  box-shadow: inset 0 0 0 3px var(--lens), inset 0 0 0 5px var(--n-900);
}
.tile--selected::after {
  box-shadow: inset 0 0 0 4px var(--lens), inset 0 0 0 6px var(--n-900);
}

/* The pipeline burns the visible watermark into each comp. This layer only
   imitates that watermark in the examples. */
.comp::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='120'%3E%3Cg transform='rotate(-24 90 60)' font-family='Helvetica,Arial,sans-serif' font-weight='700' font-size='22' letter-spacing='3'%3E%3Ctext x='38' y='70' fill='white' fill-opacity='.30' stroke='black' stroke-opacity='.18' stroke-width='.8'%3EIQP%3C/text%3E%3C/g%3E%3C/svg%3E");
  background-size: 180px 120px;
}

/* Labels: always visible, without a hover (SYS-189 to SYS-191). */
.tile__labels {
  position: absolute;
  inset-block-start: var(--space-2);
  inset-inline-start: var(--space-2);
  inset-inline-end: 3rem;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  pointer-events: none;
}

/* The select control shows on hover and on focus, and it stays when checked
   or when the set is in select mode. */
.tile__select {
  position: absolute;
  inset-block-start: var(--space-2);
  inset-inline-end: var(--space-2);
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  background: var(--backing-chip);
  border-radius: var(--radius);
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease);
  cursor: pointer;
}
.tile__select input { width: 1.125rem; height: 1.125rem; margin: 0; accent-color: var(--lens); cursor: pointer; }
.tile:hover .tile__select,
.tile:focus-within .tile__select,
.tile--selected .tile__select,
.set[data-mode="select"] .tile__select { opacity: 1; }

/* Details: the caption, the credit line and the actions sit inside the frame
   (SYS-184). The backing is solid behind the text and fades only above it, so
   the text keeps its contrast on any frame (SYS-179). */
.tile__details {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  z-index: 2;
  display: grid;
  gap: var(--space-1);
  padding: 2rem var(--space-3) var(--space-3);
  background: linear-gradient(to top, var(--backing-text) 0, var(--backing-text) calc(100% - 2rem), transparent 100%);
  color: #fff;
  opacity: 0;
  transform: translateY(0.25rem);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  pointer-events: none;
}
.tile__details > * { pointer-events: auto; }
.tile:hover .tile__details,
.tile:focus-within .tile__details,
.set[data-details="always"] .tile__details {
  opacity: 1;
  transform: none;
}
.tile__headline {
  font-size: var(--text-sm);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tile__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-2);
  font-size: var(--text-xs);
  color: #d0d0d0;
}
.tile__meta .mono { font-size: var(--text-xs); }
.tile__actions { display: flex; gap: var(--space-2); margin-top: var(--space-1); }

/* A small tile keeps the labels and drops the parts that do not fit. */
@container (max-width: 15rem) {
  .tile__actions { display: none; }
}
@container (max-width: 10rem) {
  .tile__headline { display: none; }
  .tile__details { padding-top: 1.5rem; }
}

/* A frame from the quarantine lane. The server sends no image for it to a
   person without the restricted role. This is not a hidden image. */
.tile--withheld .tile__link {
  display: grid;
  place-items: center;
  align-content: center;
  gap: var(--space-2);
  background: repeating-linear-gradient(135deg, var(--surface-2) 0 8px, var(--surface) 8px 16px);
  color: var(--text-2);
  font-size: var(--text-xs);
  text-align: center;
  text-decoration: none;
  padding: var(--space-3);
}
.tile--withheld svg { width: 1.5rem; height: 1.5rem; color: var(--danger); }

/* ---------------------------------------------------------------- Stage -- */

/* The stage shows one asset at full size on a neutral surface. */
.stage {
  background: var(--stage);
  display: grid;
  place-items: center;
  padding: var(--space-5);
  min-height: 50vh;
}
.stage__frame { position: relative; max-width: 100%; }
.stage__img {
  max-height: min(78vh, 60rem);
  width: auto;
  object-fit: contain;
}

/* ------------------------------------------------------------- Feature -- */

/* A full-bleed photograph with a serif headline on it, for the public
   surface. */
.feature {
  position: relative;
  background: var(--n-1000);
  color: #fff;
}
.feature__img {
  width: 100%;
  max-height: 82vh;
  object-fit: contain;
  margin-inline: auto;
}
.feature__text {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  padding: 5rem var(--gutter) var(--space-6);
  background: linear-gradient(to top, var(--backing-text) 0, var(--backing-text) calc(100% - 5rem), transparent 100%);
}
.feature__text .kicker { color: var(--lens); }
.feature__text .dek { color: #d8d8d8; }
@media (max-width: 40rem) {
  .feature__text { position: static; background: var(--n-1000); padding-top: var(--space-4); }
}

/* -------------------------------------------------------- License options -- */

.license-options { display: grid; border-top: var(--hairline) solid var(--rule); }
.license-option {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-1) var(--space-3);
  align-items: baseline;
  padding: var(--space-3) var(--space-2);
  border-bottom: var(--hairline) solid var(--rule);
  cursor: pointer;
}
.license-option input { margin: 0; accent-color: var(--accent); align-self: center; }
.license-option__name { font-weight: 600; }
.license-option__terms { grid-column: 2 / -1; font-size: var(--text-sm); color: var(--text-2); }
.license-option:has(input:checked) { background: var(--surface); box-shadow: inset 3px 0 0 var(--accent); }
.license-option--closed { cursor: not-allowed; color: var(--text-2); }
.license-option--closed .license-option__name { text-decoration: line-through; text-decoration-thickness: 1px; }

/* ----------------------------------------------------------- Data table -- */

.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}
.data-table th {
  position: sticky;
  top: 0;
  background: var(--bg);
  text-align: start;
  font-stretch: 85%;
  font-weight: 600;
  font-size: var(--text-xs);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--text-2);
  border-bottom: 2px solid var(--rule-strong);
  padding: var(--space-2) var(--space-3);
  white-space: nowrap;
}
.data-table td {
  border-bottom: var(--hairline) solid var(--rule);
  padding: var(--space-3);
  vertical-align: top;
}
.data-table .num, .data-table .mono { text-align: end; white-space: nowrap; }
.data-table .mono { text-align: start; }
.data-table tfoot td { border-top: 2px solid var(--rule-strong); border-bottom: 0; font-weight: 600; }
.data-table--dense td { padding: var(--space-1) var(--space-3); }
.data-table tbody tr:hover { background: var(--surface); }
.data-table__thumb { width: 3.5rem; height: 2.5rem; object-fit: contain; background: var(--surface-2); }

/* ---------------------------------------------------------- Lifecycle -- */

/* The item lifecycle: New, Triaged, In-Progress, Actioned, Closed. The word
   states the step, and the ticks show how far the item has come. */
.lifecycle { display: inline-flex; align-items: center; gap: var(--space-2); white-space: nowrap; }
.lifecycle__ticks { display: inline-flex; gap: 2px; }
.lifecycle__ticks i { width: 0.625rem; height: 0.375rem; background: var(--rule); }
.lifecycle__ticks i.is-done { background: var(--text); }
.lifecycle__word { font-size: var(--text-sm); }

/* Age against the service level. Past the level, the bar turns to the danger
   hue and the word "Breached" appears. */
.sla { display: grid; gap: 2px; min-width: 7rem; }
.sla__bar { height: 4px; background: var(--rule); }
.sla__bar i { display: block; height: 100%; background: var(--text-2); }
.sla--breached .sla__bar i { background: var(--danger); }
.sla__text { font-size: var(--text-xs); color: var(--text-2); }
.sla--breached .sla__text { color: var(--danger); font-weight: 600; }

/* ------------------------------------------------------------ Audit log -- */

.audit { list-style: none; margin: 0; padding: 0; font-family: var(--font-mono); font-size: 0.8125rem; }
.audit li {
  display: grid;
  grid-template-columns: 11.5rem 9rem minmax(0, 1fr);
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: var(--hairline) solid var(--rule);
}
.audit time { color: var(--text-2); }
@media (max-width: 48rem) { .audit li { grid-template-columns: 1fr; gap: 0; } }

/* ------------------------------------------------------------- Notices -- */

.notice {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-inline-start: 4px solid var(--text-2);
  background: var(--surface);
  font-size: var(--text-sm);
}
.notice svg { width: 1.125rem; height: 1.125rem; flex: none; margin-top: 0.1rem; }
.notice--embargo { border-color: var(--embargo); }
.notice--embargo svg { color: var(--embargo); }
.notice--danger { border-color: var(--danger); }
.notice--danger svg { color: var(--danger); }
.notice--ok { border-color: var(--ok); }
.notice--ok svg { color: var(--ok); }
.notice--suggest { border-color: var(--suggest); }
.notice--suggest svg { color: var(--suggest); }

/* The banner of the quarantine lane. It stays in view, so the staff member
   always knows that the lane is open. */
.lane-banner {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--gutter);
  background: var(--red-ink);
  color: #fff;
  font-stretch: 85%;
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ------------------------------------------------------------ Pipeline -- */

.pipeline { display: flex; list-style: none; margin: 0; padding: 0; counter-reset: step; }
.pipeline li {
  flex: 1;
  display: grid;
  gap: var(--space-1);
  padding-top: var(--space-2);
  border-top: 3px solid var(--rule);
  font-size: var(--text-sm);
}
.pipeline li + li { margin-inline-start: 2px; }
.pipeline .is-done { border-top-color: var(--ok); }
.pipeline .is-current { border-top-color: var(--accent); font-weight: 600; }
.pipeline .is-failed { border-top-color: var(--danger); }
.pipeline__state { font-size: var(--text-xs); color: var(--text-2); font-weight: 400; }

/* ---------------------------------------------------------- Suggestion -- */

/* A value that the member must confirm. The dashed frame and the word
   "Suggested" mark it until the member confirms it (SYS-204). */
.suggestion {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border: var(--hairline) dashed var(--suggest);
  background: color-mix(in srgb, var(--suggest) 6%, var(--bg));
}
.suggestion__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.suggestion__source { font-size: var(--text-xs); color: var(--text-2); }
.suggestion__value { font-size: var(--text-md); }
.suggestion--confirmed { border-style: solid; border-color: var(--rule); background: var(--bg); }

/* ---------------------------------------------------------- Provenance -- */

.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-2) var(--space-4); font-size: var(--text-sm); }
.facts dt { color: var(--text-2); }
.facts dd { margin: 0; }

/* --------------------------------------------------------------- Footer -- */

.footer {
  margin-top: var(--space-9);
  padding-block: var(--space-6);
  border-top: 2px solid var(--rule-strong);
  font-size: var(--text-sm);
  color: var(--text-2);
}

/* ------------------------------------------------------------- Specimen -- */

/* These blocks serve the pattern library only. */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: var(--space-3); }
.swatch { border: var(--hairline) solid var(--rule); font-size: var(--text-xs); }
.swatch__chip { height: 4rem; }
.swatch__text { padding: var(--space-2); display: grid; gap: 2px; }
.specimen { display: grid; gap: var(--space-2); padding-block: var(--space-4); border-bottom: var(--hairline) solid var(--rule); }
.specimen__note { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-2); }
