/*
 * hq2 screens: the WLWYB visual identity, variant screen-tight (HQ, tools worked in all day), light only.
 * Every colour, size and family below is a token (wlwyb-1.2/wlwyb-tokens.css, copied whole from release 1.2, which
 * holds 1.1's tokens unchanged plus the part card's) or a calc of tokens. Structural words only otherwise.
 * ORDER-010; ORDER-018 moved base.html to the 1.2 file.
 */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--color-ground); color: var(--color-text); }
body { font-family: var(--type-stack-sans); font-size: var(--type-body-size); line-height: var(--type-body-line);
  font-weight: var(--type-body-weight); }
.wrap { max-width: var(--block-panel-max-width); margin: 0 auto; padding: 0 var(--block-panel-side-gutter); }

/* Masthead: chip, name, task navigation */
.masthead { background: var(--block-masthead-ground);
  border-bottom: var(--block-masthead-rule-width) solid var(--block-masthead-rule-color); }
.masthead .wrap { min-height: var(--block-masthead-height); display: flex; align-items: center; flex-wrap: wrap;
  gap: 0 var(--block-navigation-item-gap); }
.masthead .home { display: flex; align-items: center; gap: var(--block-masthead-chip-to-name); text-decoration: none;
  color: var(--block-masthead-name-color); margin-right: var(--block-masthead-name-to-nav); }
.chip { width: calc(var(--block-masthead-chip-size) * 2400 / 2229.4); height: auto; display: block;
  margin: var(--block-masthead-chip-clear) 0; }
.masthead .name { font-size: var(--block-masthead-name-type-size); line-height: var(--block-masthead-name-type-line);
  font-weight: var(--block-masthead-name-weight); }
.masthead nav { display: flex; flex-wrap: wrap; gap: 0 var(--block-navigation-item-gap); }
.masthead nav a, .subnav a { color: var(--block-navigation-item-color); text-decoration: none;
  font-size: var(--block-navigation-item-type-size); line-height: var(--block-masthead-height); }
.masthead nav a[aria-current], .subnav a[aria-current] { color: var(--block-navigation-current-color);
  text-decoration: underline; text-decoration-thickness: var(--shape-line-strong);
  text-underline-offset: var(--block-masthead-chip-clear); }
.masthead .who { margin-left: auto; font-size: var(--type-caption-size); color: var(--color-text-secondary); }
.masthead .who a { color: var(--color-text); }
/* ORDER-020 D3: "Signed in as <name>" and a small Sign out button beside it */
.masthead .who { display: flex; align-items: center; gap: var(--space-stack); }
.masthead .who-short { display: none; }
.masthead form.signout { margin: 0; display: inline; }
.masthead form.signout button { min-height: calc(var(--space-control-height) / 2); padding-block: 0;
  font-size: var(--type-caption-size); }
/* The sign-in and refused pages (D1, D2) */
.signin-panel { max-width: calc(var(--space-grid-gutter) * 24); }
.signin-panel p { margin-bottom: var(--space-text-to-button); }
.subnav { border-bottom: var(--shape-line-hairline) solid var(--color-line); }
.subnav .wrap { display: flex; flex-wrap: wrap; gap: 0 var(--block-navigation-item-gap); }
.subnav a { font-size: var(--type-caption-size); line-height: calc(var(--space-control-height) + var(--space-stack)); }

main.wrap { padding-top: var(--block-panel-row-gap); padding-bottom: calc(var(--space-grid-gutter) * 2); }

/* Head group and text */
h1 { margin: 0 0 var(--space-h1-to-text); font-size: var(--type-h2-size); line-height: var(--type-h2-line);
  font-weight: var(--type-h2-weight); }
h2 { margin: var(--space-text-to-button) 0 var(--space-h2-to-text); font-size: var(--type-h3-size);
  line-height: var(--type-h3-line); font-weight: var(--type-h3-weight); }
h3 { margin: var(--block-panel-row-gap) 0 var(--space-h2-to-text); font-size: var(--block-panel-title-size);
  line-height: var(--block-panel-title-line); font-weight: var(--block-panel-title-weight); }
p { margin: 0 0 var(--space-paragraph); }
.eyebrow { font-size: var(--block-head-group-eyebrow-type-size); line-height: var(--block-head-group-eyebrow-type-line);
  font-weight: var(--block-head-group-eyebrow-type-weight); color: var(--block-head-group-eyebrow-color);
  margin-bottom: var(--block-head-group-eyebrow-to-headline); }
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between;
  gap: var(--space-stack); margin-bottom: var(--block-panel-row-gap); }
.pagehead h1 { margin: 0; }
.pagehead .actions { display: flex; flex-wrap: wrap; gap: var(--space-button-to-button); }
.muted, .helptext { color: var(--color-text-secondary); font-size: var(--type-caption-size);
  line-height: var(--type-caption-line); }
.helptext { display: block; margin-top: var(--block-field-field-to-message); }
.warn, .late, .errorlist { color: var(--color-error); }
.errorlist { list-style: none; padding: 0; margin: 0 0 var(--block-field-field-to-message);
  font-size: var(--type-caption-size); }
a { color: var(--block-link-color); text-decoration: underline; text-decoration-thickness: var(--shape-line-hairline);
  text-underline-offset: var(--shape-line-strong); }
a:hover { text-decoration-thickness: var(--shape-line-strong); }
code, .code { font-family: var(--type-stack-mono); font-size: var(--type-code-size); }
:focus-visible { outline: var(--block-focus-ring-width) solid var(--block-focus-ring-colour);
  outline-offset: var(--block-focus-ring-offset); }
details > summary { cursor: pointer; font-weight: var(--type-label-weight); font-size: var(--type-label-size);
  line-height: var(--space-control-height); }

/* Panels and figure tiles */
.panel { border: var(--block-panel-edge-width) solid var(--block-panel-edge-colour); padding: var(--block-panel-padding);
  margin: 0 0 var(--block-panel-row-gap); min-width: 0; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(calc(var(--space-grid-gutter) * 8), 1fr));
  gap: var(--block-figure-tile-tile-to-tile); margin-bottom: var(--block-panel-row-gap); }
.tile { border-top: var(--block-figure-tile-rule-width) solid var(--block-figure-tile-rule-colour);
  padding-top: var(--block-figure-tile-rule-to-label); }
.tile .tl { font-size: var(--block-figure-tile-label-size); line-height: var(--block-figure-tile-label-line);
  font-weight: var(--block-figure-tile-label-weight); color: var(--block-figure-tile-label-colour); }
.tile .tv { margin-top: var(--block-figure-tile-label-to-value); font-size: var(--type-h3-size);
  line-height: var(--type-h3-line); font-weight: var(--block-figure-tile-value-weight); }
.tile .td { font-size: var(--block-figure-tile-delta-size); line-height: var(--block-figure-tile-delta-line); }

/* Tables: head fill, right-aligned tabular figures, sticky head inside the scroll box */
.table-wrap { overflow: auto; max-height: 75vh; margin-bottom: var(--space-stack); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: var(--block-table-cell-padding); text-align: left; vertical-align: top;
  font-size: var(--block-table-cell-type-size); line-height: var(--block-table-cell-type-line); }
th { background: var(--block-table-head-fill); font-weight: var(--block-table-head-type-weight);
  color: var(--block-table-head-colour); position: sticky; top: 0; z-index: 1; }
td { border-bottom: var(--block-table-rule-width) solid var(--block-table-rule-colour); }
th.n, td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.record th { position: static; width: 25%; }
tr.overridden td { box-shadow: inset 0 var(--block-table-selected-marker-width) 0 0 var(--color-signal); }
tr.overridden td:first-child { box-shadow: inset var(--block-table-selected-marker-width) 0 0 var(--color-signal); }
tr.total td { font-weight: var(--block-table-total-weight);
  border-top: var(--block-table-total-rule-width) solid var(--block-table-total-rule-colour); }
.filterbox { display: flex; align-items: center; gap: var(--block-toolbar-item-gap);
  margin-bottom: var(--block-toolbar-to-content); }
.filterbox .count { font-size: var(--block-toolbar-count-type-size); color: var(--block-toolbar-count-colour); }

/* Forms */
fieldset { border: var(--block-panel-edge-width) solid var(--block-panel-edge-colour); padding: var(--block-panel-padding);
  margin: 0 0 var(--block-panel-row-gap); min-width: 0; }
legend { font-weight: var(--block-panel-title-weight); font-size: var(--block-panel-title-size);
  line-height: var(--block-panel-title-line); padding: 0 var(--space-card-item); }
label { font-size: var(--block-field-label-type-size); line-height: var(--block-field-label-type-line);
  font-weight: var(--block-field-label-type-weight); color: var(--block-field-label-word);
  margin-right: var(--space-card-item); }
fieldset p { margin: 0 0 var(--space-stack); }
fieldset p label { display: block; margin-bottom: var(--block-field-label-to-field); }
input, select, textarea { font-family: inherit; font-size: var(--block-field-type-size);
  line-height: var(--block-field-type-line); color: var(--block-field-word); background: var(--block-field-fill);
  border: var(--block-field-edge-width) solid var(--block-field-edge); border-radius: var(--block-field-radius);
  min-height: var(--block-field-height); padding: var(--block-field-padding); max-width: 100%; }
input:hover, select:hover, textarea:hover { border-color: var(--block-field-hover-edge); }
input[type="checkbox"], input[type="radio"] { min-height: 0; }
input[type="file"] { border: 0; padding-left: 0; }
.errorlist + input, .errorlist + select { border: var(--block-field-error-edge-width) solid var(--block-field-error-edge); }
form.inline { display: inline; }
form.row { display: flex; flex-wrap: wrap; gap: var(--space-card-item); align-items: center; }

/* Buttons: secondary by default, one primary per page, destructive in red */
button, .btn { display: inline-flex; align-items: center; justify-content: center; min-height: var(--block-button-height);
  padding: var(--block-button-padding); border: var(--block-button-edge-width) solid var(--block-button-secondary-edge);
  background: var(--block-button-secondary-fill); color: var(--block-button-secondary-word);
  border-radius: var(--block-button-radius); font-family: inherit; font-size: var(--block-button-type-size);
  line-height: var(--block-button-type-line); font-weight: var(--block-button-type-weight); text-decoration: none;
  cursor: pointer; }
button:hover, .btn:hover { box-shadow: var(--block-press-plate-offset) var(--block-press-plate-offset) 0 0 var(--block-press-plate-colour); }
button.primary, .btn.primary { background: var(--block-button-primary-fill); color: var(--block-button-primary-word);
  border-color: var(--block-button-primary-edge); }
button.danger, .btn.danger { background: var(--block-button-destructive-fill); color: var(--block-button-destructive-word);
  border-color: var(--block-button-destructive-edge); }
button:disabled { background: var(--block-button-disabled-fill); color: var(--block-button-disabled-word); border-color: transparent; }

/* States: messages and alerts */
.msg { border: var(--shape-line-hairline) solid var(--color-line);
  border-left: calc(var(--shape-line-strong) * 2) solid var(--color-text); padding: var(--space-card-item) var(--space-stack);
  margin: 0 0 var(--space-stack); }
.msg.success { border-left-color: var(--color-text); }
.msg.success::before { content: "\2713\00a0"; font-weight: var(--type-label-weight); }
.msg.info { border-left-color: var(--color-text-secondary); }
.msg.warning { border-left-color: var(--color-signal); }
.msg.error { border-color: var(--color-error); color: var(--color-error); }
.alert-danger { border: calc(var(--shape-line-strong) * 2) solid var(--color-error); color: var(--color-text);
  padding: var(--block-panel-padding); margin: 0 0 var(--block-panel-row-gap); }
.alert-danger h2 { margin-top: 0; color: var(--color-error); }
.badge { display: inline-block; padding: 0 var(--space-card-item); border: var(--shape-line-hairline) solid currentColor;
  border-radius: var(--shape-radius); font-size: var(--type-caption-size); line-height: var(--type-caption-line);
  font-weight: var(--type-label-weight); white-space: nowrap; }
.badge.late, .badge.error { color: var(--color-error); }
.badge.signal { background: var(--color-signal); border-color: var(--color-signal); color: var(--color-on-signal); }
.empty { color: var(--block-table-empty-colour); }

/* Job board step line */
.steps span { display: inline-block; min-width: calc(var(--type-caption-line) + var(--space-unit)); text-align: center;
  border: var(--shape-line-hairline) solid var(--color-line); margin-right: var(--shape-line-hairline);
  font-size: var(--type-caption-size); line-height: var(--type-caption-line); color: var(--color-text-secondary); }
.steps .done { background: var(--color-text); color: var(--color-ground); border-color: var(--color-text); }
.steps .in_progress { background: var(--color-signal); color: var(--color-on-signal); border-color: var(--color-signal); }
.steps .blocked { border-color: var(--color-error); color: var(--color-error); }

/* Floor screens: large targets, readable at phone width */
body.floor { font-size: var(--type-lede-size); line-height: var(--type-lede-line); }
body.floor main.wrap { max-width: calc(var(--space-grid-gutter) * 28); }
body.floor h1 { font-size: var(--type-h3-size); line-height: var(--type-h3-line); }
a.big, button.big { display: block; width: 100%; min-height: calc(var(--space-control-height) * 2);
  margin: 0 0 var(--space-card-item); padding: var(--space-stack); font-size: var(--type-lede-size);
  line-height: var(--type-lede-line); text-align: left; border: var(--shape-line-hairline) solid var(--color-text);
  background: var(--color-ground); color: var(--color-text); text-decoration: none; }
a.big:hover, button.big:hover { box-shadow: var(--block-press-plate-offset) var(--block-press-plate-offset) 0 0 var(--block-press-plate-colour); }
a.big .muted, button.big .muted { display: block; margin-top: var(--space-unit); }
button.go { background: var(--block-button-primary-fill); color: var(--block-button-primary-word); text-align: center;
  font-weight: var(--block-button-type-weight); }
button.stop { color: var(--color-error); border-color: var(--color-error); text-align: center; }
.counted { font-weight: var(--type-label-weight); }
.counted::before { content: "\2713\00a0"; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-card-item);
  max-width: calc(var(--space-grid-gutter) * 18); margin: var(--space-stack) 0; }
.pad button { min-height: calc(var(--space-control-height) * 2); font-size: var(--type-h3-size); }
input.count { font-size: var(--type-h1-size); line-height: var(--type-h1-line); width: 100%;
  max-width: calc(var(--space-grid-gutter) * 18); text-align: right; min-height: calc(var(--space-control-height) * 2); }
body.floor form.row button { min-height: calc(var(--space-control-height) * 1.5);
  min-width: calc(var(--space-control-height) * 1.5); font-size: var(--type-lede-size); }
body.floor table th, body.floor table td { font-size: var(--type-body-size); line-height: var(--type-body-line); }

@media (max-width: 720px) {
  .wrap { padding: 0 var(--space-stack); }
  h1 { font-size: var(--type-h3-size); line-height: var(--type-h3-line); }
  .masthead .wrap { gap: 0 var(--space-stack); }
  .masthead .home { margin-right: 0; }
  .masthead .name { display: none; }
  .masthead nav { gap: 0 var(--space-stack); }
  .masthead nav a { font-size: var(--type-label-size); line-height: var(--block-masthead-height); }
  .masthead .who { margin-left: 0; width: 100%; padding-bottom: var(--space-unit); }
  .masthead .who-full { display: none; }
  .masthead .who-short { display: inline; }
  .pagehead .actions { width: 100%; }
  .pagehead .actions .btn, .pagehead .actions button { flex: 1; }
}
.scroll-x { overflow-x: auto; }
pre.report { white-space: pre-wrap; font-family: var(--type-stack-mono); font-size: var(--type-code-size); line-height: var(--type-code-line); border: var(--shape-line-hairline) solid var(--color-line); padding: var(--block-panel-padding); }
.boxno { font-weight: var(--type-label-weight); }
.boxline { font-size: var(--type-h3-size); line-height: var(--type-h3-line); }
.fillname { display: inline-block; min-width: calc(var(--space-grid-gutter) * 8); }
form.tight { display: flex; flex-wrap: wrap; gap: var(--space-unit) var(--space-card-item); align-items: center;
  margin: 0 0 var(--space-unit); }
form.tight input[type="number"] { width: calc(var(--space-grid-gutter) * 4); }
form.tight label { margin-right: 0; }
/* ORDER-013 (D-100): the latest hand change, shown next to the field it changed. */
.changed { display: block; color: var(--color-text-secondary); font-size: var(--type-caption-size);
  line-height: var(--type-caption-line); border-left: var(--shape-line-strong) solid var(--color-signal);
  padding-left: var(--space-unit); margin-top: var(--space-unit); }
.changed .was { text-decoration: line-through; }

/* ORDER-015: the Inventory search, the colour picker, the list, the adjust popover, Projects. Tokens only. */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.finder { display: flex; flex-wrap: wrap; gap: var(--space-card-item); margin-bottom: var(--space-unit); }
.finder-search { position: relative; flex: 1 1 calc(var(--space-grid-gutter) * 16); }
.finder-colour { position: relative; flex: 0 1 calc(var(--space-grid-gutter) * 10); }
.finder-search input { width: 100%; font-size: var(--type-lede-size); line-height: var(--type-lede-line);
  min-height: calc(var(--space-control-height) * 1.5); }
.colour-btn { width: 100%; justify-content: flex-start; min-height: calc(var(--space-control-height) * 1.5);
  font-size: var(--type-lede-size); }
.finder-list { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; margin: var(--space-unit) 0 0; padding: 0;
  list-style: none; background: var(--color-ground); border: var(--shape-line-hairline) solid var(--color-text);
  max-height: 60vh; overflow-y: auto; min-width: calc(var(--space-grid-gutter) * 12); }
.finder-list .group { padding: var(--space-unit) var(--space-card-item); font-size: var(--type-caption-size);
  line-height: var(--type-caption-line); color: var(--color-text-secondary); background: var(--block-table-head-fill); }
.finder-list .opt { display: flex; align-items: center; flex-wrap: wrap; gap: 0 var(--space-card-item);
  padding: var(--space-card-item); cursor: pointer; border-bottom: var(--shape-line-hairline) solid var(--color-line);
  min-height: var(--space-control-height); }
.finder-list .opt[aria-selected="true"], .finder-list .opt:hover { box-shadow: inset calc(var(--shape-line-strong) * 2) 0 0 0 var(--color-signal); }
.finder-list .opt .nm { flex: 1 1 auto; }
.finder-list .opt .qty { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: var(--type-label-weight); }
.swatch { display: inline-block; width: var(--type-caption-line); height: var(--type-caption-line); vertical-align: middle;
  margin-right: var(--space-unit); border: var(--shape-line-hairline) solid var(--color-line); }
.swatch.none { background: transparent; }
.swatch.big { width: var(--type-h3-line); height: var(--type-h3-line); }
.pager { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-card-item); margin: var(--space-stack) 0; }
tr.greyed td { color: var(--color-text-secondary); }
tr.greyed td a { color: var(--color-text-secondary); }
tr.rowlink { cursor: pointer; }
tr.rowlink:hover td { background: var(--block-table-head-fill); }
details.boxedit { margin-bottom: var(--block-panel-row-gap); }
dialog.popover { border: var(--shape-line-hairline) solid var(--color-text); padding: var(--block-panel-padding);
  max-width: min(calc(var(--space-grid-gutter) * 24), calc(100vw - var(--space-stack) * 2)); width: 100%;
  background: var(--color-ground); color: var(--color-text); }
dialog.popover::backdrop { background: color-mix(in srgb, var(--color-text) 35%, transparent); }
dialog.popover h2 { margin-top: 0; }
dialog.popover input:not([type="radio"]) { width: 100%; }
dialog.popover fieldset.how { border: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-card-item); }
dialog.popover .nowafter { display: flex; gap: var(--space-grid-gutter); font-size: var(--type-lede-size); }
@media (max-width: 720px) {
  .finder-colour { flex: 1 1 100%; }
  table.inv th:nth-child(3), table.inv td:nth-child(3) { min-width: calc(var(--space-grid-gutter) * 6); }
}
h1 .code { font-size: inherit; }
.finder-colour .finder-list { left: auto; right: 0; }

/* ORDER-016: Incoming parcels. The parcel table stacks into one card per line at phone width; the allocation
   panel has large number boxes and a live Missing line. Tokens only. */
.table-wrap:has(> table.parcel) { max-height: none; }
table.alloc td:nth-child(2) { white-space: nowrap; }
table.parcel tr.done td { color: var(--color-text-secondary); }
table.parcel tr.done td a { color: var(--color-text-secondary); }
table.parcel .btn { min-height: calc(var(--space-control-height) * 1.5); }
details.quiet { margin-top: var(--space-unit); }
details.quiet > summary { font-weight: var(--type-body-weight); font-size: var(--type-caption-size);
  color: var(--color-text-secondary); line-height: var(--type-caption-line); }
details.quiet form { display: flex; flex-wrap: wrap; gap: var(--space-unit) var(--space-card-item); align-items: center;
  margin-top: var(--space-unit); }
.fillbtns { display: flex; flex-wrap: wrap; gap: var(--space-button-to-button); margin: var(--space-stack) 0; }
.fillbtns .btn { min-height: calc(var(--space-control-height) * 1.5); font-size: var(--type-lede-size); }
table.alloc input.qty { width: calc(var(--space-grid-gutter) * 5); text-align: right; font-size: var(--type-h3-size);
  line-height: var(--type-h3-line); min-height: calc(var(--space-control-height) * 1.5); font-variant-numeric: tabular-nums; }
table.alloc .rec { display: block; }
table.alloc tr.inventory td { border-top: var(--block-table-total-rule-width) solid var(--block-table-rule-colour); }
table.alloc tr.total td { font-size: var(--type-lede-size); line-height: var(--type-lede-line); }
table.alloc output { font-size: var(--type-h3-size); line-height: var(--type-h3-line); font-variant-numeric: tabular-nums; }
.alert-confirm { border: calc(var(--shape-line-strong) * 2) solid var(--color-text); padding: var(--block-panel-padding);
  margin: 0 0 var(--block-panel-row-gap); }
.alert-confirm h2 { margin-top: 0; }
.alert-confirm .nowafter { display: flex; flex-wrap: wrap; gap: var(--space-grid-gutter); font-size: var(--type-lede-size); }
@media (max-width: 720px) {
  table.parcel thead { display: none; }
  table.parcel, table.parcel tbody, table.parcel tr, table.parcel td { display: block; width: 100%; }
  table.parcel tr { border-bottom: var(--block-table-rule-width) solid var(--block-table-rule-colour);
    padding: var(--space-card-item) 0; }
  table.parcel td { border: 0; padding: 0 0 var(--space-unit); text-align: left; }
  table.parcel td:empty { display: none; }
  table.parcel td.n::before, table.parcel td.lbl::before { content: attr(data-label) ": ";
    color: var(--color-text-secondary); font-size: var(--type-caption-size); }
  table.parcel td.code { font-size: var(--type-lede-size); font-weight: var(--type-label-weight); }
  table.parcel .btn { width: 100%; margin-top: var(--space-unit); }
  table.alloc input.qty { width: calc(var(--space-grid-gutter) * 4); }
}


/* ORDER-024: the Invoices page. Existing tokens only; the five states reuse BrickLink's status colours (bl-*). */
.iv-filters { display: flex; flex-wrap: wrap; gap: var(--space-stack) var(--space-grid-gutter); align-items: flex-end;
  margin-bottom: var(--space-stack); }
.iv-filters .iv-label { display: block; font-size: var(--type-caption-size); line-height: var(--type-caption-line);
  font-weight: var(--type-label-weight); margin-bottom: var(--space-unit); }
.iv-pills { display: flex; flex-wrap: wrap; gap: var(--space-unit); }
.iv-pills a { display: inline-block; padding: 0 var(--space-card-item); border: var(--shape-line-hairline) solid var(--color-text-secondary);
  border-radius: 999px; font-size: var(--type-caption-size); line-height: calc(var(--type-caption-line) + var(--space-unit));
  text-decoration: none; color: var(--color-text); white-space: nowrap; }
.iv-pills a[aria-current] { background: var(--color-text); color: var(--color-ground); border-color: var(--color-text);
  font-weight: var(--type-label-weight); }
.iv-filters select, .iv-filters input[type="search"] { min-height: var(--block-field-height); }
.iv-count { color: var(--color-text-secondary); font-size: var(--type-caption-size); }
.iv-sub { display: block; font-size: var(--type-caption-size); line-height: var(--type-caption-line);
  color: var(--color-text-secondary); }
.iv-src { font-size: var(--type-caption-size); font-weight: var(--type-label-weight); text-transform: uppercase;
  color: var(--color-text-secondary); white-space: nowrap; }
.iv-chk { font-size: var(--type-caption-size); line-height: var(--type-caption-line); white-space: nowrap; }
.iv-no { color: var(--color-error); font-weight: var(--type-label-weight); }
.iv-na { color: var(--color-text-secondary); }
.iv-asof-failed { color: var(--color-error); }
.iv-actions { display: flex; flex-wrap: wrap; gap: var(--space-stack); align-items: flex-end; margin: var(--space-stack) 0; }
.iv-actions form { display: flex; flex-wrap: wrap; gap: var(--space-unit); align-items: flex-end; margin: 0; }
.iv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--block-panel-row-gap); }
dl.iv-facts { display: grid; grid-template-columns: minmax(8rem, 1fr) 2fr; gap: var(--space-unit) var(--space-stack); margin: 0; }
dl.iv-facts dt { color: var(--color-text-secondary); font-size: var(--type-caption-size); }
dl.iv-facts dd { margin: 0; overflow-wrap: anywhere; }
.iv-doc { display: grid; grid-template-columns: 1fr 1fr; gap: var(--block-panel-row-gap);
  border-top: var(--shape-line-hairline) solid var(--color-line); padding-top: var(--space-stack); margin-top: var(--space-stack); }
.iv-doc:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.iv-preview { width: 100%; height: 22rem; border: var(--shape-line-hairline) solid var(--color-line); }
.iv-group h2 { display: flex; flex-wrap: wrap; gap: var(--space-stack); align-items: baseline; }
.iv-group h2 .muted { font-weight: normal; }
table.invoices td { vertical-align: top; }
table.invoices td.iv-date, table.invoices td.iv-bl { white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
  .iv-grid, .iv-doc { grid-template-columns: 1fr; }
  dl.iv-facts { grid-template-columns: 1fr; }
}
.iv-crumb { display: inline-block; font-size: var(--type-caption-size); font-weight: var(--type-label-weight);
  margin-bottom: var(--space-unit); }
.tiles.iv-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 720px) { .tiles.iv-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ORDER-018 (C-75, block 4.8): the part card. One order everywhere: picture, part code, part name, colour, then the
   slot. Never: a fill or tint on a card, a red row, a coloured border, a picture cropped, the order changed. The only
   red is a shortfall figure with its error mark (.pc-short). Tokens 1.2 only. */
.pc-code { font-family: var(--block-part-card-code-family); font-weight: var(--block-part-card-code-weight);
  font-size: var(--block-part-card-code-size); line-height: var(--block-part-card-code-line);
  color: var(--block-part-card-code-colour); }
.pc-code a { color: inherit; }
.pc-name { font-family: var(--block-part-card-name-family); font-size: var(--block-part-card-name-size);
  line-height: var(--block-part-card-name-line); font-weight: var(--block-part-card-name-set-weight); }
.pc-name.pc-missing { color: var(--block-part-card-name-missing-colour); }
.pc-printed { font-family: var(--block-part-card-flag-printed-family); font-weight: var(--block-part-card-flag-printed-weight);
  font-size: var(--block-part-card-flag-printed-size); line-height: var(--block-part-card-flag-printed-line); }
.pc-l1, .pc-l2, .pc-l0 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-card-item); }
.pc-l2 { align-items: center; }
.pc-colour { font-family: var(--block-part-card-colour-name-family); font-size: var(--block-part-card-colour-name-size);
  line-height: var(--block-part-card-colour-name-line); font-weight: var(--block-part-card-colour-name-weight);
  display: inline-flex; align-items: center; }
.pc-chip { display: inline-block; flex: none; width: var(--block-part-card-colour-chip); height: var(--block-part-card-colour-chip);
  border: var(--block-part-card-colour-chip-edge) solid var(--color-text); margin-right: var(--space-unit); }
.pc-cid { font-family: var(--block-part-card-colour-id-family); font-size: var(--block-part-card-colour-id-size);
  line-height: var(--block-part-card-colour-id-line); color: var(--block-part-card-colour-id-colour); }
.pc-weight, .pc-read, .pc-cat, .pc-sep { color: var(--block-part-card-weight-colour); }
.pc-pic img { display: block; object-fit: contain; }
/* row: a table row whose leading cells are the card */
td.pc-pic { width: calc(var(--block-part-card-picture-row) + var(--block-part-card-row-gap)); padding-right: 0; }
td.pc-pic img { width: var(--block-part-card-picture-row); height: var(--block-part-card-picture-row); }
th.pc-pic { width: calc(var(--block-part-card-picture-row) + var(--block-part-card-row-gap)); padding-right: 0; }
table.pc-table td { vertical-align: middle; }
td.pc-id { min-width: calc(var(--space-grid-gutter) * 8); }
/* head: a parcel line head, the slot's quantities at the tile value step */
.pc-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--block-part-card-row-gap);
  padding: var(--block-part-card-row-padding); border-bottom: var(--shape-line-hairline) solid var(--block-part-card-row-line);
  margin-bottom: var(--space-stack); }
.pc-head .pc-pic img { width: var(--block-part-card-picture-row); height: var(--block-part-card-picture-row); }
.pc-head .pc-id { flex: 1 1 calc(var(--space-grid-gutter) * 8); min-width: 0; }
.pc-head .pc-slot { display: flex; flex-wrap: wrap; gap: var(--block-part-card-row-gap) calc(var(--block-part-card-row-gap) * 2);
  margin-left: auto; }
.pc-fig { text-align: right; }
.pc-fig .k { display: block; font-size: var(--type-caption-size); line-height: var(--type-caption-line);
  color: var(--color-text-secondary); }
.pc-fig .v { display: block; font-family: var(--block-part-card-quantity-family); font-weight: var(--block-part-card-quantity-weight);
  font-size: var(--block-part-card-quantity-size); line-height: var(--block-part-card-quantity-line);
  font-variant-numeric: tabular-nums; }
/* detail: the part page head */
.pc-detail { display: flex; align-items: flex-start; gap: calc(var(--block-part-card-row-gap) * 1.5); flex: 1 1 0; min-width: 0; }
.pc-detail .pc-pic img { width: var(--block-part-card-picture-detail); height: var(--block-part-card-picture-detail); }
.pc-detail .pc-id { flex: 1 1 0; min-width: 0; }
.pc-detail h1.pc-name { margin: 0 0 var(--space-unit); font-family: var(--type-h1-family); font-size: var(--type-h1-size);
  line-height: var(--type-h1-line); font-weight: var(--type-h1-weight); }
.pc-detail .pc-slot { margin-top: var(--space-stack); }
.pc-detail .pc-slot .tiles { margin-bottom: 0;
  grid-template-columns: repeat(auto-fit, minmax(calc(var(--space-grid-gutter) * 5), 1fr)); }
/* tile: built for the floor screens; keeps its picture space */
.pc-tile { display: grid; gap: var(--space-card-item); padding: var(--space-stack);
  border: var(--shape-line-hairline) solid var(--color-line); }
.pc-tile .pc-pic { height: var(--block-part-card-picture-tile); display: grid; place-items: center; }
.pc-tile .pc-pic img { width: var(--block-part-card-picture-tile); height: var(--block-part-card-picture-tile); }
.pc-nopic { display: grid; place-items: center; width: 100%; height: 100%; color: var(--color-text-secondary);
  font-size: var(--type-caption-size); line-height: var(--type-caption-line);
  border: var(--shape-line-hairline) dashed var(--color-line); }
/* line: a search suggestion */
.pc-line { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-card-item); }
.pc-pill { border: var(--shape-line-hairline) solid var(--color-text-secondary); padding: 0 var(--space-card-item);
  font-size: var(--type-caption-size); line-height: var(--type-caption-line); color: var(--color-text-secondary); }
.finder-list .opt .pc-line { flex: 1 1 auto; }
/* the one red: a shortfall figure with the error mark (C-35) */
.pc-short { color: var(--block-part-card-missing-colour); font-weight: var(--type-label-weight); white-space: nowrap; }
.pc-mark { width: var(--block-field-error-mark-size); height: var(--block-field-error-mark-size); vertical-align: -2px;
  margin-right: var(--block-status-mark-gap); }
.pc-mark-o { fill: var(--block-status-mark-error); }
.pc-mark-g { fill: var(--block-status-mark-glyph); }
.pc-state { font-weight: var(--type-label-weight); }
@media (max-width: 720px) {
  .pc-detail h1.pc-name { font-size: var(--type-h3-size); line-height: var(--type-h3-line); }
  .pc-detail .pc-pic img { width: var(--block-part-card-picture-tile); height: var(--block-part-card-picture-tile); }
  .pc-head .pc-slot { margin-left: 0; }
  .pc-fig { text-align: left; }
  table.parcel td.pc-pic { float: left; width: auto; padding: 0 var(--space-card-item) 0 0; }
  table.parcel td.pc-id { min-width: 0; }
}

/* ORDER-017 (D-117, D-118): the Incoming parcels list after BrickLink's Orders Placed. One dense table, light only.
   BrickLink's own status colours sit here as named variables beside the identity tokens (C4): text colour only, as
   BrickLink draws them. hq2's own state, before a feed, is grey italics. */
:root {
  --hq2-bl-status-red: #C00000;
  --hq2-bl-status-orange: #B35A00;
  --hq2-bl-status-brown: #7A4A1E;
  --hq2-bl-status-green: #1C7A1C;
  --hq2-bl-status-grey: var(--color-text-secondary);
}
.bl-asof { color: var(--color-text-secondary); font-size: var(--type-caption-size); line-height: var(--type-caption-line);
  margin: 0 0 var(--space-unit); }
table.orders td { vertical-align: middle; }
table.orders td.o-id a { font-variant-numeric: tabular-nums; }
table.orders td.o-date, table.orders td.o-id { white-space: nowrap; }
table.orders th.o-flag, table.orders td.o-flag { width: calc(var(--space-grid-gutter) * 1.5); padding-right: 0; }
.flag { display: inline-block; line-height: 0; vertical-align: middle; }
.flag img { width: calc(var(--space-unit) * 5); height: calc(var(--space-unit) * 3.5); border: var(--shape-line-hairline) solid var(--color-line); display: block; }
.flag-box { min-width: calc(var(--space-unit) * 5); height: calc(var(--space-unit) * 3.5);
  border: var(--shape-line-hairline) solid var(--color-text-secondary);
  font-size: var(--type-small-size); line-height: calc(var(--space-unit) * 3); text-align: center; color: var(--color-text-secondary);
  font-weight: var(--type-label-weight); }
.bl-st { font-weight: var(--type-label-weight); white-space: nowrap; }
.bl-red { color: var(--hq2-bl-status-red); }
.bl-orange { color: var(--hq2-bl-status-orange); }
.bl-brown { color: var(--hq2-bl-status-brown); }
.bl-green { color: var(--hq2-bl-status-green); }
.bl-grey { color: var(--hq2-bl-status-grey); }
.bl-hq2 { color: var(--hq2-bl-status-grey); font-style: italic; font-weight: var(--type-body-weight); }
/* ORDER-021: with the Tracking column the list would outgrow the panel; "N of M lines done" may break onto two
   lines instead (the badge never breaks). */
table.orders td.o-alloc { white-space: normal; }
table.orders td.o-alloc .badge { white-space: nowrap; }
/* ORDER-021: so the ten columns fit the panel, the "Items (Lots)" head may break onto two lines and a very long
   seller name (a company form such as "(haftungsbeschraenkt)") may break inside a word; a tracking number never does. */
table.orders th.o-items { white-space: normal; }
table.orders td.o-seller { overflow-wrap: anywhere; }
/* ORDER-021: the tracking number in the caption size, so the list keeps its width; it breaks only at a space, never
   inside a number. The shipping method is the cell's hover title. */
table.orders td.o-track { font-size: var(--type-caption-size); line-height: var(--type-caption-line);
  font-variant-numeric: tabular-nums; overflow-wrap: normal; word-break: keep-all; }
/* B4: at phone width a row is two lines: ID, flag and status; store and seller under them; allocated at the right.
   Date, items and grand total are hidden. */
@media (max-width: 599px) {
  table.orders thead { display: none; }
  table.orders, table.orders tbody { display: block; width: 100%; }
  table.orders tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-card-item);
    padding: var(--space-card-item) 0; border-bottom: var(--block-table-rule-width) solid var(--block-table-rule-colour); }
  /* a zero-height item after the first line forces store and seller onto the second */
  table.orders tr::after { content: ""; order: 5; flex-basis: 100%; height: 0; }
  table.orders td { border: 0; padding: 0; }
  table.orders td.o-date, table.orders td.o-items, table.orders td.o-total { display: none; }
  /* ORDER-021: the Tracking column is a desk column, hidden at phone width */
  table.orders td.o-track { display: none; }
  table.orders td.o-id { order: 1; }
  table.orders td.o-id a { font-weight: var(--type-label-weight); }
  table.orders td.o-flag { order: 2; width: auto; align-self: center; }
  table.orders td.o-status { order: 3; }
  table.orders td.o-alloc { order: 4; margin-left: auto; text-align: right; font-size: var(--type-caption-size);
    line-height: var(--type-caption-line); color: var(--color-text-secondary); }
  table.orders td.o-store { order: 6; }
  table.orders td.o-seller { order: 7; color: var(--color-text-secondary); }
  /* ORDER-019 H: store and seller are now links of the click area; the separator sits on the seller's link. */
}
/* the list is one wide table: the page takes the full panel width and the table does not scroll in a box */
body.floor main.wrap:has(table.orders) { max-width: var(--block-panel-max-width); }
.table-wrap:has(> table.orders) { max-height: none; }

/* ORDER-019 B, E (D-130): the card's two click areas and the NO PIC box. The picture (or the box) opens BrickLink's
   price guide in a new tab; in a row the whole text cell is one link to the part page. The box is a flagged deviation
   from 4.8 ("the picture cell closes", "never a fill or tint on a card"), built on David's word for hq2 (D-132). */
.pc-bl { display: block; line-height: 0; text-decoration: none; }
.pc-nopicbox { display: flex; align-items: center; justify-content: center; box-sizing: border-box;
  width: var(--block-part-card-picture-row); height: var(--block-part-card-picture-row);
  background: var(--color-fill-tint); color: var(--color-text-secondary);
  /* ORDER-021 (LATER-small-fixes 2): small enough to sit inside the 48 px box with room on both sides; never
     spills out of it. */
  font-family: var(--type-code-family); font-size: var(--type-small-size); line-height: 1;
  font-weight: var(--type-code-weight); letter-spacing: 0; text-align: center; overflow: hidden;
  padding: 0 var(--space-unit); }
.pc-detail .pc-nopicbox { width: var(--block-part-card-picture-detail); height: var(--block-part-card-picture-detail); }
a.pc-text { display: block; color: inherit; text-decoration: none; }
a.pc-text:hover .pc-code, a.pc-text:focus-visible .pc-code { text-decoration: underline; }
a.pc-text .pc-code { color: var(--color-link); }
@media (max-width: 720px) {
  .pc-detail .pc-nopicbox { width: var(--block-part-card-picture-tile); height: var(--block-part-card-picture-tile); }
}

/* ORDER-019 H: the Incoming parcels list. The ID opens BrickLink's order page; date, flag, store and seller are one
   click area to hq2's parcel page. */
table.orders td.o-area { padding: 0; }
table.orders a.o-hit { display: block; color: inherit; text-decoration: none; padding: var(--block-table-cell-padding); }
table.orders tr:has(a.o-hit:hover) td.o-area, table.orders tr:has(a.o-hit:focus-visible) td.o-area {
  background: var(--block-table-head-fill); }
table.orders tr:has(a.o-hit:hover) td.o-store a.o-hit { text-decoration: underline; }
@media (max-width: 720px) {
  table.orders a.o-hit { padding: 0; display: inline; }
  table.orders td.o-seller a.o-hit:not(:empty)::before { content: "/ "; }
}

/* ORDER-019 F7: where the login's person has no right, one muted line names who may. */
.who-may { margin: 0; font-size: var(--type-caption-size); line-height: var(--type-caption-line); }

/* ORDER-019 G: the part page's lists fold, closed by default; the heading sits in the summary with its count. */
details.fold { margin: var(--space-text-to-button) 0 0; }
/* ORDER-021 (LATER-small-fixes 3): the arrow is drawn inside the summary, at the page margin where the other headings
   start, not hung outside it by the browser's marker. A small CSS triangle, no glyph; it turns down when open. */
details.fold > summary { cursor: pointer; list-style: none; display: flex; align-items: center; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: ""; display: block; flex: none; width: 0; height: 0;
  margin-right: calc(var(--space-unit) * 2); border-top: 5px solid transparent; border-bottom: 5px solid transparent;
  border-left: 7px solid currentColor; transition: transform 0.1s; }
details.fold[open] > summary::before { transform: rotate(90deg); }
details.fold > summary h2 { display: inline; margin: 0; }
details.fold > summary .fold-n { color: var(--color-text-secondary); font-weight: normal; }
details.fold[open] > summary { margin-bottom: var(--space-h2-to-text); }

/* ORDER-019 A (D-130): every table sorts by a header click and resizes by a grip; one script, static/hq2/tables.js.
   The direction is a small CSS triangle, no glyph. */
button.tb-sort { all: unset; box-sizing: border-box; cursor: pointer; display: inline; font: inherit; color: inherit; }
button.tb-sort:focus-visible { outline: var(--block-focus-ring-width) solid var(--block-focus-ring-colour); outline-offset: 2px; }
button.tb-sort::after { content: ""; display: inline-block; width: 0; height: 0; margin-left: var(--space-unit);
  vertical-align: middle; border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid transparent; border-bottom: 0; }
button.tb-sort:hover::after { border-top-color: var(--color-line); }
button.tb-sort[data-dir="asc"]::after { border-top: 0; border-bottom: 5px solid currentColor; }
button.tb-sort[data-dir="desc"]::after { border-bottom: 0; border-top: 5px solid currentColor; }
th.pc-sorts > span + span { margin-left: var(--space-unit); }
th.pc-sorts > span + span button.tb-sort { color: var(--color-text-secondary); font-weight: normal; }
.tb-grip { position: absolute; top: 0; right: 0; bottom: 0; width: 8px; cursor: col-resize; touch-action: none;
  z-index: 2; }
.tb-grip::after { content: ""; position: absolute; top: 25%; bottom: 25%; right: 3px; width: 2px;
  background: var(--color-line); }
.tb-grip:hover::after, .tb-grip:focus-visible::after, .tb-grip.tb-active::after { background: var(--color-text-secondary); }
table.tb-fixed { table-layout: fixed; max-width: none; }
/* ORDER-021 (LATER-small-fixes 1): a table widened past its box scrolls sideways in the box. tables.js marks the box
   tb-wide; its scrollbar stays visible (macOS hides overlay scrollbars until a scroll), and a soft edge shows on the
   side that has more columns. */
.table-wrap.tb-wide { overflow-x: scroll;
  background: linear-gradient(to right, var(--color-ground), var(--color-ground)) left / 16px 100% no-repeat local,
    linear-gradient(to right, var(--color-ground), var(--color-ground)) right / 16px 100% no-repeat local,
    linear-gradient(to right, var(--color-line), transparent) left / 8px 100% no-repeat scroll,
    linear-gradient(to left, var(--color-line), transparent) right / 8px 100% no-repeat scroll; }
.table-wrap.tb-wide::-webkit-scrollbar { height: 10px; width: 10px; }
.table-wrap.tb-wide::-webkit-scrollbar-track { background: var(--block-table-head-fill); }
.table-wrap.tb-wide::-webkit-scrollbar-thumb { background: var(--color-text-secondary); border-radius: 5px; }
table.tb-fixed th, table.tb-fixed td { overflow: hidden; text-overflow: ellipsis; }
table.tb-fixed th.pc-pic, table.tb-fixed td.pc-pic { overflow: visible; }
.tb-sortby { display: none; margin: 0 0 var(--space-unit); }
.tb-sortby.tb-on { display: block; }
.tb-sortby select { min-height: var(--block-field-height); }
@media (max-width: 720px) {
  .tb-grip { display: none; }
}

/* ORDER-025 (D-163): an order's title on the order page (h1) and each parcel header on the project page (h3),
   styled like the order's row on the Incoming parcels list: BL order id, flag, store, seller, date, status,
   tracking on one wrapping line. Existing tokens and classes only (flag, bl-st, bl-*). */
.otitle { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-unit) var(--space-card-item);
  margin: 0 0 var(--space-h2-to-text); }
.otitle .ot-id { margin: 0; font-variant-numeric: tabular-nums; }
.otitle-3 { margin-top: var(--block-panel-row-gap); }
.otitle .ot-flag { align-self: center; }
.otitle .ot-store { font-weight: var(--type-label-weight); }
.otitle .ot-seller { color: var(--color-text-secondary); overflow-wrap: anywhere; }
.otitle a.ot-area { color: inherit; text-decoration: none; display: inline-flex; flex-wrap: wrap; align-items: baseline;
  gap: var(--space-unit) var(--space-card-item); }
.otitle a.ot-area:hover .ot-store, .otitle a.ot-area:focus-visible .ot-store { text-decoration: underline; }
.otitle .ot-date { white-space: nowrap; }
.otitle .ot-track { font-size: var(--type-caption-size); line-height: var(--type-caption-line); }
.ot-progress { margin-top: 0; }

/* ORDER-032: the carrier's status beside a tracking number, in the tracking's caption size: text colour only, from
   the BrickLink status colours above (delivered green, problem red, not found or expired orange), on its way in the
   text colour, nothing known yet grey. The carrier, its words, last event and checked at are the hover title. */
.trk-st { font-weight: var(--type-label-weight); white-space: nowrap; }
.trk-delivered { color: var(--hq2-bl-status-green); }
.trk-transit { color: var(--color-text); }
.trk-problem { color: var(--hq2-bl-status-red); }
.trk-warn { color: var(--hq2-bl-status-orange); }
.trk-muted { color: var(--hq2-bl-status-grey); font-weight: normal; }
