/* Generated by scripts/build_tokens.py from design/css/*.css. Edit the source, then rebuild. */
@layer reset, tokens, base, components, blocks, layouts, pages;
/* ---- design/css/base.css · V5 shared base sheet (docs/v5-design.md). The reset and the page defaults: the only
   element-level rules in the system. Tokens only; never a profile class: the profile tokens carry the difference. ---- */

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { color-scheme: light; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body { margin: 0; }
  h1, h2, h3, h4, p, dl, dd, ul, ol, figure, blockquote { margin: 0; }
  ul[class], ol[class] { padding: 0; list-style: none; }
  img, svg, video, iframe { display: block; max-width: 100%; }
  button, input, select, textarea { font: inherit; color: inherit; }
  button { cursor: pointer; }
  table { border-collapse: collapse; }
  [hidden] { display: none !important; }
}

@layer base {
  /* The two faces of the application, the same files for both profiles. */
  @font-face { font-family: "Libre Caslon Text"; src: url("fonts/LibreCaslonText.woff") format("woff"); font-weight: 400 700; font-style: normal; font-display: swap; }
  @font-face { font-family: "Libre Caslon Text"; src: url("fonts/LibreCaslonText-Italic.woff") format("woff"); font-weight: 400 700; font-style: italic; font-display: swap; }
  @font-face { font-family: "Albert Sans"; src: url("fonts/AlbertSans-Variable.woff") format("woff"); font-weight: 300 700; font-style: normal; font-display: swap; }

  body {
    background: var(--ds-ui-color-bg);
    color: var(--ds-ui-color-ink);
    font-family: var(--ds-ui-font-sans);
    font-size: var(--ds-ui-base-size);
    font-weight: var(--ds-ui-weight-regular);
    line-height: var(--ds-ui-line-body);
    -webkit-font-smoothing: antialiased;
  }
  /* Tabular figures only where numbers line up (ds-num, tables, prices, counts); never on running text, because this
     face's tabular set also spaces punctuation, and a serif comma then shows a gap before it ("Sunday , Nov 15"). */
  table, .ds-num, .ds-count, .ds-piece__price, .ds-piece__no, .ds-qrow__n { font-variant-numeric: tabular-nums; }
  a { color: inherit; text-decoration: none; }
  a:hover { text-decoration: underline; }
  button, a, input, select, textarea, summary { touch-action: manipulation; }
  button:disabled { cursor: default; opacity: var(--ds-ui-opacity-disabled); }
  strong, b { font-weight: var(--ds-ui-weight-strong); }
  :focus-visible { outline: var(--ds-ui-dim-bar) solid var(--ds-ui-color-focus); outline-offset: var(--ds-ui-dim-bar); }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  }
}
/* ---- design/css/components.css · V5 shared controls (docs/v5-design.md, "Controls"). Ported from the approved prototype
   (mfj.css) through the ui.* tokens, once, for both profiles: the profile tokens carry every difference. Tokens only,
   never a profile class. Every interactive part has hover, focus-visible (the base ring), disabled and, where it applies,
   selected states. On tablet and phone every tap target is at least ui.tap (44). ---- */

@layer components {

  /* ---- icon, link, label, skip link, loading line ------------------------------------------------------------------ */
  .ds-icon { flex: none; width: var(--ds-ui-icon-md); height: var(--ds-ui-icon-md); fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
  .ds-icon--lg { width: var(--ds-ui-icon-lg); height: var(--ds-ui-icon-lg); }
  .ds-icon--small { width: var(--ds-ui-icon-sm); height: var(--ds-ui-icon-sm); }
  .ds-link { display: inline-flex; align-items: center; gap: var(--ds-ui-space-4); padding: 0; border: 0; background: none; color: var(--ds-ui-color-forest); font-size: var(--ds-ui-size-12); text-decoration: none; cursor: pointer; }
  .ds-link:hover { text-decoration: underline; }
  .ds-eyebrow { margin: 0; font-size: var(--ds-ui-size-12); font-weight: var(--ds-ui-weight-semibold); line-height: var(--ds-ui-line-heading); letter-spacing: var(--ds-ui-tracking-label); text-transform: uppercase; color: var(--ds-ui-color-muted); }
  .ds-skip { position: absolute; top: var(--ds-ui-space-8); left: var(--ds-ui-space-8); z-index: var(--ds-layer-toast); padding: var(--ds-ui-space-8) var(--ds-ui-space-12); border: var(--ds-ui-dim-line) solid var(--ds-ui-color-forest); background: var(--ds-ui-color-surface); transform: translateY(-200%); }
  .ds-skip:focus { transform: none; }
  .ds-loadingline { display: none; align-items: center; gap: var(--ds-ui-space-8); font-size: var(--ds-ui-size-12); color: var(--ds-ui-color-muted); }
  .htmx-request .ds-loadingline, .htmx-request.ds-loadingline { display: inline-flex; }

  /* ---- publish control: the switch, then its state word (the Items list and the Item record) ---------------------- */
  .ds-pub { display: inline-flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 0 var(--ds-ui-space-8); }
  .ds-pub form { display: contents; }
  .ds-pub__state { font-size: var(--ds-ui-size-14); color: var(--ds-ui-color-muted); }
  .ds-pub__state.is-on { color: var(--ds-ui-color-ink); }
  .ds-pub__why { flex-basis: 100%; font-size: var(--ds-ui-size-12); color: var(--ds-ui-color-muted); white-space: normal; }
  .ds-pub__err { flex-basis: 100%; display: inline-flex; align-items: flex-start; gap: var(--ds-ui-space-4); font-size: var(--ds-ui-size-12); color: var(--ds-ui-color-red); white-space: normal; max-width: var(--ds-ui-dim-menu); }
  .ds-pub--record { justify-content: flex-start; }

  /* ---- pick list: rows to choose from (the customer picker, the customer typeahead) ------------------------------- */
  .ds-picklist { max-height: calc(var(--ds-ui-tap) * 5); margin: 0; padding: 0; list-style: none; overflow-y: auto; border: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); border-radius: var(--ds-ui-radius); }
  .ds-picklist--bare { border: 0; border-radius: 0; }
  .ds-picklist:empty { display: none; }
  .ds-picklist li + li { border-top: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); }
  .ds-picklist button {
    display: flex; flex-direction: column; align-items: flex-start; gap: var(--ds-ui-space-4); width: 100%; min-height: var(--ds-ui-tap);
    padding: var(--ds-ui-space-8) var(--ds-ui-space-12); border: 0; border-radius: var(--ds-ui-radius); background: var(--ds-ui-color-surface); color: var(--ds-ui-color-ink);
    text-align: left; font: inherit; font-size: var(--ds-ui-size-14); cursor: pointer; overflow-wrap: anywhere;
  }
  .ds-picklist button:hover, .ds-picklist button:focus-visible { background: var(--ds-ui-color-soft); }
  .ds-picklist button:focus-visible { outline: var(--ds-ui-dim-bar) solid var(--ds-ui-color-focus); outline-offset: calc(var(--ds-ui-dim-bar) * -1); }
  .ds-picklist button[aria-selected="true"] { background: var(--ds-ui-color-goldtint); box-shadow: inset var(--ds-ui-dim-bar) 0 0 var(--ds-ui-color-goldbar); }
  .ds-picklist--rows li { display: grid; gap: var(--ds-ui-space-4); padding: var(--ds-ui-space-8) var(--ds-ui-space-12); }
  .ds-picklist__name { font-size: var(--ds-ui-size-16); font-weight: var(--ds-ui-weight-medium); }
  .ds-picklist__meta { font-size: var(--ds-ui-size-12); color: var(--ds-ui-color-muted); }
  .ds-picklist__none { padding: var(--ds-ui-space-8) var(--ds-ui-space-12); font-size: var(--ds-ui-size-14); }

  /* ---- button ---------------------------------------------------------------------------------------------------- */
  .ds-button {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center; gap: var(--ds-ui-space-8);
    height: var(--ds-ui-control-md); padding: 0 var(--ds-ui-control-padx); margin: 0;
    border: var(--ds-ui-dim-line) solid var(--ds-ui-color-line2); border-radius: var(--ds-ui-radius);
    background: var(--ds-ui-color-surface); color: var(--ds-ui-color-ink);
    font-family: var(--ds-ui-font-sans); font-size: var(--ds-ui-control-font); font-weight: var(--ds-ui-weight-medium);
    line-height: var(--ds-ui-line-none); text-decoration: none; white-space: nowrap; cursor: pointer;
    touch-action: manipulation;
  }
  .ds-button:hover { background: var(--ds-ui-color-soft); text-decoration: none; }
  .ds-button:disabled, .ds-button[aria-disabled="true"] { opacity: var(--ds-ui-opacity-disabled); cursor: default; }
  .ds-button[aria-disabled="true"] { pointer-events: none; }
  .ds-button--primary { background: var(--ds-ui-color-forest); border-color: var(--ds-ui-color-forest); color: var(--ds-ui-color-onforest); }
  .ds-button--primary:hover { background: var(--ds-ui-color-forest2); border-color: var(--ds-ui-color-forest2); }
  /* On the forest cover of the client's page: an outlined button that reads on the dark ground. */
  .ds-button--onforest:not(.ds-button--primary) { background: transparent; border-color: var(--ds-ui-color-onforestmuted); color: var(--ds-ui-color-onforest); }
  .ds-button--onforest:not(.ds-button--primary):hover { background: var(--ds-ui-color-forest2); }
  /* The filled button on the forest ground (the landing page's lead action): white, the text in forest. */
  .ds-button--onforest-solid { background: var(--ds-ui-color-surface); border-color: var(--ds-ui-color-surface); color: var(--ds-ui-color-forest); }
  .ds-button--onforest-solid:hover { background: var(--ds-ui-color-soft); border-color: var(--ds-ui-color-soft); }
  /* The gold filled button, for the home page's primary action on a photograph or a green band: gold, the text in forest. */
  .ds-button--gold { background: var(--ds-ui-color-goldfill); border-color: var(--ds-ui-color-goldfill); color: var(--ds-ui-color-forest); }
  .ds-button--gold:hover { background: var(--ds-ui-color-goldfillhover); border-color: var(--ds-ui-color-goldfillhover); }
  .ds-button--quiet { border-color: transparent; background: transparent; }
  .ds-button--danger { border-color: var(--ds-ui-color-red); color: var(--ds-ui-color-red); }
  .ds-button--danger:hover { background: var(--ds-ui-color-soft); }
  .ds-button--sm { height: var(--ds-ui-control-sm); padding: 0 var(--ds-ui-control-padxsm); font-size: var(--ds-ui-control-fontsm); }
  .ds-button--lg { height: var(--ds-ui-control-lg); padding: 0 var(--ds-ui-control-padxlg); font-size: var(--ds-ui-control-fontlg); }
  .ds-button--icon { width: var(--ds-ui-control-md); padding: 0; }
  .ds-button--icon.ds-button--sm { width: var(--ds-ui-control-sm); }
  .ds-button--icon.ds-button--lg { width: var(--ds-ui-control-lg); }
  .ds-button--block { display: flex; width: 100%; }
  .ds-button .ds-icon { width: var(--ds-ui-icon-md); height: var(--ds-ui-icon-md); }
  .ds-button--sm .ds-icon { width: var(--ds-ui-icon-sm); height: var(--ds-ui-icon-sm); }
  .ds-button--lg .ds-icon { width: var(--ds-ui-icon-lg); height: var(--ds-ui-icon-lg); }

  /* ---- field, input, select, textarea, check, switch, search ------------------------------------------------------ */
  .ds-field { display: flex; flex-direction: column; gap: var(--ds-ui-space-4); min-width: 0; margin: 0; font-size: var(--ds-ui-control-font); font-weight: var(--ds-ui-weight-medium); }
  .ds-field__label { display: flex; align-items: baseline; gap: var(--ds-ui-space-8); }
  .ds-field__hint { font-size: var(--ds-ui-size-12); font-weight: var(--ds-ui-weight-regular); color: var(--ds-ui-color-muted); }
  .ds-field__error { font-size: var(--ds-ui-size-12); font-weight: var(--ds-ui-weight-regular); color: var(--ds-ui-color-red); }
  .ds-input, .ds-select, .ds-textarea, .ds-multi__button {
    display: block; width: 100%; min-width: 0; height: var(--ds-ui-control-md); margin: 0; padding: 0 var(--ds-ui-space-12);
    border: var(--ds-ui-dim-line) solid var(--ds-ui-color-line2); border-radius: var(--ds-ui-radius);
    background: var(--ds-ui-color-surface); color: var(--ds-ui-color-ink);
    font-family: var(--ds-ui-font-sans); font-size: var(--ds-ui-control-font); font-weight: var(--ds-ui-weight-regular);
  }
  /* A select is drawn by us, never natively: no appearance, the chevron (a data URI in the profile's ink colour, the token
     ui.control.chevron) at the right, the control heights of the profile. The multi-select's closed state is the same. */
  .ds-select, select.ds-input, .ds-multi__button {
    appearance: none; -webkit-appearance: none; cursor: pointer; text-overflow: ellipsis;
    padding-right: calc(var(--ds-ui-space-12) + var(--ds-ui-icon-sm) + var(--ds-ui-space-4));
    background-image: var(--ds-ui-control-chevron); background-repeat: no-repeat; background-position: right var(--ds-ui-space-8) center; background-size: var(--ds-ui-icon-sm);
  }
  .ds-select:disabled, select.ds-input:disabled { cursor: default; }
  .ds-textarea, textarea.ds-input { height: auto; min-height: calc(var(--ds-ui-control-md) * 2); padding: var(--ds-ui-space-8) var(--ds-ui-space-12); line-height: var(--ds-ui-line-body); resize: vertical; }
  .ds-input::placeholder, .ds-textarea::placeholder { color: var(--ds-ui-color-muted); opacity: 1; }
  .ds-input:hover, .ds-select:hover, .ds-textarea:hover, .ds-multi__button:hover { border-color: var(--ds-ui-color-muted); }
  .ds-input:focus-visible, .ds-select:focus-visible, .ds-textarea:focus-visible { outline-offset: 0; border-color: var(--ds-ui-color-gold); }
  .ds-input:disabled, .ds-select:disabled, .ds-textarea:disabled { background: var(--ds-ui-color-soft); color: var(--ds-ui-color-muted); cursor: default; }
  .ds-input[aria-invalid="true"], .ds-select[aria-invalid="true"], .ds-textarea[aria-invalid="true"], .ds-input:user-invalid { border-color: var(--ds-ui-color-red); }
  /* ---- multi-select filter (multi_filter macro): a <details> whose closed state is a ds-select and whose panel is a ds-card
     list of ds-check rows. Inline (--inline) it is the same list drawn open, for a dialog. ------------------------------- */
  .ds-multi { position: relative; }
  .ds-multi > summary { list-style: none; }
  .ds-multi > summary::-webkit-details-marker { display: none; }
  .ds-multi__button { display: flex; align-items: center; gap: var(--ds-ui-space-8); width: auto; min-width: 0; white-space: nowrap; line-height: var(--ds-ui-line-none); }
  .ds-multi[open] > .ds-multi__button { border-color: var(--ds-ui-color-gold); }
  .ds-multi__panel {
    position: absolute; z-index: var(--ds-layer-overlay); top: calc(100% + var(--ds-ui-space-4)); left: 0; width: max-content; min-width: 100%;
    max-width: calc(var(--ds-ui-dim-menu) * 1.5); padding: var(--ds-ui-space-8); box-shadow: var(--ds-ui-shadow-pop);
  }
  .ds-multi__search { margin-bottom: var(--ds-ui-space-8); }
  .ds-multi__list { display: flex; flex-direction: column; gap: 0; max-height: calc(var(--ds-ui-dim-menu) * 1.5); overflow-y: auto; }
  .ds-multi__option { padding: 0 var(--ds-ui-space-8); border-radius: var(--ds-ui-radius); min-height: var(--ds-ui-control-md); }
  .ds-multi__option:hover { background: var(--ds-ui-color-soft); }
  .ds-multi__option[hidden] { display: none; }
  .ds-multi--inline { display: flex; flex-direction: column; gap: var(--ds-ui-space-8); }
  .ds-multi--inline > .ds-label { margin: 0; }
  .ds-multi--inline .ds-multi__list { padding: var(--ds-ui-space-8) var(--ds-ui-space-12); border: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); border-radius: var(--ds-ui-radius); }
  .ds-check { display: flex; align-items: center; gap: var(--ds-ui-space-8); font-size: var(--ds-ui-control-font); cursor: pointer; }
  .ds-check input { flex: none; width: var(--ds-ui-icon-sm); height: var(--ds-ui-icon-sm); margin: 0; accent-color: var(--ds-ui-color-forest); cursor: pointer; }
  .ds-check:has(input:disabled) { opacity: var(--ds-ui-opacity-disabled); cursor: default; }
  .ds-switch { vertical-align: middle;
    position: relative; display: inline-flex; align-items: center; flex: none; margin: 0; padding: 0; border: 0;
    background: transparent; cursor: pointer;
  }
  .ds-switch::before { content: ""; position: absolute; inset: calc((var(--ds-ui-dim-switchh) - var(--ds-ui-tap)) / 2) calc((var(--ds-ui-dim-switchw) - var(--ds-ui-tap)) / 2); }
  .ds-switch__track {
    display: inline-flex; align-items: center; width: var(--ds-ui-dim-switchw); height: var(--ds-ui-dim-switchh);
    padding: var(--ds-ui-dim-bar); border-radius: var(--ds-ui-radius-round); background: var(--ds-ui-color-line2);
  }
  .ds-switch__track::after { content: ""; width: var(--ds-ui-dim-knob); height: var(--ds-ui-dim-knob); border-radius: 50%; background: var(--ds-ui-color-surface); }
  .ds-switch:hover .ds-switch__track { background: var(--ds-ui-color-muted); }
  .ds-switch[aria-checked="true"] .ds-switch__track { background: var(--ds-ui-color-forest); }
  .ds-switch[aria-checked="true"]:hover .ds-switch__track { background: var(--ds-ui-color-forest2); }
  .ds-switch[aria-checked="true"] .ds-switch__track::after { transform: translateX(calc(var(--ds-ui-dim-switchw) - var(--ds-ui-dim-knob) - var(--ds-ui-dim-bar) * 2)); }
  .ds-switch:disabled { opacity: var(--ds-ui-opacity-disabled); cursor: default; }
  .ds-switch:focus-visible { outline-offset: var(--ds-ui-dim-bar); }
  .ds-search {
    display: flex; align-items: center; gap: var(--ds-ui-space-8); width: 100%; max-width: var(--ds-ui-dim-search); height: var(--ds-ui-control-md);
    padding: 0 var(--ds-ui-space-12); border: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); border-radius: var(--ds-ui-radius);
    background: var(--ds-ui-color-soft); color: var(--ds-ui-color-muted); font-size: var(--ds-ui-control-font);
  }
  .ds-search .ds-icon { flex: none; width: var(--ds-ui-icon-md); height: var(--ds-ui-icon-md); }
  .ds-search input { flex: 1 1 0; min-width: 0; height: 100%; margin: 0; padding: 0; border: 0; background: transparent; color: var(--ds-ui-color-ink); font: inherit; outline: none; }
  .ds-search input::placeholder { color: var(--ds-ui-color-muted); opacity: 1; }
  .ds-search:hover { border-color: var(--ds-ui-color-line2); }
  .ds-search:focus-within { border-color: var(--ds-ui-color-gold); outline: var(--ds-ui-dim-bar) solid var(--ds-ui-color-focus); outline-offset: 0; }

  /* ---- chip (and its older name ds-badge), dot, count -------------------------------------------------------------- */
  .ds-chip {
    display: inline-flex; align-items: center; gap: var(--ds-ui-space-4); height: var(--ds-ui-dim-chip); padding: 0 var(--ds-ui-space-8);
    border-radius: var(--ds-ui-radius); background: var(--ds-ui-color-soft); color: var(--ds-ui-color-chiptext);
    font-size: var(--ds-ui-size-12); font-weight: var(--ds-ui-weight-medium); line-height: var(--ds-ui-line-none); white-space: nowrap; text-decoration: none;
  }
  a.ds-chip:hover, button.ds-chip:hover { box-shadow: inset 0 0 0 var(--ds-ui-dim-line) var(--ds-ui-color-line2); text-decoration: none; }
  .ds-chip--ok { background: var(--ds-ui-color-okbg); color: var(--ds-ui-color-ok); }
  .ds-chip--gold { background: var(--ds-ui-color-goldtint); color: var(--ds-ui-color-goldtext); }
  .ds-chip--red { background: var(--ds-ui-color-redbg); color: var(--ds-ui-color-red); }
  .ds-chip--yellow { background: var(--ds-ui-color-yellowbg); color: var(--ds-ui-color-yellowtext); }
  .ds-chip--off { background: transparent; box-shadow: inset 0 0 0 var(--ds-ui-dim-line) var(--ds-ui-color-line); color: var(--ds-ui-color-muted); }
  .ds-chip .ds-icon { width: var(--ds-ui-icon-sm); height: var(--ds-ui-icon-sm); }
  .ds-dot { display: inline-block; flex: none; width: var(--ds-ui-dim-dot); height: var(--ds-ui-dim-dot); border-radius: 50%; background: var(--ds-ui-color-gold); }
  .ds-dot--ok { background: var(--ds-ui-color-okdot); }
  .ds-dot--red { background: var(--ds-ui-color-red); }
  .ds-dot--yellow { background: var(--ds-ui-color-yellow); }
  .ds-dot--none { background: transparent; box-shadow: inset 0 0 0 var(--ds-ui-dim-line) var(--ds-ui-color-line2); }
  .ds-count {
    display: inline-grid; place-items: center; min-width: var(--ds-ui-dim-count); height: var(--ds-ui-dim-count); padding: 0 var(--ds-ui-space-4);
    border-radius: var(--ds-ui-radius-round); background: var(--ds-ui-color-countbg); color: var(--ds-ui-color-counttext);
    font-size: var(--ds-ui-size-12); font-weight: var(--ds-ui-weight-semibold); line-height: var(--ds-ui-line-none);
  }

  /* ---- tabs, pill, segmented switch -------------------------------------------------------------------------------- */
  .ds-tabs { display: flex; gap: var(--ds-ui-space-24); border-bottom: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); overflow-x: auto; }
  .ds-tabs > a, .ds-tabs > button, .ds-tab {
    display: flex; align-items: center; gap: var(--ds-ui-space-4); flex: none; height: var(--ds-ui-tap); margin: 0 0 calc(var(--ds-ui-dim-line) * -1); padding: 0;
    border: 0; border-bottom: var(--ds-ui-dim-bar) solid transparent; background: none; color: var(--ds-ui-color-muted);
    font-family: inherit; font-size: inherit; font-weight: var(--ds-ui-weight-medium); white-space: nowrap; text-decoration: none; cursor: pointer;
  }
  .ds-tabs > a:hover, .ds-tabs > button:hover, .ds-tab:hover { color: var(--ds-ui-color-ink); text-decoration: none; }
  .ds-tabs > [aria-current]:not([aria-current="false"]), .ds-tabs > [aria-selected="true"], .ds-tab[aria-current]:not([aria-current="false"]), .ds-tab[aria-selected="true"] { color: var(--ds-ui-color-ink); border-bottom-color: var(--ds-ui-color-gold); }
  .ds-tabs span, .ds-tab span { font-weight: var(--ds-ui-weight-regular); color: var(--ds-ui-color-muted); }
  .ds-pill {
    position: relative; display: inline-flex; align-items: center; gap: var(--ds-ui-space-4); flex: none; height: var(--ds-ui-dim-pill); margin: 0; padding: 0 var(--ds-ui-space-12);
    border: var(--ds-ui-dim-line) solid var(--ds-ui-color-line2); border-radius: var(--ds-ui-radius-round); background: var(--ds-ui-color-surface); color: var(--ds-ui-color-ink);
    font-family: inherit; font-size: var(--ds-ui-size-12); font-weight: var(--ds-ui-weight-medium); line-height: var(--ds-ui-line-none); white-space: nowrap; text-decoration: none; cursor: pointer;
  }
  .ds-pill:hover { background: var(--ds-ui-color-soft); text-decoration: none; }
  .ds-pill[aria-pressed="true"], .ds-pill[aria-current]:not([aria-current="false"]) { background: var(--ds-ui-color-forest); border-color: var(--ds-ui-color-forest); color: var(--ds-ui-color-onforest); }
  .ds-pill .ds-icon { width: var(--ds-ui-icon-sm); height: var(--ds-ui-icon-sm); }
  .ds-pill:disabled { opacity: var(--ds-ui-opacity-disabled); cursor: default; }
  .ds-seg { display: inline-flex; border: var(--ds-ui-dim-line) solid var(--ds-ui-color-line2); border-radius: var(--ds-ui-radius); overflow: hidden; background: var(--ds-ui-color-surface); }
  .ds-seg > a, .ds-seg > button {
    display: flex; align-items: center; gap: var(--ds-ui-space-4); height: calc(var(--ds-ui-control-md) - var(--ds-ui-dim-line) * 2); margin: 0; padding: 0 var(--ds-ui-space-12);
    border: 0; background: transparent; color: var(--ds-ui-color-muted); font-family: inherit; font-size: var(--ds-ui-control-font); font-weight: var(--ds-ui-weight-medium); text-decoration: none; cursor: pointer;
  }
  .ds-seg > a:hover, .ds-seg > button:hover { background: var(--ds-ui-color-soft); text-decoration: none; }
  .ds-seg > [aria-current]:not([aria-current="false"]), .ds-seg > [aria-pressed="true"], .ds-seg > [aria-checked="true"] { background: var(--ds-ui-color-forest); color: var(--ds-ui-color-onforest); }
  .ds-seg .ds-icon { width: var(--ds-ui-icon-md); height: var(--ds-ui-icon-md); }
  .ds-seg > :disabled { opacity: var(--ds-ui-opacity-disabled); cursor: default; }

  /* ---- menu: a <details> dropdown ("More"). Closing on a chosen entry, an outside click and Escape is the small delegated
     block in mfj.js / mfj-staff.js; inside the fixed action bar it opens upward. ------------------------------------ */
  .ds-menu { position: relative; display: inline-block; }
  .ds-menu > summary { list-style: none; cursor: pointer; }
  .ds-menu > summary::-webkit-details-marker { display: none; }
  .ds-menu__panel {
    position: absolute; right: 0; top: calc(100% + var(--ds-ui-space-4)); z-index: var(--ds-layer-overlay);
    display: flex; flex-direction: column; min-width: var(--ds-ui-dim-menu); padding: var(--ds-ui-space-4);
    border: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); border-radius: var(--ds-ui-radius); background: var(--ds-ui-color-surface); box-shadow: var(--ds-ui-shadow-pop);
  }
  .ds-actbar .ds-menu__panel { top: auto; bottom: calc(100% + var(--ds-ui-space-4)); }
  .ds-menu__item, .ds-menu__panel > a, .ds-menu__panel > button {
    display: flex; align-items: center; gap: var(--ds-ui-space-8); width: 100%; min-height: var(--ds-ui-control-md); margin: 0; padding: 0 var(--ds-ui-space-12);
    border: 0; border-radius: var(--ds-ui-radius); background: transparent; color: var(--ds-ui-color-ink);
    font-family: inherit; font-size: var(--ds-ui-control-font); font-weight: var(--ds-ui-weight-regular); line-height: var(--ds-ui-line-none); text-align: left; text-decoration: none; white-space: nowrap; cursor: pointer;
  }
  .ds-menu__item:hover, .ds-menu__panel > a:hover, .ds-menu__panel > button:hover { background: var(--ds-ui-color-soft); text-decoration: none; }
  .ds-menu__item--danger { color: var(--ds-ui-color-red); }
  .ds-menu__panel form { display: contents; }
  .ds-menu__rule { height: var(--ds-ui-dim-line); margin: var(--ds-ui-space-4) 0; background: var(--ds-ui-color-line); }
  .ds-menu .ds-icon { width: var(--ds-ui-icon-md); height: var(--ds-ui-icon-md); }

  /* ---- small shared pieces: screen-reader-only text and the spinner -------------------------------------------------------- */
  .ds-sr { position: absolute; width: var(--ds-ui-dim-line); height: var(--ds-ui-dim-line); padding: 0; margin: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
  .ds-spinner {
    display: inline-block; width: var(--ds-ui-icon-sm); height: var(--ds-ui-icon-sm); flex: none;
    border: var(--ds-ui-dim-bar) solid currentColor; border-right-color: transparent; border-radius: 50%;
    animation: ds-spin var(--ds-motion-spinner) linear infinite;
  }
  @keyframes ds-spin { to { transform: rotate(360deg); } }

  /* ---- heart -------------------------------------------------------------------------------------------------------- */
  .ds-heart {
    display: grid; place-items: center; width: var(--ds-ui-tap); height: var(--ds-ui-tap); margin: 0; padding: 0; border: 0; border-radius: 50%;
    background: var(--ds-ui-color-surface); box-shadow: var(--ds-ui-shadow-heart); color: var(--ds-ui-color-ink); cursor: pointer;
  }
  /* The heart glyph, a fifth larger inside the same circle (owner 2026-11-16). */
  .ds-heart .ds-icon { width: var(--ds-ui-icon-lg); height: var(--ds-ui-icon-lg); }
  .ds-heart:hover { color: var(--ds-ui-color-red); }
  .ds-heart[aria-pressed="true"] { color: var(--ds-ui-color-red); }
  .ds-heart[aria-pressed="true"] .ds-icon { fill: currentColor; }
  /* The labelled heart: the heart and words ("I'm Interested"), a control-height button; the heart is red, a marked one has a red edge. */
  .ds-heart--label {
    display: inline-flex; gap: var(--ds-ui-space-8); width: auto; height: var(--ds-ui-control-md); padding: 0 var(--ds-ui-control-padx);
    border: var(--ds-ui-dim-line) solid var(--ds-ui-color-line2); border-radius: var(--ds-ui-radius); box-shadow: none;
    font-family: var(--ds-ui-font-sans); font-size: var(--ds-ui-control-font); font-weight: var(--ds-ui-weight-medium); line-height: var(--ds-ui-line-none); white-space: nowrap;
  }
  .ds-heart--label:hover { background: var(--ds-ui-color-soft); color: var(--ds-ui-color-ink); }
  .ds-heart--label .ds-icon { width: var(--ds-ui-icon-md); height: var(--ds-ui-icon-md); color: var(--ds-ui-color-red); }
  .ds-heart--label[aria-pressed="true"] { border-color: var(--ds-ui-color-red); color: var(--ds-ui-color-ink); }
  .ds-heart--label[aria-pressed="true"] .ds-icon { fill: var(--ds-ui-color-red); }
  .ds-heart--label:disabled { opacity: var(--ds-ui-opacity-disabled); cursor: default; }

  /* ---- card and photograph ------------------------------------------------------------------------------------------ */
  .ds-card { background: var(--ds-ui-color-surface); border: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); border-radius: var(--ds-ui-radius); }
  /* The head of a section card (owner 2026-11-16): the section's title at the left, its own action at the right. */
  .ds-card__head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--ds-ui-space-8) var(--ds-ui-space-12); padding: var(--ds-ui-space-12) var(--ds-ui-space-16); border-bottom: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); }
  .ds-card__body { padding: var(--ds-ui-space-16); }
  .ds-card__foot { padding: var(--ds-ui-space-12) var(--ds-ui-space-16); border-top: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); background: var(--ds-ui-color-soft); border-radius: 0 0 var(--ds-ui-radius) var(--ds-ui-radius); }
  .ds-photo {
    display: block; flex: none; aspect-ratio: 1; margin: 0; background: var(--ds-ui-color-surface);
    border: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); border-radius: var(--ds-ui-radius); overflow: hidden;
  }
  .ds-photo img { display: block; width: 100%; height: 100%; object-fit: contain; }
  .ds-photo--bare { border: 0; }
  .ds-photo--none { display: grid; place-items: center; padding: var(--ds-ui-space-4); overflow-wrap: anywhere; background: var(--ds-ui-color-soft); color: var(--ds-ui-color-muted); font-size: var(--ds-ui-size-12); text-align: center; }
  .ds-photo--48 { width: var(--ds-ui-photo-48); }
  .ds-photo--56 { width: var(--ds-ui-photo-56); }
  .ds-photo--64 { width: var(--ds-ui-photo-64); }
  .ds-photo--72 { width: var(--ds-ui-photo-72); }
  .ds-photo--96 { width: var(--ds-ui-photo-96); }

  /* ---- tablet and phone: every tap target reaches ui.tap ------------------------------------------------------------ */
  @media (max-width: 1099px) {
    .ds-button:not(.ds-button--sm), .ds-input, .ds-select, .ds-textarea, .ds-multi__button, .ds-search, .ds-menu__item, .ds-menu__panel > a, .ds-menu__panel > button { min-height: var(--ds-ui-tap); }
    .ds-button--icon:not(.ds-button--sm) { min-width: var(--ds-ui-tap); }
    .ds-heart--label, .ds-multi__option { min-height: var(--ds-ui-tap); }
    .ds-button--sm::after, .ds-pill::after { content: ""; position: absolute; inset: calc((var(--ds-ui-control-sm) - var(--ds-ui-tap)) / 2) 0; }
    .ds-seg > a, .ds-seg > button { min-height: calc(var(--ds-ui-tap) - var(--ds-ui-dim-line) * 2); }
    .ds-check { min-height: var(--ds-ui-tap); }
    a.ds-chip, button.ds-chip { position: relative; }
    a.ds-chip::after, button.ds-chip::after { content: ""; position: absolute; inset: calc((var(--ds-ui-dim-chip) - var(--ds-ui-tap)) / 2) 0; }
  }
  @media (max-width: 1099px) {
    .ds-multi__panel { position: static; width: auto; max-width: none; margin-top: var(--ds-ui-space-4); box-shadow: none; }
  }
  @media (max-width: 639px) {
    /* A field smaller than 16 makes iOS zoom in on focus. */
    .ds-input, .ds-select, .ds-textarea, .ds-multi__button, .ds-search input { font-size: var(--ds-ui-size-16); }
  }
}
/* ---- design/css/blocks.css · V5 shared surfaces and data parts (docs/v5-design.md, "Surfaces and data" and "Popup").
   Tokens only, never a profile class. ---- */

@layer blocks {

  /* ---- piece card and its grid -------------------------------------------------------------------------------------- */
  .ds-piece { position: relative; display: flex; flex-direction: column; gap: var(--ds-ui-space-12); min-width: 0; }
  .ds-piece__link { display: block; color: inherit; text-decoration: none; }
  .ds-piece__link:hover { text-decoration: none; }
  .ds-piece__photo { width: 100%; }
  .ds-piece__body { display: flex; flex-direction: column; gap: var(--ds-ui-space-4); min-width: 0; }
  .ds-piece__title { margin: 0; font-family: var(--ds-ui-font-serif); font-size: var(--ds-ui-size-20); font-weight: var(--ds-ui-weight-regular); line-height: var(--ds-ui-line-heading); overflow-wrap: anywhere; }
  .ds-piece__title a { color: inherit; text-decoration: none; }
  .ds-piece__meta { display: flex; align-items: baseline; justify-content: space-between; gap: var(--ds-ui-space-8); margin: 0; }
  .ds-piece__price { font-size: var(--ds-ui-control-font); font-weight: var(--ds-ui-weight-semibold); }
  .ds-piece__retail { margin-left: var(--ds-ui-space-8); font-size: var(--ds-ui-size-14); font-weight: var(--ds-ui-weight-regular); color: var(--ds-ui-color-muted); }
  .ds-piece__no { font-size: var(--ds-ui-size-12); color: var(--ds-ui-color-muted); }
  .ds-piece__note { margin: 0; font-family: var(--ds-ui-font-serif); font-style: italic; color: var(--ds-ui-color-muted); }
  .ds-piece__staff { display: flex; align-items: center; gap: var(--ds-ui-space-8); margin: 0; font-size: var(--ds-ui-size-12); color: var(--ds-ui-color-muted); }
  .ds-piece__staffend { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
  /* A list row the Back link returns to (mfj/admin/back.py): it lands clear of the page's edge and is tinted so the eye finds it. */
  [id^="at-"] { scroll-margin-top: var(--ds-ui-space-24); }
  tr[id^="at-"]:target > td { background: var(--ds-ui-color-goldtint); }
  li[id^="at-"]:target { outline: var(--ds-ui-dim-bar) solid var(--ds-ui-color-gold); outline-offset: var(--ds-ui-space-4); }
  .ds-piece__flag { position: absolute; top: var(--ds-ui-space-8); left: var(--ds-ui-space-8); }
  .ds-piece__flag { z-index: 2; }
  /* The photograph slot (piece_card photo_html): the caller's own markup, e.g. the swipe gallery, in the square tile. It sits
     above the card's whole-card link (a title link's ::after) so the photograph keeps its own gestures. */
  .ds-piece__media { position: relative; z-index: 1; aspect-ratio: 1; width: 100%; }
  .ds-piece__media > * { width: 100%; height: 100%; }
  .ds-piece__media--framed .ds-swipe { border-color: var(--ds-ui-color-line); }
  /* The photograph as a button that opens the photo viewer (piece_card photo_attrs). */
  .ds-piece__open { width: 100%; margin: 0; padding: 0; border: 0; background: none; font: inherit; cursor: zoom-in; }
  .ds-piece__action { z-index: 3; position: absolute; top: var(--ds-ui-space-12); right: var(--ds-ui-space-12); }
  /* The staff form: number left and price right above a sans title, then the one staff line. */
  .ds-piece--staff { gap: var(--ds-ui-space-8); }
  /* The whole staff card opens its item: the title's link stretches over the card. */
  .ds-piece--staff .ds-piece__title a::after { content: ""; position: absolute; inset: 0; }
  .ds-piece--staff .ds-piece__meta { order: -1; flex-direction: row-reverse; }
  .ds-piece--staff .ds-piece__price, .ds-piece--staff .ds-piece__no { font-size: var(--ds-ui-size-14); font-weight: var(--ds-ui-weight-semibold); color: var(--ds-ui-color-ink); }
  .ds-piece--staff .ds-piece__title { font-family: var(--ds-ui-font-sans); font-size: var(--ds-ui-size-14); line-height: var(--ds-ui-line-body); }
  .ds-piece--staff .ds-piece__action { top: var(--ds-ui-space-8); right: var(--ds-ui-space-8); }
  .ds-piece-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--ds-ui-dim-tile), 1fr)); gap: var(--ds-ui-space-24); margin: 0; padding: 0; list-style: none; }
  .ds-piece-grid--selection .ds-piece__photo { background: var(--ds-ui-color-surface); }
  .ds-piece-grid--selection .ds-piece__title { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
  .ds-piece-grid--selection .ds-piece__flag { top: var(--ds-ui-space-12); left: var(--ds-ui-space-12); }
  /* Titles clamp to two lines and always reserve them, so the line below aligns across a row (Items). */
  .ds-piece-grid--lines2 > li { display: flex; }
  .ds-piece-grid--lines2 .ds-piece { flex: 1 1 auto; }
  .ds-piece-grid--lines2 .ds-piece__title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; min-height: 2lh; }
  .ds-piece-grid--client, .ds-piece-grid--selection { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--ds-ui-space-32); }
  @media (max-width: 1099px) {
    .ds-piece-grid, .ds-piece-grid--client { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--ds-ui-space-16); }
    .ds-piece-grid--selection { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ds-ui-space-24); }
  }
  @media (max-width: 639px) {
    .ds-piece-grid, .ds-piece-grid--client { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ds-ui-space-12); }
    .ds-piece-grid--selection { grid-template-columns: minmax(0, 1fr); gap: var(--ds-ui-space-24); }
  }

  /* ---- swipeable photograph: any listing, admin or client (the swipe() macro, ui/parts/photo.html). CSS scroll-snap does the swiping; mfj.js / mfj-staff.js drive the dots. ---- */
  .ds-swipe { position: relative; display: block; flex-shrink: 0; overflow: hidden; border: var(--ds-ui-dim-line) solid transparent; border-radius: var(--ds-ui-radius); background: var(--ds-ui-color-surface); }
  .ds-swipe__row { display: flex; height: 100%; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .ds-swipe__row::-webkit-scrollbar { display: none; }
  .ds-swipe__slide { flex: 0 0 100%; min-width: 0; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; cursor: pointer; }
  .ds-swipe__media { display: block; width: 100%; height: 100%; object-fit: contain; }
  /* The photograph indicator (one part for every gallery: this macro, the client's private pieces, the public piece page): a small white capsule
     floating at the bottom centre; the current photograph is a dark elongated pill, the others small light-grey dots. A dot stays small; its hit
     area is larger (an ::after) so a mouse can click it. With many photographs the dots shrink to fit inside the tile (flex-shrink), never overflow. */
  .ds-swipe__dots, .ds-sel-dots, .ds-site-dots { --dots-d: var(--ds-ui-dim-dotsm); --dots-p: var(--ds-ui-dim-dotpill); position: absolute; left: 50%; translate: -50% 0; width: max-content; bottom: var(--ds-ui-space-8); z-index: 2; box-sizing: border-box; display: flex; align-items: center; gap: var(--ds-ui-space-4); max-width: calc(100% - var(--ds-ui-space-64)); padding: var(--ds-ui-space-4) var(--ds-ui-space-8); border-radius: var(--ds-ui-radius-round); background: var(--ds-ui-color-surface); box-shadow: var(--ds-ui-shadow-heart); pointer-events: none; }
  .ds-sel-dots, .ds-site-dots { --dots-d: var(--ds-ui-dim-dotbig); --dots-p: var(--ds-ui-dim-dotpillbig); }
  .ds-swipe__dots i, .ds-sel-dots i, .ds-site-dots i, .ds-site-dots a { position: relative; flex: 0 1 auto; width: var(--dots-d); min-width: var(--ds-ui-space-4); height: var(--dots-d); border-radius: var(--ds-ui-radius-round); background: var(--ds-ui-color-line2); cursor: pointer; pointer-events: auto; transition: width var(--ds-motion-normal) var(--ds-motion-easing), background-color var(--ds-motion-normal) var(--ds-motion-easing); }
  .ds-swipe__dots i::after, .ds-sel-dots i::after, .ds-site-dots i::after, .ds-site-dots a::after { content: ""; position: absolute; inset: calc(var(--ds-ui-space-8) * -1) calc(var(--ds-ui-space-4) * -1); }
  .ds-swipe__dots i[aria-current="true"], .ds-sel-dots i[aria-current="true"], .ds-site-dots i[aria-current="true"], .ds-site-dots a[aria-current="true"] { width: var(--dots-p); background: var(--ds-ui-color-ink); }
  /* The video's mark is a play triangle (it keeps the dot's size; dark when current, light grey otherwise), so the last stop reads as different from a photograph. */
  .ds-site-dots__video { width: var(--dots-d); border-radius: 0; clip-path: polygon(0 0, 100% 50%, 0 100%); }
  .ds-site-dots a.ds-site-dots__video[aria-current="true"] { width: var(--dots-d); }
  /* The play mark of a video slide shown without controls (piece pages and the viewer): centred, quiet, hidden while the video plays
     (still reachable by keyboard focus). mfj.js sets data-playing on the slide. */
  [data-video] { position: relative; }
  .ds-video-mark { position: absolute; top: 50%; left: 50%; translate: -50% -50%; z-index: 2; border-radius: var(--ds-ui-radius-round); box-shadow: var(--ds-ui-shadow-heart); transition: opacity var(--ds-motion-normal) var(--ds-motion-easing); }
  [data-video][data-playing] .ds-video-mark { opacity: 0; pointer-events: none; }
  [data-video][data-playing] .ds-video-mark:focus-visible { opacity: 1; }
  .ds-swipe--empty { display: inline-flex; align-items: center; justify-content: center; background: var(--ds-ui-color-soft); color: var(--ds-ui-color-muted); font-size: var(--ds-ui-size-12); text-align: center; }

  /* ---- timeline: a dated list (History). Per row: a date column, a lead (a round icon or a photograph tile), the words,
     and an optional right-hand amount and action. On phone the lead moves up beside the words, the date to the top right and
     the amount and action drop to a line under the words. ---------------------------------------------------------------- */
  .ds-timeline { margin: 0; padding: 0; list-style: none; border-top: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); }
  .ds-timeline__row {
    display: grid; grid-template-columns: var(--ds-ui-photo-96) var(--ds-ui-photo-56) minmax(0, 1fr) auto; align-items: center;
    gap: var(--ds-ui-space-16); padding: var(--ds-ui-space-12) 0; border-bottom: var(--ds-ui-dim-line) solid var(--ds-ui-color-line);
  }
  .ds-timeline__when { grid-column: 1; white-space: nowrap; }
  .ds-timeline__lead { grid-column: 2; }
  .ds-timeline__body { grid-column: 3; min-width: 0; overflow-wrap: anywhere; }
  .ds-timeline__end { grid-column: 4; display: flex; flex-direction: column; align-items: flex-end; gap: var(--ds-ui-space-8); }
  .ds-timeline__icon { display: grid; place-items: center; width: var(--ds-ui-photo-56); height: var(--ds-ui-photo-56); border-radius: var(--ds-ui-radius-round); background: var(--ds-ui-color-soft); color: var(--ds-ui-color-muted); }
  @media (max-width: 639px) {
    .ds-timeline__row { grid-template-columns: var(--ds-ui-photo-56) minmax(0, 1fr) auto; gap: var(--ds-ui-space-4) var(--ds-ui-space-12); align-items: start; }
    .ds-timeline__lead { grid-column: 1; grid-row: 1 / span 2; }
    .ds-timeline__body { grid-column: 2; grid-row: 1; }
    .ds-timeline__when { grid-column: 3; grid-row: 1; text-align: right; font-size: var(--ds-ui-size-12); }
    .ds-timeline__end { grid-column: 2 / -1; grid-row: 2; flex-direction: row; align-items: center; justify-content: space-between; }
  }

  /* ---- facts: label left, value right; empty values are skipped by the macro ---------------------------------------- */
  .ds-facts { display: grid; grid-template-columns: var(--ds-ui-dim-facts) minmax(0, 1fr); gap: var(--ds-ui-space-8) var(--ds-ui-space-12); margin: 0; }
  .ds-facts > dt, .ds-facts > div > dt { color: var(--ds-ui-color-muted); }
  .ds-facts > dd, .ds-facts > div > dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
  .ds-facts > div { display: contents; }
  .ds-facts__group { grid-column: 1 / -1; margin: var(--ds-ui-space-8) 0 0; font-size: var(--ds-ui-size-12); font-weight: var(--ds-ui-weight-semibold); letter-spacing: var(--ds-ui-tracking-label); text-transform: uppercase; color: var(--ds-ui-color-muted); }
  .ds-facts__group:first-child { margin-top: 0; }
  .ds-facts--end { grid-template-columns: minmax(0, 1fr) auto; }
  .ds-facts--end > dd, .ds-facts--end > div > dd { text-align: right; }

  /* ---- table: a real table at desktop and tablet; on phone a --rows table becomes two-line rows without labels ---------- */
  .ds-table__wrap { width: 100%; overflow-x: auto; }
  .ds-table { width: 100%; border-collapse: collapse; }
  .ds-table th {
    padding: 0 var(--ds-ui-space-12) var(--ds-ui-space-8); border-bottom: var(--ds-ui-dim-line) solid var(--ds-ui-color-line2); vertical-align: bottom;
    font-size: var(--ds-ui-size-12); font-weight: var(--ds-ui-weight-semibold); letter-spacing: var(--ds-ui-tracking-label); text-transform: uppercase;
    color: var(--ds-ui-color-muted); text-align: left; white-space: nowrap;
  }
  .ds-table td { padding: var(--ds-ui-space-8) var(--ds-ui-space-12); border-bottom: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); vertical-align: middle; }
  .ds-table th.ds-right, .ds-table td.ds-right, .ds-table .ds-num, .ds-table .numeric { text-align: right; white-space: nowrap; }
  .ds-num { font-variant-numeric: tabular-nums; }
  .ds-table tbody tr:hover td { background: var(--ds-ui-color-soft); }
  .ds-table tbody tr[aria-selected="true"] td { background: var(--ds-ui-color-goldtint); }
  .ds-table tbody tr[aria-selected="true"] td:first-child { box-shadow: inset var(--ds-ui-dim-mark) 0 0 var(--ds-ui-color-gold); }
  .ds-table__photo { width: 1%; white-space: nowrap; }
  .ds-table__main { font-weight: var(--ds-ui-weight-semibold); }
  .ds-table__item > * { display: block; }
  .ds-table__item .ds-table__sub { max-width: var(--ds-ui-dim-bubble); }
  /* A sortable heading is a link that keeps the page's sort and dir parameters. */
  .ds-sort { display: inline-flex; align-items: center; gap: var(--ds-ui-space-4); color: inherit; text-decoration: none; }
  .ds-sort:hover { color: var(--ds-ui-color-ink); text-decoration: none; }
  .ds-sort__arrow { width: var(--ds-ui-icon-sm); height: var(--ds-ui-icon-sm); opacity: 0; }
  .ds-sort:hover .ds-sort__arrow { opacity: var(--ds-ui-opacity-disabled); }
  [aria-sort="ascending"] .ds-sort, [aria-sort="descending"] .ds-sort { color: var(--ds-ui-color-ink); }
  [aria-sort="ascending"] .ds-sort__arrow, [aria-sort="descending"] .ds-sort__arrow { opacity: 1; }
  [aria-sort="ascending"] .ds-sort__arrow { transform: rotate(180deg); }
  /* The whole row is one link target: the link of the main cell stretches over the row; controls stay above it. */
  .ds-table tbody tr { position: relative; }
  .ds-table__link { color: inherit; text-decoration: none; }
  .ds-table__link:hover { text-decoration: none; }
  .ds-table__link::after { content: ""; position: absolute; inset: 0; }
  .ds-table td button, .ds-table td input, .ds-table td select, .ds-table td textarea, .ds-table td label, .ds-table td form,
  .ds-table td .ds-switch, .ds-table td .ds-menu, .ds-table td a:not(.ds-table__link) { position: relative; z-index: 1; }
  .ds-table__link:focus-visible { outline: none; }
  .ds-table__link:focus-visible::after { outline: var(--ds-ui-dim-bar) solid var(--ds-ui-color-focus); outline-offset: calc(var(--ds-ui-dim-bar) * -1); }
  @media (max-width: 639px) {
    /* A plain table that is wider than the phone scrolls inside itself instead of widening the page. */
    .ds-table:not(.ds-table--rows) { display: block; max-width: 100%; overflow-x: auto; }
    .ds-table--rows, .ds-table--rows tbody { display: block; width: 100%; }
    .ds-table--rows thead { position: absolute; width: var(--ds-ui-dim-line); height: var(--ds-ui-dim-line); overflow: hidden; clip-path: inset(50%); }
    .ds-table--rows tr {
      display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: var(--ds-ui-space-12); align-items: center;
      padding: var(--ds-ui-space-12) 0; border-bottom: var(--ds-ui-dim-line) solid var(--ds-ui-color-line);
    }
    .ds-table--rows tbody tr:hover td, .ds-table--rows tbody tr[aria-selected="true"] td { background: transparent; box-shadow: none; }
    .ds-table--rows tbody tr[aria-selected="true"] { background: var(--ds-ui-color-goldtint); }
    /* A cell without a role (ds-table__main, __sub, __meta, __photo, __act) is not shown: the row says only what matters. */
    .ds-table--rows td { display: none; padding: 0; border: 0; text-align: left; white-space: normal; }
    .ds-table--rows td[class*="ds-table__"] { display: block; min-width: 0; }
    .ds-table--rows .ds-table__photo { grid-area: 1 / 1 / span 4; width: auto; align-self: start; }
    .ds-table--rows .ds-table__main { grid-area: 1 / 2; font-size: var(--ds-ui-size-16); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .ds-table--rows .ds-table__meta { grid-area: 1 / 3; font-size: var(--ds-ui-size-16); font-weight: var(--ds-ui-weight-semibold); text-align: right; white-space: nowrap; }
    .ds-table--rows .ds-table__sub { grid-column: 2 / 4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .ds-table--rows .ds-table__sub ~ .ds-table__sub { font-size: var(--ds-ui-size-12); color: var(--ds-ui-color-muted); }
    .ds-table--rows .ds-table__act { grid-column: 3; grid-row: 2 / span 3; align-self: center; justify-self: end; }
    .ds-table--rows tr:has(.ds-table__act) .ds-table__sub { grid-column: 2; }
    .ds-table--rows td.ds-table__item { display: contents; }
    .ds-table--rows .ds-table__item .ds-table__sub { max-width: none; }
    .ds-table--rows .ds-table__hide { display: none; }
    .ds-table--rows .ds-table__link { white-space: nowrap; }
  }
  /* Compact: one line per row on tablet and desktop (the Items table): cells do not wrap, tighter side padding, the second
     line of a cell small and quiet, an item's extra lines cut with an ellipsis. */
  .ds-table--compact td > .ds-table__sub, .ds-table--compact .ds-table__item .ds-table__sub ~ .ds-table__sub { display: block; font-size: var(--ds-ui-size-12); color: var(--ds-ui-color-muted); }
  .ds-table--compact .ds-table__item .ds-table__sub ~ .ds-table__sub { max-width: var(--ds-ui-dim-tile); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ds-table--compact .ds-table__item .ds-table__sub { max-width: var(--ds-ui-dim-search); }
  .ds-table--compact td.ds-table__act { white-space: nowrap; }
  @media (min-width: 640px) { .ds-table--compact td { white-space: nowrap; } .ds-table--compact th, .ds-table--compact td { padding-inline: var(--ds-ui-space-8); } }
  @media (max-width: 1099px) { .ds-table--compact .ds-table__item .ds-table__sub { max-width: var(--ds-ui-dim-menu); } }

  /* ---- queue row ---------------------------------------------------------------------------------------------------- */
  .ds-qrow {
    display: flex; align-items: center; gap: var(--ds-ui-space-12); min-height: var(--ds-ui-dim-qrow);
    padding: var(--ds-ui-space-8) var(--ds-ui-space-16) var(--ds-ui-space-8) calc(var(--ds-ui-space-16) - var(--ds-ui-dim-mark));
    border-bottom: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); border-left: var(--ds-ui-dim-mark) solid transparent; background: var(--ds-ui-color-surface);
    color: inherit; text-decoration: none;
  }
  /* A queue row may be a link or a button (the button is reset to look the same, left aligned, full width). */
  .ds-qrow:last-of-type { border-bottom: 0; }
  button.ds-qrow { width: 100%; margin: 0; border-top: 0; border-right: 0; font: inherit; text-align: left; cursor: pointer; }
  a.ds-qrow:hover, button.ds-qrow:hover { background: var(--ds-ui-color-soft); text-decoration: none; }
  .ds-qrow--on, .ds-qrow[aria-current]:not([aria-current="false"]) { background: var(--ds-ui-color-goldtint); border-left-color: var(--ds-ui-color-gold); }
  .ds-qrow__n { width: var(--ds-ui-dim-count); color: var(--ds-ui-color-muted); font-size: var(--ds-ui-size-12); text-align: right; }
  @media (max-width: 1099px) { .ds-qrow { min-height: var(--ds-ui-tap); } }

  /* ---- conversation ------------------------------------------------------------------------------------------------- */
  .ds-thread { display: flex; flex-direction: column; gap: var(--ds-ui-space-12); }
  .ds-bubble {
    align-self: flex-start; max-width: min(100%, var(--ds-ui-dim-bubble)); padding: var(--ds-ui-space-8) var(--ds-ui-space-12);
    border: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); border-radius: var(--ds-ui-radius-bubble); background: var(--ds-ui-color-surface); overflow-wrap: anywhere;
  }
  .ds-bubble--me { align-self: flex-end; background: var(--ds-ui-color-okbg); border-color: var(--ds-ui-color-okline); }
  .ds-bubble__meta { margin: calc(var(--ds-ui-space-8) * -1) 0 0; font-size: var(--ds-ui-size-12); color: var(--ds-ui-color-muted); }
  .ds-bubble--me + .ds-bubble__meta { align-self: flex-end; }
  /* The client's page: the house's bubbles sit on the soft ground. */
  .ds-thread--soft .ds-bubble:not(.ds-bubble--me) { background: var(--ds-ui-color-soft); }
  .ds-thread--soft .ds-bubble:not(.ds-bubble--me) + .ds-bubble__meta { align-self: flex-start; }
  /* Roomy: the client's page, larger bubbles. */
  .ds-thread--roomy .ds-bubble { padding: var(--ds-ui-space-12) var(--ds-ui-space-16); }

  /* ---- empty state, notice (and the older ds-alert), toast ----------------------------------------------------------- */
  .ds-empty { display: grid; justify-items: center; gap: var(--ds-ui-space-8); padding: var(--ds-ui-space-40) var(--ds-ui-space-16); text-align: center; color: var(--ds-ui-color-muted); }
  .ds-empty__title { margin: 0; font-family: var(--ds-ui-font-serif); font-size: var(--ds-ui-size-20); font-weight: var(--ds-ui-weight-regular); line-height: var(--ds-ui-line-heading); color: var(--ds-ui-color-ink); }
  .ds-empty .ds-row { justify-content: center; }
  .ds-empty__line { margin: 0; max-width: var(--ds-ui-dim-bubble); }
  .ds-notice, .ds-alert {
    display: flex; align-items: flex-start; gap: var(--ds-ui-space-8); padding: var(--ds-ui-space-8) var(--ds-ui-space-12);
    border-radius: var(--ds-ui-radius); background: var(--ds-ui-color-goldtint); color: var(--ds-ui-color-goldtext);
    font-size: var(--ds-ui-size-14); line-height: var(--ds-ui-line-body);
  }
  .ds-notice .ds-icon, .ds-alert .ds-icon { flex: none; width: var(--ds-ui-icon-sm); height: var(--ds-ui-icon-sm); margin-top: var(--ds-ui-dim-bar); }
  .ds-alert__text { flex: 1; min-width: 0; }
  .ds-notice--ok, .ds-alert--success { background: var(--ds-ui-color-okbg); color: var(--ds-ui-color-ok); }
  .ds-notice--error, .ds-alert--error { background: transparent; box-shadow: inset 0 0 0 var(--ds-ui-dim-line) var(--ds-ui-color-red); color: var(--ds-ui-color-red); }
  .ds-toast {
    position: fixed; left: 50%; bottom: calc(var(--ds-ui-space-24) + env(safe-area-inset-bottom, 0)); z-index: var(--ds-layer-toast); transform: translateX(-50%);
    display: flex; align-items: center; gap: var(--ds-ui-space-8); max-width: calc(100% - var(--ds-ui-space-32)); padding: var(--ds-ui-space-12) var(--ds-ui-space-16);
    border-radius: var(--ds-ui-radius); background: var(--ds-ui-color-forest); color: var(--ds-ui-color-onforest); box-shadow: var(--ds-ui-shadow-pop);
    font-size: var(--ds-ui-size-14); animation: ds-toast-out var(--ds-motion-toast) var(--ds-motion-easing) forwards;
  }
  @keyframes ds-toast-out { 0%, 85% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }

  /* ---- filter bar and the applied filters --------------------------------------------------------------------------- */
  .ds-filterbar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--ds-ui-space-8); margin: 0 0 var(--ds-ui-space-16); }
  /* Children keep their own width; only the search and anything marked ds-grow share the free space. */
  .ds-filterbar > * { flex: none; }
  .ds-filterbar .ds-search { background: var(--ds-ui-color-surface); border-color: var(--ds-ui-color-line2); }
  .ds-filterbar > .ds-search, .ds-filterbar > .ds-grow { flex: 1 1 var(--ds-ui-dim-menu); min-width: 0; }
  .ds-filterbar .ds-select, .ds-filterbar .ds-multi__button { width: auto; }
  .ds-filterbar__state { display: contents; }
  /* The result count: the right end of the bar's top row, the same place on every list; muted, size 14. Pushes right even when there is no Sort. */
  .ds-filterbar__count { margin-left: auto; color: var(--ds-ui-color-muted); font-size: var(--ds-ui-size-14); white-space: nowrap; }
  .ds-filterbar__sort + .ds-filterbar__count { margin-left: var(--ds-ui-space-16); }
  .ds-filterbar__sort { display: flex; align-items: center; gap: var(--ds-ui-space-8); margin-left: auto; color: var(--ds-ui-color-muted); }
  /* ---- the staff lists' two-row filter bar (owner 2026-11-20, from his own drawing; Items, Customers, Selections) ----
     Row one, the filters, between two hairlines: each filter's name above its box, the boxes the same size and spread
     evenly from the first to the last (a wide one, the price range, takes two shares). A list with only a filter or two
     (--few) keeps its boxes at one natural size at the left. Row two: the result count at the left, "Sort by" and its
     box at the right. On a phone the lines go and the rows fall back to the compact form (search, then the filters). */
  .ds-filterbar--rows { display: block; }
  .ds-filterbar__filters { display: flex; align-items: flex-end; gap: var(--ds-ui-space-12); padding: var(--ds-ui-space-16) 0; border-top: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); border-bottom: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); }
  .ds-filterbar__filters > * { flex: 1 1 0; min-width: 0; }
  .ds-filterbar__filters > .ds-filterbar__wide { flex-grow: 2; }
  .ds-filterbar__filters > .ds-button { flex: none; }
  .ds-filterbar__filters--few > * { flex: 0 1 calc(var(--ds-ui-dim-tile) * 1.1); }
  .ds-filterbar__filters .ds-field { gap: var(--ds-ui-space-8); }
  .ds-filterbar__filters .ds-field__label { font-weight: var(--ds-ui-weight-regular); color: var(--ds-ui-color-ink); }
  .ds-filterbar__filters .ds-multi { display: block; }
  .ds-filterbar__filters :is(.ds-select, .ds-multi__button, .ds-input) { width: 100%; }
  /* Row two, at the right of the page: Sort by and its box, then the result count to their right (owner 2026-11-20). */
  .ds-filterbar__meta { display: flex; align-items: center; justify-content: flex-end; gap: var(--ds-ui-space-24); padding: var(--ds-ui-space-12) 0; }
  .ds-filterbar__meta .ds-filterbar__count { order: 2; margin-left: 0; }
  /* The applied filters share row two, at its left (owner 2026-11-20); many of them wrap within their own side. */
  .ds-filterbar__meta > [role="group"] { flex: 1 1 0; min-width: 0; margin-right: auto; }
  .ds-filterbar__meta .ds-filterchips { margin: 0; }
  .ds-filterbar__meta .ds-filterbar__sort { gap: var(--ds-ui-space-12); margin-left: 0; }
  .ds-filterbar__sortlabel { color: var(--ds-ui-color-muted); white-space: nowrap; }
  .ds-filterbar__sortfield { display: inline-flex; align-items: center; gap: var(--ds-ui-space-12); }
  /* Clear sort (owner 2026-11-20): shown only while a sort other than the list's own is in force; it leads back to that. */
  .ds-filterbar__clearsort { color: var(--ds-ui-color-ink); font-size: var(--ds-ui-size-14); text-decoration: underline; text-underline-offset: var(--ds-ui-dim-mark); white-space: nowrap; }
  /* The Items sort is a menu of links; its button is drawn as a select (the chevron at its right), like the others'. */
  .ds-filterbar__sort .ds-menu > summary.ds-button { justify-content: flex-start; padding-right: calc(var(--ds-ui-space-12) + var(--ds-ui-icon-sm) + var(--ds-ui-space-4)); background-image: var(--ds-ui-control-chevron); background-repeat: no-repeat; background-position: right var(--ds-ui-space-8) center; background-size: var(--ds-ui-icon-sm); font-weight: var(--ds-ui-weight-regular); }
  @media (max-width: 639px) {
    .ds-filterbar__filters { flex-wrap: wrap; gap: var(--ds-ui-space-8); padding: 0; border: 0; }
    .ds-filterbar__filters > .ds-search { flex: 1 1 100%; }
    .ds-filterbar--inline .ds-filterbar__filters > .ds-search { flex: 1 1 0; }
    .ds-filterbar__filters--few > * { flex: 1 1 0; }
    .ds-filterbar__meta { flex-wrap: wrap; justify-content: flex-start; gap: var(--ds-ui-space-8); padding: var(--ds-ui-space-8) 0 0; }
    .ds-filterbar__meta .ds-filterbar__count { order: 0; }
    .ds-filterbar__meta > [role="group"] { flex: 1 1 100%; }
  }
  .ds-filterchips { display: flex; align-items: center; flex-wrap: wrap; gap: var(--ds-ui-space-8); margin: 0 0 var(--ds-ui-space-16); padding: 0; list-style: none; }
  .ds-filterchips__clear { color: var(--ds-ui-color-ink); font-size: var(--ds-ui-size-14); text-decoration: none; }
  .ds-filterchips__clear:hover { text-decoration: underline; }
  .ds-filterchips__count { margin-left: auto; color: var(--ds-ui-color-muted); font-size: var(--ds-ui-size-14); }
  @media (max-width: 639px) {
    /* The search takes its own row; the other controls share the next one. `--inline` keeps the search on that row (Items). */
    .ds-filterbar > .ds-search { flex: 1 1 100%; }
    /* Below about 820 px the count wraps to its own line under the bar. */
    .ds-filterbar > .ds-filterbar__count { flex: 1 1 100%; margin-left: 0; order: 9; }
    .ds-filterbar > :not(.ds-search, .ds-filterbar__state, .ds-filterbar__count) { flex: 1 1 0; margin-left: 0; }
    .ds-filterbar--inline > .ds-search { flex: 1 1 0; }
  }

  /* ---- pager (and the older ds-pagination whose links are ds-pager) ----------------------------------------------- */
  .ds-pager {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--ds-ui-space-12);
    margin: var(--ds-ui-space-16) 0 0; font-size: var(--ds-ui-size-14); color: var(--ds-ui-color-muted);
  }
  .ds-pager--bare { justify-content: flex-end; }
  .ds-pager__links { display: flex; align-items: center; flex-wrap: wrap; gap: var(--ds-ui-space-8); }
  .ds-pager__gap { padding: 0 var(--ds-ui-space-4); }
  .ds-pager__links .ds-button[aria-current="page"] { background: var(--ds-ui-color-forest); border-color: var(--ds-ui-color-forest); color: var(--ds-ui-color-onforest); }

  /* ---- dialog: head, a body that scrolls, a foot that stays; never taller than the screen; a bottom sheet on phone ---- */
  .ds-dialog {
    width: calc(100% - var(--ds-ui-space-24) * 2); max-width: var(--ds-ui-dim-dialogmd); max-height: calc(100dvh - var(--ds-ui-space-24) * 2); margin: auto; padding: 0;
    border: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); border-radius: var(--ds-ui-radius); background: var(--ds-ui-color-surface); color: var(--ds-ui-color-ink);
    box-shadow: var(--ds-ui-shadow-pop); font-family: var(--ds-ui-font-sans); font-size: var(--ds-ui-control-font); line-height: var(--ds-ui-line-body); text-align: left; overflow: hidden;
  }
  /* display only while open: the native <dialog> is display:none when closed and the open/close script relies on that */
  .ds-dialog[open] { display: flex; flex-direction: column; }
  .ds-dialog::backdrop { background: var(--ds-ui-color-overlay); }
  .ds-dialog--sm { max-width: var(--ds-ui-dim-dialogsm); }
  .ds-dialog--md { max-width: var(--ds-ui-dim-dialogmd); }
  .ds-dialog--lg { max-width: var(--ds-ui-dim-dialoglg); }
  /* A form that wraps the three parts (the older markup) carries the column. */
  .ds-dialog__frame { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; }
  .ds-dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--ds-ui-space-12); flex: none; padding: var(--ds-ui-space-16) var(--ds-ui-space-24); border-bottom: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); }
  .ds-dialog__head > div { display: grid; min-width: 0; gap: var(--ds-ui-space-4); }
  .ds-dialog__title { margin: 0; font-family: var(--ds-ui-font-serif); font-size: var(--ds-ui-size-20); font-weight: var(--ds-ui-weight-regular); line-height: var(--ds-ui-line-heading); }
  .ds-dialog__sub { margin: 0; font-size: var(--ds-ui-size-14); color: var(--ds-ui-color-muted); }
  .ds-dialog__head .ds-button--icon { flex: none; margin: calc(var(--ds-ui-space-8) * -1) calc(var(--ds-ui-space-8) * -1) 0 0; }
  .ds-dialog__body { display: flex; flex: 1 1 auto; flex-direction: column; gap: var(--ds-ui-space-16); min-height: 0; padding: var(--ds-ui-space-16) var(--ds-ui-space-24); overflow-y: auto; }
  .ds-dialog__foot { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: var(--ds-ui-space-8); flex: none; padding: var(--ds-ui-space-12) var(--ds-ui-space-24); border-top: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); background: var(--ds-ui-color-surface); }
  .ds-dialog__start { margin-right: auto; }
  .ds-dialog__wait { justify-content: center; padding-block: var(--ds-ui-space-40); }
  @media (max-width: 639px) {
    .ds-dialog { width: 100%; max-width: none; margin: auto 0 0; border-radius: var(--ds-ui-radius-sheet) var(--ds-ui-radius-sheet) 0 0; max-height: calc(100dvh - var(--ds-ui-space-24)); }
    .ds-dialog__head, .ds-dialog__body, .ds-dialog__foot { padding-left: var(--ds-ui-space-16); padding-right: var(--ds-ui-space-16); }
    .ds-dialog__foot { padding-bottom: calc(var(--ds-ui-space-12) + env(safe-area-inset-bottom, 0)); }
    .ds-dialog__foot .ds-button { flex: 1 1 0; }
    .ds-dialog__foot .ds-dialog__start { flex-basis: 100%; margin-right: 0; }
  }
}
/* ---- design/css/blocks/viewer.css · the one photo viewer (ds-viewer) of the website, the private selection and the staff
   admin (docs/v5-design.md part "Photo viewer"; the website's viewer approved by the owner 2026-11-12). A modal window sized to its
   square photograph (--s), the page dimmed behind it: the head (the number over the title), the photograph as a swipeable
   row with round previous / next buttons on its edges (desktop), "Click to zoom" ("Tap" on touch) under it, then the bottom
   bar: the position at the left, the thumbnails centred, Share, Save and Close as icon buttons at the right. Edge to edge on
   phones. Written once for both profiles from --ds-ui-* tokens; mfj.js drives it. Markup: mfj/templates/shell/_viewer.html. ---- */

@layer blocks {

  dialog.ds-viewer {
    position: fixed; inset: 0; margin: auto; width: fit-content; height: fit-content;
    max-width: calc(100vw - var(--ds-ui-space-24)); max-height: calc(100dvh - var(--ds-ui-space-24)); padding: 0; border: 0; border-radius: var(--ds-ui-radius);
    background: var(--ds-ui-color-surface); color: var(--ds-ui-color-ink); box-shadow: var(--ds-ui-shadow-pop); flex-direction: column; overflow: hidden;
  }
  dialog.ds-viewer[open] { display: flex; }
  dialog.ds-viewer:empty { visibility: hidden; }
  dialog.ds-viewer::backdrop { background: var(--ds-ui-color-overlay); }
  .ds-viewer, .ds-viewer * { box-sizing: border-box; }
  .ds-viewer__wrap {
    --s: min(calc(100dvh - var(--ds-ui-space-24) * 2 - var(--ds-ui-dim-viewerhead) - var(--ds-ui-dim-viewerhint) - var(--ds-ui-dim-viewertail)), calc(100vw - var(--ds-ui-space-24) * 2));
    width: calc(var(--s) + var(--ds-ui-space-12) * 2); display: flex; flex-direction: column;
  }
  .ds-viewer__head { flex-shrink: 0; display: flex; align-items: center; height: var(--ds-ui-dim-viewerhead); padding: var(--ds-ui-space-12) var(--ds-ui-space-24); }
  .ds-viewer__titles { display: grid; min-width: 0; }
  .ds-viewer__titles .ds-label { margin: 0; }
  .ds-viewer__title { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ds-viewer__stage { position: relative; flex: none; display: flex; justify-content: center; padding: 0 var(--ds-ui-space-12); }
  .ds-viewer__row { display: flex; width: var(--s); height: var(--s); overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; background: var(--ds-ui-color-surface); }
  .ds-viewer__row::-webkit-scrollbar { display: none; }
  .ds-viewer__slide { flex: 0 0 100%; min-width: 0; height: 100%; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; overflow: hidden; scroll-snap-align: start; scroll-snap-stop: always; }
  .ds-viewer__slide img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; }
  .ds-viewer__slide video { width: 100%; max-height: 100%; }
  [data-zoomed] .ds-viewer__row { overflow: hidden; scroll-snap-type: none; }
  [data-zoomed] .ds-viewer__slide img { transform: scale(var(--ds-ui-dim-zoom)); transform-origin: var(--zx, 50%) var(--zy, 50%); cursor: zoom-out; }
  .ds-viewer__none { align-self: center; padding: var(--ds-ui-space-24); text-align: center; color: var(--ds-ui-color-muted); }
  .ds-viewer__step { position: absolute; top: 50%; z-index: 2; margin-top: calc(var(--ds-ui-control-md) / -2); box-shadow: var(--ds-ui-shadow-heart); }
  .ds-viewer__step--prev { left: var(--ds-ui-space-24); }
  .ds-viewer__step--next { right: var(--ds-ui-space-24); }
  .ds-viewer__hint { flex-shrink: 0; display: flex; align-items: center; justify-content: center; height: var(--ds-ui-dim-viewerhint); margin: 0; color: var(--ds-ui-color-muted); font-size: var(--ds-ui-size-12); }
  .ds-viewer__hint-out, .ds-viewer__hint-touch { display: none; }
  [data-zoomed] .ds-viewer__hint-in { display: none; }
  [data-zoomed] .ds-viewer__hint-out { display: inline; }
  .ds-viewer__tail { flex-shrink: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--ds-ui-space-16); min-height: var(--ds-ui-dim-viewertail); padding: var(--ds-ui-space-12) var(--ds-ui-space-24); border-top: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); }
  .ds-viewer__count { justify-self: start; white-space: nowrap; color: var(--ds-ui-color-muted); font-size: var(--ds-ui-size-12); font-variant-numeric: tabular-nums; }
  .ds-viewer__thumbs { display: flex; justify-content: safe center; gap: var(--ds-ui-space-8); min-width: 0; max-width: 100%; overflow-x: auto; }
  .ds-viewer__thumb { flex-shrink: 0; display: grid; place-content: center; justify-items: center; width: var(--ds-ui-dim-viewerstrip); height: var(--ds-ui-dim-viewerstrip); overflow: hidden; border: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); border-radius: var(--ds-ui-radius); background: var(--ds-ui-color-surface); color: var(--ds-ui-color-muted); font-size: var(--ds-ui-size-12); text-decoration: none; }
  .ds-viewer__thumb img { width: 100%; height: 100%; object-fit: contain; }
  .ds-viewer__thumb .ds-icon { width: var(--ds-ui-icon-sm); height: var(--ds-ui-icon-sm); fill: currentColor; stroke: none; }
  .ds-viewer__thumb[aria-current="true"] { border-color: var(--ds-ui-color-ink); }
  .ds-viewer__tools { justify-self: end; display: flex; align-items: center; gap: var(--ds-ui-space-4); }
  .ds-viewer__status { color: var(--ds-ui-color-muted); font-size: var(--ds-ui-size-12); }
  .ds-viewer__status:empty { display: none; }

  /* ---- phone (up to 639): edge to edge, the thumbnails above the position and the tools ---- */
  @media (max-width: 639px) {
    dialog.ds-viewer { width: 100vw; max-width: 100vw; max-height: 100dvh; border-radius: 0; }
    .ds-viewer__wrap {
      --s: min(100vw, calc(100dvh - var(--ds-ui-dim-viewerheadphone) - var(--ds-ui-dim-viewerhint) - var(--ds-ui-dim-viewertailphone)));
      width: 100vw;
    }
    .ds-viewer__head { height: var(--ds-ui-dim-viewerheadphone); padding: var(--ds-ui-space-12) var(--ds-ui-space-16); }
    .ds-viewer__title { white-space: normal; }
    .ds-viewer__hint-mouse { display: none; }
    .ds-viewer__hint-touch { display: inline; }
    .ds-viewer__stage { padding: 0; }
    .ds-viewer__step { display: none; }
    .ds-viewer__tail { grid-template-columns: 1fr 1fr; grid-template-areas: "thumbs thumbs" "count tools"; row-gap: var(--ds-ui-space-8); min-height: var(--ds-ui-dim-viewertailphone); padding: var(--ds-ui-space-12) var(--ds-ui-space-16); }
    .ds-viewer__thumbs { grid-area: thumbs; justify-self: center; }
    .ds-viewer__count { grid-area: count; }
    .ds-viewer__tools { grid-area: tools; }
    .ds-viewer__thumb { width: var(--ds-ui-photo-56); height: var(--ds-ui-photo-56); }
  }
}
/* ---- design/css/layouts.css · V5 staff frame, page head, record layout, client header and the utilities
   (docs/v5-design.md). Tokens only, never a profile class. The utilities come last in this layer so that they win over
   the parts. ---- */

@layer layouts {

  /* ---- staff frame -------------------------------------------------------------------------------------------------- */
  .ds-app { display: grid; grid-template-columns: var(--ds-ui-frame-rail) minmax(0, 1fr); min-height: 100dvh; background: var(--ds-ui-color-bg); }
  .ds-rail {
    position: sticky; top: 0; align-self: start; display: flex; flex-direction: column; height: 100dvh; overflow-y: auto;
    padding: var(--ds-ui-space-24) 0 var(--ds-ui-space-16); background: var(--ds-ui-color-forest); color: var(--ds-ui-color-onforestmuted);
  }
  .ds-rail__logo { display: block; width: var(--ds-ui-dim-logo); height: auto; margin: 0 var(--ds-ui-space-24) var(--ds-ui-space-24); }
  .ds-rail__mono { display: none; }
  .ds-rail__nav { display: flex; flex-direction: column; }
  .ds-rail__nav a {
    position: relative; display: flex; align-items: center; gap: var(--ds-ui-space-12); height: var(--ds-ui-tap); padding: 0 calc(var(--ds-ui-space-24) - var(--ds-ui-dim-mark));
    border-left: var(--ds-ui-dim-mark) solid transparent; color: var(--ds-ui-color-onforestmuted);
    font-size: var(--ds-ui-size-14); font-weight: var(--ds-ui-weight-medium); text-decoration: none;
  }
  .ds-rail__nav a:hover { background: var(--ds-ui-color-forest2); color: var(--ds-ui-color-onforest); text-decoration: none; }
  .ds-rail__nav a[aria-current="page"] { background: var(--ds-ui-color-forest2); color: var(--ds-ui-color-onforest); border-left-color: var(--ds-ui-color-goldbar); }
  .ds-rail__nav .ds-icon { width: var(--ds-ui-icon-md); height: var(--ds-ui-icon-md); }
  .ds-rail__nav .ds-count { margin-left: auto; }

  .ds-main { display: flex; flex-direction: column; min-width: 0; }
  /* The breadcrumb trail is read by screen readers (its <nav> is ds-sr); the topbar's phone look keys off its presence. */
  .ds-crumbs { display: flex; flex-wrap: wrap; align-items: center; min-width: 0; }
  .ds-crumbs a, .ds-crumbs__sep { color: var(--ds-ui-color-muted); }
  .ds-crumbs__sep { margin: 0 var(--ds-ui-space-8); }
  .ds-topbar {
    display: flex; align-items: center; gap: var(--ds-ui-space-16); flex: none; height: var(--ds-ui-frame-topbar); padding: 0 var(--ds-ui-frame-pagex);
    border-bottom: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); background: var(--ds-ui-color-surface); color: var(--ds-ui-color-muted); font-size: var(--ds-ui-size-14);
  }
  .ds-topbar__logo { display: none; }
  .ds-topbar__avatar {
    display: grid; place-items: center; flex: none; width: var(--ds-ui-dim-avatar); height: var(--ds-ui-dim-avatar); margin-left: auto; border-radius: 50%;
    background: var(--ds-ui-color-soft); box-shadow: inset 0 0 0 var(--ds-ui-dim-line) var(--ds-ui-color-line);
    color: var(--ds-ui-color-ink); font-size: var(--ds-ui-size-12); font-weight: var(--ds-ui-weight-semibold); text-decoration: none;
  }
  .ds-navcount { display: contents; }
  .ds-navcount:empty { display: none; }
  .ds-topbar__menu { margin-left: auto; }
  .ds-topbar__menu > summary.ds-topbar__avatar { margin-left: 0; }
  .ds-topbar .ds-menu__panel { color: var(--ds-ui-color-ink); }
  .ds-topbar__who { display: flex; flex-direction: column; gap: var(--ds-ui-space-4); margin: 0; padding: var(--ds-ui-space-8) var(--ds-ui-space-12); }
  .ds-page { width: 100%; max-width: var(--ds-ui-dim-page); padding: var(--ds-ui-frame-pagey) var(--ds-ui-frame-pagex) var(--ds-ui-space-40); }
  .ds-tabbar, .ds-actbar { display: none; }
  /* Back (mfj/admin/back.py): in the top bar on tablet and desktop, the first line of the page on a phone. */
  .ds-back { display: inline-flex; align-items: center; flex: none; gap: var(--ds-ui-space-4); min-height: var(--ds-ui-control-md); margin-left: calc(var(--ds-ui-space-8) * -1); padding: 0 var(--ds-ui-space-12) 0 var(--ds-ui-space-4); border-radius: var(--ds-ui-radius); color: var(--ds-ui-color-ink); font-size: var(--ds-ui-size-14); font-weight: var(--ds-ui-weight-medium); text-decoration: none; white-space: nowrap; }
  .ds-back:hover { background: var(--ds-ui-color-soft); text-decoration: none; }
  .ds-back .ds-icon { width: var(--ds-ui-icon-md); height: var(--ds-ui-icon-md); }
  .ds-page > .ds-back { min-height: var(--ds-ui-tap); margin-bottom: var(--ds-ui-space-8); }
  /* A list's own search field takes the top bar's place on tablet and desktop (owner 2026-11-20: one search per page): the
     field stays in its form and is drawn where the bar's universal find is, which is hidden on that page. One field, so
     nothing is sent twice. The phone keeps the field in the list's row. */
  @media (min-width: 640px) {
    .ds-main { position: relative; }
    .ds-search--top { position: absolute; z-index: 1; top: calc((var(--ds-ui-frame-topbar) - var(--ds-ui-control-md)) / 2); left: var(--ds-ui-frame-pagex); width: calc(100% - var(--ds-ui-frame-pagex) * 2 - var(--ds-ui-dim-avatar) - var(--ds-ui-space-16)); }
    .ds-main:has(.ds-search--top) .ds-topbar__find { visibility: hidden; }
  }
  @media (max-width: 1099px) and (min-width: 640px) { .ds-search--top { left: var(--ds-ui-space-24); width: calc(100% - var(--ds-ui-space-24) * 2 - var(--ds-ui-dim-avatar) - var(--ds-ui-space-16)); } }

  /* ---- page head: title at left, actions at right -------------------------------------------------------------------- */
  .ds-pagehead { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: var(--ds-ui-space-16) var(--ds-ui-space-24); margin: 0 0 var(--ds-ui-space-24); }
  .ds-pagehead__titles { display: flex; flex-direction: column; gap: var(--ds-ui-space-4); min-width: 0; }
  .ds-pagehead__crumb { font-size: var(--ds-ui-size-12); color: var(--ds-ui-color-muted); }
  .ds-pagehead__line { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--ds-ui-space-12); }
  .ds-pagehead__title { margin: 0; font-family: var(--ds-ui-font-serif); font-size: var(--ds-ui-size-28); font-weight: var(--ds-ui-weight-regular); line-height: var(--ds-ui-line-title); letter-spacing: 0; color: var(--ds-ui-color-ink); }
  .ds-pagehead__count { font-size: var(--ds-ui-size-14); color: var(--ds-ui-color-muted); }
  .ds-pagehead__meta { display: flex; align-items: center; flex-wrap: wrap; gap: var(--ds-ui-space-4) var(--ds-ui-space-16); margin: 0; font-size: var(--ds-ui-size-14); color: var(--ds-ui-color-muted); }
  .ds-pagehead__actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--ds-ui-space-8); }
  .ds-pagehead__titles > .ds-eyebrow { margin: 0; }
  .ds-toastslot:empty { display: none; }
  .ds-toastslot { flex-basis: 100%; }

  /* ---- record page: head, the work, the reference ------------------------------------------------------------------- */
  .ds-record { display: grid; grid-template-columns: minmax(0, 1fr) var(--ds-ui-dim-side); column-gap: var(--ds-ui-space-40); row-gap: var(--ds-ui-space-24); align-items: start; }
  .ds-record__head { grid-column: 1 / -1; }
  .ds-record__main, .ds-record__side { min-width: 0; }

  /* ---- client header ------------------------------------------------------------------------------------------------ */
  .ds-sitehead { display: flex; align-items: center; gap: var(--ds-ui-space-32); height: var(--ds-ui-dim-sitehead); padding: 0 var(--ds-ui-space-64); background: var(--ds-ui-color-forest); color: var(--ds-ui-color-onforest); }
  .ds-sitehead a { color: inherit; text-decoration: none; }
  .ds-sitehead__logo { display: block; height: var(--ds-ui-dim-sitelogo); width: auto; }
  .ds-sitehead__nav { display: flex; align-items: center; gap: var(--ds-ui-space-8); margin-left: auto; font-size: var(--ds-ui-size-14); }
  .ds-sitehead__nav a { display: inline-flex; align-items: center; gap: var(--ds-ui-space-8); min-height: var(--ds-ui-tap); }
  .ds-sitehead__nav > a:not(.ds-button) { margin-right: var(--ds-ui-space-16); }
  .ds-sitehead__nav > a:not(.ds-button):hover, .ds-sitehead__nav > a[aria-current="page"] { text-decoration: underline; text-underline-offset: var(--ds-ui-dim-mark); }
  /* Buttons on the green: the parts' ink would not read there (the staff phone bar does the same). */
  .ds-sitehead .ds-button { color: var(--ds-ui-color-onforest); }
  .ds-sitehead .ds-button:hover { background: var(--ds-ui-color-forest2); }

  /* ---- tablet: the icon rail ----------------------------------------------------------------------------------------- */
  @media (max-width: 1099px) {
    .ds-page { padding-left: var(--ds-ui-space-24); padding-right: var(--ds-ui-space-24); }
    .ds-topbar { padding: 0 var(--ds-ui-space-24); }
    .ds-sitehead { padding: 0 var(--ds-ui-space-24); }
    /* One column below 1100, the reference last. */
    .ds-record { grid-template-columns: minmax(0, 1fr); }
  }
  @media (max-width: 1099px) and (min-width: 640px) {
    .ds-app { grid-template-columns: var(--ds-ui-frame-railnarrow) minmax(0, 1fr); }
    .ds-rail { padding-top: var(--ds-ui-space-16); }
    .ds-rail__logo { display: none; }
    .ds-rail__mono { display: grid; place-items: center; width: var(--ds-ui-dim-mono); height: var(--ds-ui-dim-mono); margin: 0 auto var(--ds-ui-space-24); border: var(--ds-ui-dim-line) solid var(--ds-ui-color-logoring); border-radius: 50%; color: var(--ds-ui-color-logoring); font-family: var(--ds-ui-font-serif); font-size: var(--ds-ui-size-20); font-style: italic; line-height: var(--ds-ui-line-none); }
    .ds-rail__nav a { flex-direction: column; justify-content: center; gap: var(--ds-ui-space-4); height: var(--ds-ui-dim-qrow); padding: 0; font-size: var(--ds-ui-size-12); }
    .ds-rail__nav .ds-count { position: absolute; top: var(--ds-ui-space-8); right: var(--ds-ui-space-8); margin: 0; }
  }

  /* ---- phone: bar at the top, the areas in a tab bar at the bottom, a record's actions in an action bar -------------- */
  @media (max-width: 639px) {
    .ds-app { grid-template-columns: minmax(0, 1fr); }
    .ds-rail { display: none; }
    .ds-page { padding: var(--ds-ui-space-16) var(--ds-ui-space-16) var(--ds-ui-space-24); }
    .ds-topbar { padding: var(--ds-ui-space-8) var(--ds-ui-space-16); }
    .ds-topbar:not(:has(.ds-crumbs)) { height: var(--ds-ui-frame-topbar); padding: 0 var(--ds-ui-space-16); background: var(--ds-ui-color-forest); color: var(--ds-ui-color-onforest); }
    .ds-topbar:not(:has(.ds-crumbs)) .ds-button { color: var(--ds-ui-color-onforest); }
    .ds-topbar:not(:has(.ds-crumbs)) .ds-button:hover { background: var(--ds-ui-color-forest2); }
    /* Phones (owner 2026-11-20): the areas menu at the left, the logo in the middle of the bar, the search and the person at the right. */
    .ds-topbar { position: relative; }
    .ds-topbar__logo { position: absolute; left: 50%; display: block; transform: translateX(-50%); }
    .ds-topbar__nav .ds-menu__panel { left: 0; right: auto; min-width: calc(var(--ds-ui-dim-menu) * 1.2); padding: var(--ds-ui-space-8); }
    .ds-topbar__nav .ds-menu__panel > a { gap: var(--ds-ui-space-12); padding: 0 var(--ds-ui-space-12); font-size: var(--ds-ui-size-16); }
    .ds-topbar__nav .ds-menu__panel > a[aria-current="page"] { background: var(--ds-ui-color-soft); color: var(--ds-ui-color-forest); font-weight: var(--ds-ui-weight-semibold); }
    .ds-topbar__nav .ds-menu__panel .ds-count { margin-left: auto; }
    .ds-topbar__logo img { height: var(--ds-ui-dim-phonelogo); width: auto; }
    .ds-topbar__avatar, .ds-topbar__menu { margin-left: 0; }
    .ds-topbar .ds-grow { flex: 1 1 0; }
    .ds-pagehead { gap: var(--ds-ui-space-12); }
    .ds-pagehead__actions { width: 100%; }
    .ds-sitehead { height: var(--ds-ui-dim-siteheadphone); padding: 0 var(--ds-ui-space-16); gap: var(--ds-ui-space-16); }
    .ds-sitehead__logo { height: var(--ds-ui-dim-sitelogophone); }
    .ds-tabbar {
      position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--ds-layer-sticky); display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
      height: calc(var(--ds-ui-frame-tabbar) + env(safe-area-inset-bottom, 0)); padding-bottom: env(safe-area-inset-bottom, 0);
      border-top: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); background: var(--ds-ui-color-surface);
    }
    .ds-tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--ds-ui-space-4); color: var(--ds-ui-color-muted); font-size: var(--ds-ui-size-12); text-decoration: none; }
    .ds-tabbar a:hover { color: var(--ds-ui-color-ink); text-decoration: none; }
    .ds-tabbar a[aria-current="page"] { color: var(--ds-ui-color-forest); font-weight: var(--ds-ui-weight-semibold); }
    .ds-tabbar .ds-icon { width: var(--ds-ui-icon-lg); height: var(--ds-ui-icon-lg); }
    .ds-tabbar .ds-count { position: absolute; top: var(--ds-ui-space-8); left: calc(50% + var(--ds-ui-space-4)); }
    .ds-actbar {
      position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--ds-layer-sticky); display: flex; gap: var(--ds-ui-space-8);
      padding: var(--ds-ui-space-8) var(--ds-ui-space-16) calc(var(--ds-ui-space-12) + env(safe-area-inset-bottom, 0)); border-top: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); background: var(--ds-ui-color-surface);
    }
    .ds-actbar > * { flex: 1 1 0; }
    .ds-app:has(.ds-tabbar) .ds-page { padding-bottom: calc(var(--ds-ui-frame-tabbar) + var(--ds-ui-space-24)); }
    .ds-app:has(.ds-actbar) .ds-tabbar { display: none; }
    .ds-app:has(.ds-actbar) .ds-page { padding-bottom: calc(var(--ds-ui-control-lg) + var(--ds-ui-space-40)); }
  }

  /* ---- utilities: text ---------------------------------------------------------------------------------------------- */
  .ds-text-12 { font-size: var(--ds-ui-size-12); }
  .ds-text-14 { font-size: var(--ds-ui-size-14); }
  .ds-text-16 { font-size: var(--ds-ui-size-16); }
  .ds-text-20 { font-size: var(--ds-ui-size-20); line-height: var(--ds-ui-line-heading); }
  .ds-text-28 { font-size: var(--ds-ui-size-28); line-height: var(--ds-ui-line-tight); }
  .ds-text-40 { font-size: var(--ds-ui-size-40); line-height: var(--ds-ui-line-display); }
  .ds-serif { font-family: var(--ds-ui-font-serif); font-weight: var(--ds-ui-weight-regular); font-variant-numeric: normal; }
  .ds-italic { font-style: italic; }
  .ds-medium { font-weight: var(--ds-ui-weight-medium); }
  .ds-strong { font-weight: var(--ds-ui-weight-semibold); }
  .ds-muted { color: var(--ds-ui-color-muted); }
  .ds-label { font-size: var(--ds-ui-size-12); font-weight: var(--ds-ui-weight-semibold); letter-spacing: var(--ds-ui-tracking-label); text-transform: uppercase; color: var(--ds-ui-color-muted); }
  .ds-right { text-align: right; }
  .ds-underline { text-decoration: underline; text-underline-offset: var(--ds-ui-dim-mark); text-decoration-color: var(--ds-ui-color-line2); }
  .ds-clamp-1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ds-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

  /* ---- utilities: layout -------------------------------------------------------------------------------------------- */
  .ds-row { display: flex; align-items: center; }
  .ds-row--top { align-items: flex-start; }
  .ds-row--base { align-items: baseline; }
  .ds-row--end { align-items: flex-end; }
  .ds-row--between { justify-content: space-between; }
  .ds-row--wrap { flex-wrap: wrap; }
  .ds-col { display: flex; flex-direction: column; }
  .ds-grow { flex: 1 1 0; min-width: 0; }
  .ds-gap-4 { gap: var(--ds-ui-space-4); }
  .ds-gap-8 { gap: var(--ds-ui-space-8); }
  .ds-gap-12 { gap: var(--ds-ui-space-12); }
  .ds-gap-16 { gap: var(--ds-ui-space-16); }
  .ds-gap-24 { gap: var(--ds-ui-space-24); }
  .ds-rule { flex: none; height: var(--ds-ui-dim-line); background: var(--ds-ui-color-line); }

  /* ---- utilities: visibility ---------------------------------------------------------------------------------------- */
  @media (max-width: 1099px) { .ds-only-desktop { display: none !important; } }
  @media (max-width: 639px) { .ds-hide-phone { display: none !important; } }
  @media (min-width: 640px) { .ds-only-phone { display: none !important; } }
  @media (min-width: 1100px) { .ds-hide-desktop { display: none !important; } }
}
/* ---- design/css/pages.css · V5 shared pages sheet (filled by the V5 work; docs/v5-design.md).
   Authored like the legacy sheets: its own `@layer pages { ... }` blocks, tokens only,
   NEVER a profile class (.ds-staff / .ds-client): a shared part looks the same on every page. It comes after the legacy
   layers in the cascade, so it always wins over them. ---- */
/* ---- design/css/pages/appraisal.css · the appraisal preview page and the setup popups: layout only. The shared parts
   (ds-record, ds-card, ds-field, ds-notice, ds-dialog) keep their own look. ---- */

@layer pages {
  /* the date and the replacement value side by side; one column on a phone */
  .ds-ap-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ds-ui-space-16); align-items: start; }

  /* the preview: the document fills the height left under the page head */
  .ds-ap__stage { overflow: hidden; }
  .ds-ap__frame { display: block; width: 100%; height: calc(100dvh - var(--ds-ui-frame-topbar) - var(--ds-ui-space-64) * 2); min-height: calc(var(--ds-ui-space-64) * 6); border: 0; border-top: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); background: var(--ds-ui-color-soft); }
  .ds-ap__wait { display: flex; align-items: center; justify-content: center; gap: var(--ds-ui-space-8); min-height: calc(var(--ds-ui-space-64) * 4); margin: 0; padding: var(--ds-ui-space-24); border-top: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); background: var(--ds-ui-color-soft); text-align: center; }
  .ds-ap__phone { margin: 0; padding: var(--ds-ui-space-16); border-top: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); }
  .ds-ap__issue .ds-check { align-items: center; }

  @media (max-width: 1099px) {
    .ds-ap__frame { height: calc(100dvh - var(--ds-ui-frame-topbar) - var(--ds-ui-space-40)); }
  }
  @media (max-width: 639px) {
    .ds-ap-pair { grid-template-columns: minmax(0, 1fr); }
    .ds-ap__issue { flex-direction: column; align-items: stretch; width: 100%; }
    .ds-ap__issue .ds-button { width: 100%; }
  }
}
/* ---- design/css/pages/client.css · the client's private selection (V5; boards Selection-desktop / Selection-phone) ----
   Page layout only, tokens only (--ds-ui-*). The shared parts (ds-sitehead, ds-piece, ds-heart, ds-bubble, ds-dialog,
   ds-card, ds-button) are used as they are. Breakpoints: (max-width: 1099px) below 1100, (max-width: 639px) below 640. */

@layer pages {

  /* ---- the page and the staff preview band ---------------------------------------------------------------------- */
  .ds-sel-main { display: block; }
  .ds-sel-lock { display: inline-flex; align-items: center; gap: var(--ds-ui-space-8); color: var(--ds-ui-color-onforestmuted); }
  .ds-client-preview {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--ds-ui-space-8) var(--ds-ui-space-24);
    padding: var(--ds-ui-space-8) var(--ds-ui-space-64); background: var(--ds-ui-color-goldtint); color: var(--ds-ui-color-goldtext);
    border-bottom: var(--ds-ui-dim-line) solid var(--ds-ui-color-goldbar); font-size: var(--ds-ui-size-14);
  }
  .ds-client-preview strong { font-weight: var(--ds-ui-weight-semibold); }
  .ds-client-preview a { color: inherit; font-weight: var(--ds-ui-weight-semibold); }
  .ds-sel-foot {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--ds-ui-space-8) var(--ds-ui-space-24);
    padding: var(--ds-ui-space-24) var(--ds-ui-space-64); border-top: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); background: var(--ds-ui-color-bg);
  }
  .ds-sel-foot a { color: inherit; }
  body:has(#marked:not([hidden])) .ds-sel-foot { padding-bottom: calc(var(--ds-ui-space-64) + var(--ds-ui-space-32)); }

  /* ---- the cover: the title and the note side by side, in the green ---------------------------------------------- */
  .ds-sel-cover {
    display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--ds-ui-space-64); align-items: start;
    padding: var(--ds-ui-space-40) var(--ds-ui-space-64) var(--ds-ui-space-64); background: var(--ds-ui-color-forest); color: var(--ds-ui-color-onforest);
  }
  .ds-sel-cover--plain { grid-template-columns: minmax(0, 1fr); }
  .ds-sel-cover__title { display: flex; flex-direction: column; align-items: flex-start; gap: var(--ds-ui-space-12); }
  .ds-sel-cover h1 { margin: 0; line-height: var(--ds-ui-line-title); }
  .ds-sel-cover__eyebrow { margin: 0; color: var(--ds-ui-color-goldbar); }
  .ds-sel-cover__sub { margin: 0 0 var(--ds-ui-space-8); color: var(--ds-ui-color-onforestmuted); }
  .ds-sel-cover__note { display: flex; flex-direction: column; gap: var(--ds-ui-space-12); max-width: var(--ds-ui-dim-bubble); color: var(--ds-ui-color-onforest); }
  .ds-sel-cover__text { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }

  /* ---- the pieces ------------------------------------------------------------------------------------------------- */
  .ds-sel-wrap { display: flex; flex-direction: column; gap: var(--ds-ui-space-64); max-width: var(--ds-ui-dim-page); margin: 0 auto; padding: var(--ds-ui-space-40) var(--ds-ui-space-64) var(--ds-ui-space-64); }
  .ds-sel-collection { display: flex; flex-direction: column; gap: var(--ds-ui-space-32); }
  .ds-sel-collection h2, .ds-sel-thread h2 { margin: 0; line-height: var(--ds-ui-line-title); }
  .ds-sel-grid { row-gap: var(--ds-ui-space-40); column-gap: var(--ds-ui-space-32); align-items: start; }
  .ds-sel-grid > li { display: flex; min-width: 0; }
  .ds-sel-grid .ds-piece { width: 100%; }
  .ds-sel-actions { display: flex; flex-direction: column; align-items: center; gap: var(--ds-ui-space-8); }
  .ds-sel-heartform { display: contents; }
  .ds-sel-expand { width: var(--ds-ui-tap); height: var(--ds-ui-tap); border-radius: 50%; background: var(--ds-ui-color-surface); box-shadow: var(--ds-ui-shadow-heart); }

  /* the bar that appears when pieces are marked; stays at the bottom of the window */
  .ds-sel-marked {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; align-items: center; gap: var(--ds-ui-space-16);
    padding: var(--ds-ui-space-12) var(--ds-ui-space-64); border-top: var(--ds-ui-dim-line) solid var(--ds-ui-color-line2); background: var(--ds-ui-color-surface); box-shadow: var(--ds-ui-shadow-pop);
  }
  .ds-sel-marked[hidden] { display: none; }
  .ds-sel-marked__text { flex: 1 1 auto; min-width: 0; margin: 0; }
  .ds-sel-marked__photos { flex: none; }

  /* the pieces no longer available, set apart */
  .ds-sel-gone { display: flex; flex-direction: column; gap: var(--ds-ui-space-12); padding-top: var(--ds-ui-space-32); border-top: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); }
  .ds-sel-gone > * { margin: 0; }
  .ds-sel-gone__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ds-ui-space-16); margin: 0; padding: 0; list-style: none; }
  .ds-sel-gone__piece { display: flex; align-items: center; gap: var(--ds-ui-space-16); min-height: var(--ds-ui-tap); color: inherit; text-decoration: none; }
  .ds-sel-gone__piece > .ds-serif { flex: 1 1 auto; min-width: 0; }
  .ds-sel-gone__piece > .ds-photo { filter: grayscale(1); opacity: var(--ds-ui-opacity-disabled); }

  /* ---- the conversation and the visit ---------------------------------------------------------------------------- */
  .ds-sel-bottom { border-top: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); background: var(--ds-ui-color-surface); }
  .ds-sel-bottom__inner {
    display: grid; grid-template-columns: minmax(0, 1fr) calc(var(--ds-ui-dim-side) + var(--ds-ui-space-64) + var(--ds-ui-space-40)); gap: var(--ds-ui-space-64); align-items: start;
    max-width: var(--ds-ui-dim-page); margin: 0 auto; padding: var(--ds-ui-space-64);
  }
  .ds-sel-thread { display: flex; flex-direction: column; gap: var(--ds-ui-space-24); min-width: 0; scroll-margin-top: var(--ds-ui-space-24); }
  .ds-sel-msg__body { margin: 0; white-space: pre-line; }
  .ds-sel-day { align-self: center; margin: var(--ds-ui-space-8) 0 0; color: var(--ds-ui-color-muted); }
  .ds-sel-about { display: flex; flex-wrap: wrap; gap: var(--ds-ui-space-8); margin: 0 0 var(--ds-ui-space-8); }
  .ds-sel-empty { margin: 0; }
  .ds-sel-reply { display: flex; flex-direction: column; gap: var(--ds-ui-space-12); }
  .ds-sel-reply__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--ds-ui-space-12); align-items: stretch; }
  .ds-sel-reply__row .ds-textarea { min-height: var(--ds-ui-control-lg); }
  .ds-sel-sent { display: flex; align-items: flex-start; gap: var(--ds-ui-space-8); margin: 0; color: var(--ds-ui-color-ok); }
  .ds-sel-sent .ds-icon { flex: none; margin-top: var(--ds-ui-space-4); }
  .ds-sel-visit { overflow: hidden; background: var(--ds-ui-color-bg); }
  .ds-sel-visit p { margin: 0; }
  .ds-sel-visit__acts { display: grid; gap: var(--ds-ui-space-8); }
  .ds-sel-pinned { display: flex; flex-direction: column; gap: var(--ds-ui-space-12); margin: 0; padding: 0; list-style: none; }
  .ds-sel-pinned li { display: flex; align-items: center; gap: var(--ds-ui-space-12); }
  .ds-sel-pinned__text { display: flex; flex-direction: column; min-width: 0; }

  /* ---- the piece page --------------------------------------------------------------------------------------------- */
  .ds-sel-wrap--piece { gap: var(--ds-ui-space-16); padding-top: var(--ds-ui-space-24); }
  .ds-sel-back { align-self: flex-start; padding-left: 0; }
  .ds-sel-pieceview { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: var(--ds-ui-space-64); align-items: start; }
  .ds-sel-gallery { display: flex; flex-direction: column; gap: var(--ds-ui-space-16); min-width: 0; }
  .ds-sel-stage { position: relative; aspect-ratio: 1; background: var(--ds-ui-color-surface); border-radius: var(--ds-ui-radius); overflow: hidden; }
  .ds-sel-stage--empty { background: var(--ds-ui-color-soft); }
  .ds-sel-stage--gone img { opacity: var(--ds-ui-opacity-disabled); filter: grayscale(1); }
  .ds-sel-stage img { display: block; width: 100%; height: 100%; object-fit: contain; }
  .ds-sel-row { display: flex; height: 100%; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .ds-sel-row::-webkit-scrollbar { display: none; }
  .ds-sel-slide { flex: 0 0 100%; min-width: 0; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; }
  .ds-sel-slide video { display: block; width: 100%; height: 100%; object-fit: contain; background: var(--ds-ui-color-surface); }
  .ds-sel-stage__open { position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
  .ds-sel-stage__expand {
    position: absolute; right: var(--ds-ui-space-12); bottom: var(--ds-ui-space-12); display: grid; place-items: center; width: var(--ds-ui-tap); height: var(--ds-ui-tap);
    border-radius: 50%; background: var(--ds-ui-color-surface); box-shadow: var(--ds-ui-shadow-heart); color: var(--ds-ui-color-ink);
  }
  .ds-sel-thumbs { display: flex; gap: var(--ds-ui-space-8); overflow-x: auto; }
  .ds-sel-thumb {
    display: grid; place-items: center; flex: none; width: var(--ds-ui-photo-72); height: var(--ds-ui-photo-72); overflow: hidden; background: var(--ds-ui-color-surface);
    border: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); border-radius: var(--ds-ui-radius); color: var(--ds-ui-color-muted); font-size: var(--ds-ui-size-12); text-decoration: none;
  }
  .ds-sel-thumb img { width: 100%; height: 100%; object-fit: contain; }
  .ds-sel-thumb[aria-current="true"] { border-color: var(--ds-ui-color-gold); box-shadow: inset 0 0 0 var(--ds-ui-dim-line) var(--ds-ui-color-gold); }
  .ds-sel-info { display: flex; flex-direction: column; gap: var(--ds-ui-space-16); min-width: 0; }
  .ds-sel-info > * { margin: 0; }
  .ds-sel-info h1 { line-height: var(--ds-ui-line-title); }
  .ds-sel-info__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--ds-ui-space-4) var(--ds-ui-space-12); }
  .ds-sel-info__price .ds-label { flex-basis: 100%; }
  .ds-sel-info__acts { display: flex; flex-wrap: wrap; gap: var(--ds-ui-space-12); }


  /* ---- the closed page --------------------------------------------------------------------------------------------- */
  .ds-sel-closed { display: flex; flex-direction: column; align-items: center; gap: var(--ds-ui-space-16); max-width: var(--ds-ui-dim-dialogmd); margin: 0 auto; padding: var(--ds-ui-space-64) var(--ds-ui-space-24); text-align: center; }
  .ds-sel-closed > * { margin: 0; }
  .ds-sel-closed__lock { display: grid; place-items: center; width: var(--ds-ui-photo-72); height: var(--ds-ui-photo-72); border-radius: 50%; background: var(--ds-ui-color-soft); color: var(--ds-ui-color-forest); }
  .ds-sel-closed__more { justify-content: center; color: var(--ds-ui-color-muted); }

  /* ---- tablet: two across (the grid's columns are the shared ds-piece-grid--selection) ------------------------------------------------------------------------------------------ */
  @media (max-width: 1099px) {
    .ds-client-preview, .ds-sel-foot { padding-left: var(--ds-ui-space-24); padding-right: var(--ds-ui-space-24); }
    .ds-sel-cover { gap: var(--ds-ui-space-32); padding: var(--ds-ui-space-32) var(--ds-ui-space-24) var(--ds-ui-space-40); }
    .ds-sel-wrap { padding: var(--ds-ui-space-32) var(--ds-ui-space-24) var(--ds-ui-space-40); gap: var(--ds-ui-space-40); }
    .ds-sel-grid { column-gap: var(--ds-ui-space-24); row-gap: var(--ds-ui-space-32); }
    .ds-sel-marked { padding-left: var(--ds-ui-space-24); padding-right: var(--ds-ui-space-24); }
    .ds-sel-bottom__inner { grid-template-columns: minmax(0, 1fr); gap: var(--ds-ui-space-40); padding: var(--ds-ui-space-40) var(--ds-ui-space-24); }
    .ds-sel-pieceview { grid-template-columns: minmax(0, 1fr); gap: var(--ds-ui-space-24); }
  }

  /* ---- phone: one per row, generous photographs, 44 px targets, a roomy reply box -------------------------------------- */
  @media (max-width: 639px) {
    .ds-client-preview { padding-left: var(--ds-ui-space-16); padding-right: var(--ds-ui-space-16); }
    .ds-sel-foot { padding-left: var(--ds-ui-space-16); padding-right: var(--ds-ui-space-16); }
    .ds-sel-cover { grid-template-columns: minmax(0, 1fr); gap: var(--ds-ui-space-24); padding: var(--ds-ui-space-24) var(--ds-ui-space-16) var(--ds-ui-space-32); align-items: start; }
    .ds-sel-cover h1 { font-size: var(--ds-ui-size-28); }
    .ds-sel-wrap { padding: var(--ds-ui-space-24) var(--ds-ui-space-16) var(--ds-ui-space-32); gap: var(--ds-ui-space-32); }
    .ds-sel-grid { row-gap: var(--ds-ui-space-32); }
    .ds-sel-marked { gap: var(--ds-ui-space-12); padding: var(--ds-ui-space-8) var(--ds-ui-space-16) calc(var(--ds-ui-space-8) + env(safe-area-inset-bottom, 0)); }
    .ds-sel-marked__text, .ds-sel-marked__photos { display: none; }
    .ds-sel-marked .ds-button { flex: 1 1 auto; }
    .ds-sel-gone__list { grid-template-columns: minmax(0, 1fr); }
    .ds-sel-bottom__inner { padding: var(--ds-ui-space-32) var(--ds-ui-space-16); gap: var(--ds-ui-space-32); }
    .ds-sel-reply__row { grid-template-columns: minmax(0, 1fr); }
    .ds-sel-reply__row .ds-textarea { min-height: calc(var(--ds-ui-control-lg) * 2); }
    .ds-sel-reply__row .ds-button { width: 100%; }
    .ds-sel-wrap--piece { padding-bottom: calc(var(--ds-ui-space-64) + var(--ds-ui-space-32)); }
    .ds-sel-pieceview .ds-sel-info__acts:has(.ds-sel-heartform) {
      position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; flex-wrap: nowrap; padding: var(--ds-ui-space-8) var(--ds-ui-space-16) calc(var(--ds-ui-space-8) + env(safe-area-inset-bottom, 0));
      border-top: var(--ds-ui-dim-line) solid var(--ds-ui-color-line2); background: var(--ds-ui-color-surface); box-shadow: var(--ds-ui-shadow-pop);
    }
    .ds-sel-info__acts:has(.ds-sel-heartform) > * { flex: 1 1 0; }
    .ds-sel-info__acts .ds-button { width: 100%; }
  }
}
/* ---- design/css/pages/customers.css · the layout of the customer record (/admin/customers/{id}) only: the head's contact
   row, Now, the History rows and the reference column's tiles. It never restyles a shared part (docs/v5-design.md).
   The list (/admin/customers) is the shared filter bar and table and needs nothing here. ---- */

@layer pages {
  .ds-cust__starform { display: inline-flex; margin: 0; }
  .ds-cust__star[aria-pressed="true"] { color: var(--ds-ui-color-gold); }
  .ds-cust__star[aria-pressed="true"] .ds-icon { fill: currentColor; }
  .ds-cust__contact { display: flex; flex-wrap: wrap; gap: var(--ds-ui-space-8); margin-top: var(--ds-ui-space-8); }

  /* Now */
  .ds-cust__nowtop { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--ds-ui-space-16); }
  .ds-cust__tiles { display: flex; gap: var(--ds-ui-space-8); }
  .ds-cust__follow { display: flex; flex-direction: column; gap: var(--ds-ui-space-8); border-top: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); }
  .ds-cust__nowrap { white-space: nowrap; }
  .ds-cust__overdue { color: var(--ds-ui-color-red); }
  .ds-cust__list { margin: 0; padding: 0; list-style: none; }
  .ds-cust__list > li + li { border-top: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); }
  .ds-cust__text { white-space: pre-line; overflow-wrap: anywhere; }

  /* The record page is one column (owner 2026-11-16): no reference sidebar. */
  .ds-record.ds-cust { grid-template-columns: minmax(0, 1fr); }
  /* Interests and Details: two compact cards side by side. */
  .ds-cust__pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ds-ui-space-24); align-items: start; }
  /* A section card's rows sit in the card, under its head: no second rule above the first row. */
  .ds-card__body > .ds-timeline { border-top: 0; }
  .ds-cust__more > summary { cursor: pointer; list-style: none; }
  .ds-cust__more > summary::-webkit-details-marker { display: none; }
  .ds-cust__more[open] > summary { margin-bottom: var(--ds-ui-space-8); }
  .ds-cust__more > .ds-timeline { border-top: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); }
  .ds-cust :target { scroll-margin-top: var(--ds-ui-space-64); }

  /* What they own (the top of the Purchases card) */
  .ds-cust__owns { display: flex; flex-wrap: wrap; gap: var(--ds-ui-space-8); margin: 0; padding: 0; list-style: none; }
  .ds-cust__owns a { display: block; }
  .ds-cust__owns .ds-photo { width: var(--ds-ui-photo-96); }
  .ds-cust__chips { display: flex; flex-wrap: wrap; gap: var(--ds-ui-space-8); margin: 0; padding: 0; list-style: none; }

  /* Stacked below about 820 px (the phone query is the nearest token). */
  @media (max-width: 639px) {
    .ds-cust__pair { grid-template-columns: minmax(0, 1fr); }
  }
  @media (max-width: 639px) {
    .ds-cust__owns .ds-photo { width: var(--ds-ui-photo-72); }
    .ds-cust__contact .ds-button { flex: 1 1 0; min-height: var(--ds-ui-control-lg); }
    .ds-cust__tiles .ds-photo { width: var(--ds-ui-photo-72); }
  }

  /* ---- PROTOTYPE, the list's Purchased column (/admin/customers): the pieces each customer bought, newest first, one line.
     Desktop shows up to six thumbnails; tablet four; phone three, each with its own "+N". List rules only. ---- */
  .ds-custrow__thumbs { display: flex; align-items: center; gap: var(--ds-ui-space-8); margin: 0; padding: 0; list-style: none; }
  .ds-custrow__thumbs > li { flex: none; }
  .ds-custrow__more { color: var(--ds-ui-color-muted); font-size: var(--ds-ui-size-14); white-space: nowrap; }
  .ds-custrow__more--mid, .ds-custrow__more--narrow { display: none; }
  .ds-custrow__bought { min-width: calc(6 * var(--ds-ui-photo-48) + 6 * var(--ds-ui-space-8) + var(--ds-ui-space-24)); }
  .ds-custrow__none { display: flex; align-items: center; min-height: var(--ds-ui-photo-48); }
  .ds-custrow__bought .ds-photo--none { font-size: var(--ds-ui-size-12); white-space: normal; overflow-wrap: normal; padding: var(--ds-ui-space-4) 0; line-height: 1.2; letter-spacing: -0.02em; }
  .ds-custrow__bought .ds-photo { overflow: hidden; }
  @media (max-width: 1099px) {
    .ds-custrow__bought { min-width: calc(4 * var(--ds-ui-photo-48) + 4 * var(--ds-ui-space-8) + var(--ds-ui-space-24)); }
    .ds-custrow__thumbs > li:nth-child(n+5):not(.ds-custrow__more) { display: none; }
    .ds-custrow__more--wide { display: none; }
    .ds-custrow__more--mid { display: block; }
  }
  @media (max-width: 639px) {
    .ds-custrow__bought { grid-column: 2 / 4; min-width: 0; padding-top: var(--ds-ui-space-8); }
    .ds-custrow__thumbs > li:nth-child(n+4):not(.ds-custrow__more) { display: none; }
    .ds-custrow__more--mid { display: none; }
    .ds-custrow__more--narrow { display: block; }
    .ds-custrow__none { min-height: 0; }
  }
}
/* ---- design/css/pages/frame.css · the sign-in page (the staff frame itself is in layouts.css) and the search results.
   Tokens only; the parts are shared. ---- */

@layer pages {

  /* ---- sign in ---- */
  .ds-loginpage { background: var(--ds-ui-color-surface); }
  .ds-login { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100dvh; }
  .ds-login__identity { position: relative; display: flex; flex-direction: column; gap: var(--ds-ui-space-32); padding: var(--ds-ui-space-40); background: var(--ds-ui-color-forest); }
  .ds-login__logo { display: block; width: var(--ds-ui-dim-loginlogo); height: auto; }
  .ds-login__photo { flex: 1 1 0; min-height: 0; width: 100%; object-fit: cover; object-position: 0% center; border-radius: var(--ds-ui-radius); }
  .ds-login__side { display: flex; align-items: center; justify-content: center; padding: var(--ds-ui-space-40) var(--ds-ui-space-24); }
  .ds-login__form { width: var(--ds-ui-dim-form); max-width: 100%; }

  @media (max-width: 639px) {
    .ds-login { display: block; min-height: 0; }
    .ds-login__identity { flex-direction: row; align-items: center; height: var(--ds-ui-dim-siteheadphone); padding: 0 var(--ds-ui-space-16); }
    .ds-login__logo { width: auto; height: var(--ds-ui-dim-sitelogophone); }
    .ds-login__photo { display: none; }
    .ds-login__side { display: block; padding: var(--ds-ui-space-32) var(--ds-ui-space-16); }
  }

  /* ---- search results: three short groups ---- */
  .ds-searchgroup { margin-bottom: var(--ds-ui-space-32); }
  .ds-searchgroup__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--ds-ui-space-16); margin-bottom: var(--ds-ui-space-8); }
  .ds-searchgroup__list { margin: 0; padding: 0; list-style: none; }
  .ds-searchgroup__list a { display: flex; align-items: center; gap: var(--ds-ui-space-12); min-height: var(--ds-ui-tap); padding: var(--ds-ui-space-8) var(--ds-ui-space-12); border-bottom: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); color: var(--ds-ui-color-ink); text-decoration: none; }
  .ds-searchgroup__list a:hover { background: var(--ds-ui-color-soft); }
  .ds-searchform { margin-bottom: var(--ds-ui-space-24); }
}
/* ---- design/css/pages/home-admin.css · the layout of /admin/home only: the photograph previews and the tile rows.
   Cards, fields, buttons and notices are the shared parts. ---- */

@layer pages {
  .ds-homeadmin { max-width: calc(var(--ds-ui-dim-search) + var(--ds-ui-dim-side)); }
  .ds-homeadmin__preview { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); border-radius: var(--ds-ui-radius); background: var(--ds-ui-color-soft); }
  .ds-homeadmin__tile { display: flex; align-items: flex-end; gap: var(--ds-ui-space-12); }
}
/* ---- design/css/pages/item.css · the staff Item record (V5): the layout that exists only on this page. (The photo viewer is the shared
   ds-viewer part, design/css/blocks/viewer.css.) It never
   restyles a shared part. The record grid, head, card, facts, table, dialog and buttons are the shared parts.
   The layout is the owner's own mock-up (2026-11-19, "Emerald Ring Inventory Record.png") with his rearrangement of
   2026-11-20: the head is the number, the title and More; the photograph over its thumbnails; beside it four boxes two
   by two (Pricing, Vendor info, Product info, Status info, which holds availability, the location and the Website
   switch); boxed tabs showing one panel at a time (radio inputs, no script). On a desktop the record fills one screen
   and, when a panel is long (a full description, many gemstones), the page simply grows: nothing scrolls inside a box
   (owner 2026-11-20: "all view is better"); tablet and phone are one column in the same order; on a
   phone the four boxes stack and the tabs share the width. ---- */

@layer pages {

  /* ---- head: the Ragic title leads the meta line; the action group is transparent to the head's flex ---- */
  .ds-item .ds-pagehead { margin: 0; }
  .ds-item .ds-pagehead__titles { flex: 1 1 0; }
  .ds-item__actions { display: contents; }
  .ds-item__title { flex-basis: 100%; color: var(--ds-ui-color-ink); }
  .ds-item .ds-weblink [aria-hidden="true"] { display: none; }

  /* ---- the record: one column by default (tablet and phone); the desktop grid is below ---- */
  .ds-item { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--ds-ui-space-16); }

  /* ---- photographs: the large photograph (a click opens the viewer) over a row of thumbnails (mfj.js data-swipe-to) ---- */
  .ds-item__media { display: flex; flex-direction: column; gap: var(--ds-ui-space-8); min-width: 0; padding: var(--ds-ui-space-12); }
  .ds-item__photo { width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: var(--ds-ui-radius); background: var(--ds-ui-color-surface); }
  /* The photograph opens the viewer: the same hand as the thumbnails (owner 2026-11-20), not a magnifying glass. */
  .ds-item__photo .ds-swipe__slide { cursor: pointer; }
  .ds-item__thumbs { display: flex; gap: var(--ds-ui-space-8); overflow-x: auto; }
  .ds-item__thumb { position: relative; flex: 1 1 0; min-width: calc(var(--ds-ui-dim-tile) * 0.35); height: calc(var(--ds-ui-dim-tile) * 0.4); padding: 0; overflow: hidden; border: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); border-radius: var(--ds-ui-radius); background: var(--ds-ui-color-surface); cursor: pointer; }
  .ds-item__thumb:hover { border-color: var(--ds-ui-color-line2); }
  .ds-item__thumb[aria-current="true"] { border-color: var(--ds-ui-color-forest); outline: var(--ds-ui-dim-bar) solid var(--ds-ui-color-forest); outline-offset: calc(var(--ds-ui-dim-bar) * -1); }
  .ds-item__thumb .ds-item__thumbmedia { display: block; width: 100%; height: 100%; object-fit: contain; }
  .ds-item__tileplay { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ds-ui-color-onforest); background: color-mix(in srgb, var(--ds-ui-color-scrim) 25%, transparent); }
  .ds-item__tileplay .ds-icon { fill: currentColor; }

  /* ---- the four boxes beside the photograph, two by two (owner 2026-11-20): Pricing, Vendor info, Product info, Status info ---- */
  .ds-item__info { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-auto-rows: 1fr; gap: var(--ds-ui-space-16); min-width: 0; }
  .ds-item__info .ds-pub { justify-content: flex-start; }
  .ds-item .ds-facts { grid-template-columns: max-content minmax(0, 1fr); column-gap: var(--ds-ui-space-16); row-gap: var(--ds-ui-space-4); }

  /* ---- the tabs: boxed, the chosen one filled; one panel shows at a time (the radio inputs decide, :has) ---- */
  .ds-item__sections { gap: var(--ds-ui-space-12); min-width: 0; }
  /* A card's buttons sit beside its title, at the left (owner 2026-11-20), not at the far end of the head. */
  .ds-item__sections .ds-card__head { justify-content: flex-start; gap: var(--ds-ui-space-8) var(--ds-ui-space-16); }
  .ds-item__tabs { display: flex; flex: none; border-bottom: var(--ds-ui-dim-bar) solid var(--ds-ui-color-forest); }
  .ds-item__tab {
    display: inline-flex; align-items: center; justify-content: center; min-width: 0; min-height: var(--ds-ui-tap); margin-right: calc(var(--ds-ui-dim-line) * -1); padding: 0 var(--ds-ui-space-24);
    border: var(--ds-ui-dim-line) solid var(--ds-ui-color-line2); border-bottom: 0; border-radius: var(--ds-ui-radius) var(--ds-ui-radius) 0 0; background: var(--ds-ui-color-surface); color: var(--ds-ui-color-ink);
    font-size: var(--ds-ui-size-14); cursor: pointer;
  }
  .ds-item__tab:has(input:checked) { border-color: var(--ds-ui-color-forest); background: var(--ds-ui-color-forest); color: var(--ds-ui-color-onforest); font-weight: var(--ds-ui-weight-medium); }
  .ds-item__tab:has(input:focus-visible) { outline: var(--ds-ui-dim-bar) solid var(--ds-ui-color-focus); outline-offset: var(--ds-ui-dim-bar); }
  .ds-item__sections > section { display: none; }
  .ds-item__sections:has(input[value="gemstones"]:checked) > #gemstones,
  .ds-item__sections:has(input[value="description"]:checked) > #description,
  .ds-item__sections:has(input[value="appraisal"]:checked) > #appraisal-status,
  .ds-item__sections:has(input[value="history"]:checked) > #history { display: block; }
  /* The tab already names these two panels; their card heads only repeated it. */
  .ds-item :is(#gemstones, #history) > .ds-card__head { display: none; }

  /* ---- description copy ---- */
  .ds-item__prose { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
  /* The description is worked on in its own card (owner 2026-11-20). While the generator writes, mfj-admin.js marks the card
     data-busy and puts the waiting block first in its body: the rest of the card is hidden until the answer replaces it. */
  .ds-describe__wait { display: flex; flex-direction: column; gap: var(--ds-ui-space-4); }
  .ds-describe__acts { padding-top: var(--ds-ui-space-4); }
  #description .ds-describe .ds-input { min-height: var(--ds-ui-control-md); }
  .ds-item__info .ds-weblink { margin-left: var(--ds-ui-space-12); }
  #description[data-busy] .ds-card__head .ds-row, #description[data-busy] .ds-card__body > :not(.ds-describe__wait) { display: none; }
  /* A gentle lift under the boxes, so the page is not flat (owner 2026-11-20: "be gentle"). */
  .ds-item .ds-card { box-shadow: var(--ds-ui-shadow-card); }

  /* ---- the description popup, request failed: the waiting text stays in the popup when nothing replaces it, and no describe
     button is still in flight; the waiting text gives way to the error line (no script needed) ---- */
  .ds-describe__fail { display: none; }
  :root:not(:has([data-describe-start].htmx-request)) #describe .ds-dialog__wait { display: none; }
  :root:not(:has([data-describe-start].htmx-request)) #describe .ds-describe__fail { display: flex; }

  /* ---- the description popup: the boxes are as tall as their text ---- */
  .ds-describe textarea { field-sizing: content; overflow-wrap: anywhere; }

  /* ---- desktop: at least one screen. The head on one line; the photograph beside the boxes; the tabs along the
     bottom take what is left of the screen, and more when their panel is long (the page grows; no box scrolls). ---- */
  @media (min-width: 1100px) {
    .ds-page:has(> .ds-item) { max-width: none; padding-top: var(--ds-ui-space-16); padding-bottom: var(--ds-ui-space-16); }
    .ds-item { min-height: calc(100dvh - var(--ds-ui-frame-topbar) - var(--ds-ui-space-32)); gap: var(--ds-ui-space-16) var(--ds-ui-space-24); grid-template-columns: minmax(0, 0.64fr) minmax(0, 1fr); grid-template-rows: auto auto 1fr; grid-template-areas: "head head" "media info" "tabs tabs"; align-items: stretch; }
    .ds-item > .ds-record__head { grid-area: head; }
    .ds-item .ds-pagehead { align-items: center; }
    .ds-item .ds-pagehead__titles { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: var(--ds-ui-space-4) var(--ds-ui-space-16); }
    .ds-item__title { flex-basis: auto; }
    .ds-item__media { grid-area: media; }
    .ds-item__photo { height: calc(var(--ds-ui-dim-tile) * 1.3); aspect-ratio: auto; }
    .ds-item__info { grid-area: info; }
    .ds-item__sections { grid-area: tabs; }
    .ds-item__sections > section { flex: 1 1 auto; }
  }
  @media (max-width: 1099px) {
    .ds-item .ds-pagehead__actions { width: 100%; justify-content: space-between; }
    .ds-item__photo { max-height: calc(var(--ds-ui-dim-tile) * 2.4); }
  }
  @media (max-width: 639px) {
    .ds-item__photo { aspect-ratio: 1; }
    .ds-item__tab { flex: 1 1 0; padding: 0 var(--ds-ui-space-4); }
    .ds-item__info { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; }
  }
}
/* ---- design/css/pages/items.css · the Items list (/admin/items) and the parts its templates own: the publish switch's label (admin/_publish.html). Layout only; it never restyles a
   shared part. Tokens only. ---- */

@layer pages {

  /* ---- The Items list ---- */
  .ds-filterbar__sort .ds-menu__panel { right: 0; left: auto; }
  .ds-itemlist__price { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: var(--ds-ui-space-8); }
  /* Grid cards: titles clamp to two lines and always reserve them, so the availability line aligns across a row. */
  .ds-itemlist__loading { display: none; }
  .ds-itemlist.htmx-request .ds-itemlist__loading { display: flex; }
  .ds-itemlist.htmx-request #items { opacity: var(--ds-ui-opacity-disabled); pointer-events: none; }
  .ds-itemlist .ds-notice[hidden] { display: none; }
  .ds-itemlist__where { color: var(--ds-ui-color-muted); }
  /* ---- Photos view: photographs only, square tiles, no text. 6 across on desktop, as many 200-wide tiles as fit on a tablet, 2 on a phone. ---- */
  .ds-photogrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--ds-ui-dim-tile), 1fr)); gap: var(--ds-ui-space-8); margin: 0; padding: 0; list-style: none; }
  .ds-photogrid__tile { position: relative; display: block; overflow: hidden; border-radius: var(--ds-ui-radius); color: inherit; text-decoration: none; }
  .ds-photogrid__tile .ds-photo { width: 100%; border: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); transition: border-color 120ms ease; }
  .ds-photogrid__tile .ds-swipe { width: 100%; aspect-ratio: 1; border-color: var(--ds-ui-color-line); transition: border-color 120ms ease; }
  /* The dots stay at the foot of a Photos tile, as in the other views (owner 2026-11-20). */
  .ds-photogrid__tile .ds-swipe__dots { z-index: 3; }
  .ds-photogrid__plain { display: block; color: inherit; text-decoration: none; }
  .ds-photogrid__tile:hover .ds-swipe, .ds-photogrid__tile:focus-within .ds-swipe { border-color: var(--ds-ui-color-forest); }
  .ds-photogrid__tile:hover .ds-photo { border-color: var(--ds-ui-color-forest); }
  /* The piece's details over the lower half of the photograph: after a first click or tap on the tile (data-info), or while
     the keyboard is on it. Never on hover (owner 2026-11-20). */
  .ds-photogrid__info { position: absolute; left: var(--ds-ui-dim-line); right: var(--ds-ui-dim-line); bottom: var(--ds-ui-dim-line); display: flex; flex-direction: column; justify-content: center; gap: var(--ds-ui-dim-bar); min-height: 50%; padding: var(--ds-ui-space-8) var(--ds-ui-space-12); border-top: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); background: color-mix(in srgb, var(--ds-ui-color-surface) 94%, transparent); font-size: var(--ds-ui-size-12); line-height: var(--ds-ui-line-heading); opacity: 0; transition: opacity 120ms ease; pointer-events: none; }
  .ds-photogrid__info { z-index: 2; }
  .ds-photogrid__tile[data-info] .ds-photogrid__info, .ds-photogrid__tile:has(:focus-visible) .ds-photogrid__info { opacity: 1; }
  /* On a desktop (a mouse) the dots are how the photographs are moved through, so the details leave them room; on tablet and phone
     (touch) the dots step aside while the details show. The breakpoints stand in for the pointer: the sheets use no other query. */
  @media (min-width: 1100px) { .ds-photogrid__info { padding-bottom: calc(var(--ds-ui-space-24) + var(--ds-ui-space-4)); } }
  @media (max-width: 1099px) { .ds-photogrid__tile[data-info] .ds-swipe__dots { visibility: hidden; } }
  /* While the photographs are being moved through, the details are out of the way, until the next click or tap
     (mfj-admin.js marks the tile data-browsing). */
  .ds-photogrid__tile[data-browsing] .ds-photogrid__info { opacity: 0; }
  .ds-photogrid__title { display: -webkit-box; overflow: hidden; font-weight: var(--ds-ui-weight-medium); -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
  .ds-photogrid__row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--ds-ui-space-8); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .ds-photogrid__line { display: flex; align-items: center; gap: var(--ds-ui-space-4); min-width: 0; white-space: nowrap; }
  @media (prefers-reduced-motion: reduce) { .ds-photogrid__info { transition: none; } }
  @media (min-width: 1100px) { .ds-photogrid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
  @media (max-width: 639px) { .ds-photogrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  .ds-itemlist__table .ds-pub { justify-content: flex-start; flex-wrap: nowrap; }
  .ds-itemlist__table .ds-pub__state { white-space: nowrap; }
  /* The table's photograph is half as large again (owner 2026-11-20: 84 px on desktop and tablet; the phone has its own size below). */
  .ds-itemlist__thumb { width: calc(var(--ds-ui-photo-56) * 1.5); aspect-ratio: 1; border-color: var(--ds-ui-color-line); }
  /* The table's thumbnail still swipes through to the video but shows no dots (owner 2026-11-20). */
  .ds-itemlist__thumb .ds-swipe__dots { display: none; }
  /* Grid (owner 2026-11-20): the Website switch in a white pill at the photograph's top right, the same control as the table's. */
  /* Desktop row: the price range as two short fields beside the other filters (owner 2026-11-20: every filter visible). */
  .ds-itemlist__pricerow { display: flex; align-items: center; gap: var(--ds-ui-space-4); }
  .ds-itemlist__pricerow .ds-input { flex: 1 1 0; min-width: 0; }
  .ds-itemlist__pubpill { display: inline-flex; align-items: center; padding: var(--ds-ui-space-4) var(--ds-ui-space-12) var(--ds-ui-space-4) var(--ds-ui-space-8); border-radius: var(--ds-ui-radius-round); background: var(--ds-ui-color-surface); box-shadow: var(--ds-ui-shadow-heart); }
  .ds-itemlist__pubpill .ds-pub { flex-wrap: nowrap; }
  .ds-itemlist__pubpill .ds-pub__state { color: var(--ds-ui-color-ink); font-weight: var(--ds-ui-weight-medium); white-space: nowrap; }
  /* Phone rows (owner 2026-11-20, from the Victoria's Jewelbox admin): a larger photograph, the same size on every row,
     and the cost in small print under the Website switch (staff only; the grid view still shows no cost). The row has a
     fourth column so the cost takes only its own width at the right of the third line and the status line keeps the rest
     ("In Stock · Plaza · Memo" in one line); the price and the switch span the two right-hand columns. */
  @media (max-width: 639px) {
    .ds-itemlist__thumb { width: var(--ds-ui-photo-72); }
    .ds-itemlist__table tr { grid-template-columns: auto minmax(0, 1fr) auto auto; }
    .ds-itemlist__table .ds-table__meta { grid-column: 3 / 5; }
    .ds-itemlist__table .ds-table__act { grid-column: 3 / 5; grid-row: 2; }
    .ds-itemlist__table td.ds-table__sub { grid-column: 2 / 4; }
    .ds-itemlist__table .ds-table__cost { grid-column: 4; grid-row: 3; justify-self: end; }
    .ds-itemlist__cost { color: var(--ds-ui-color-muted); font-size: var(--ds-ui-size-14); font-variant-numeric: tabular-nums; }
  }
}
/* ---- design/css/pages/landing.css · the home page (GET /), the owner's own landing design on the design system --------
   Page layout only. The document shell, the inquiry popup and the buttons are the site's own; the header over the hero
   photograph and the slim footer are the owner's, through the base's site_header / site_footer blocks. Classes are this
   sheet's own `ds-land-*`. His design has its own phone/desktop break at 768 px ((max-width: 767px) / (min-width: 768px));
   its sizes beyond the six, its gold, its warm band and its overlay are named tokens (docs/v5-design.md, "Home page").
   Spacing that is not one step is a sum of steps (calc). Tokens `--ds-ui-*` only. ---- */

@layer pages {

  @keyframes ds-land-rise { from { opacity: 0; transform: translateY(var(--ds-ui-space-16)); } to { opacity: 1; transform: none; } }
  @keyframes ds-land-zoom { from { transform: scale(1.06); } to { transform: scale(1); } }

  /* ---- the page: edge to edge inside the shell's main ------------------------------------------------------------- */
  .ds-site-main:has(> .ds-land) { max-width: none; padding: 0; }
  .ds-land { display: block; width: 100%; line-height: 1.5; }
  /* Headings and names in sans, light (owner 2026-11-19: "same sans" as the collection); the three italic quotations keep the serif. */
  .ds-land h1, .ds-land h2, .ds-land h3 { font-family: var(--ds-ui-font-sans); font-weight: var(--ds-ui-weight-light); letter-spacing: var(--ds-ui-tracking-heading); }
  .ds-land-sec { padding-top: calc(var(--ds-ui-space-64) + var(--ds-ui-space-16)); padding-bottom: calc(var(--ds-ui-space-64) + var(--ds-ui-space-16)); }
  .ds-land-sec--band { background: var(--ds-ui-color-band); }
  .ds-land-sec--forest { background: var(--ds-ui-color-forest); color: var(--ds-ui-color-onforest); }
  .ds-land-in { box-sizing: border-box; width: 100%; max-width: var(--ds-ui-dim-homewide); margin: 0 auto; padding-left: calc(var(--ds-ui-space-16) + var(--ds-ui-space-4)); padding-right: calc(var(--ds-ui-space-16) + var(--ds-ui-space-4)); }

  /* ---- shared pieces ------------------------------------------------------------------------------------------------ */
  .ds-land-label { font-size: var(--ds-ui-size-12); font-weight: var(--ds-ui-weight-medium); line-height: 1.44; letter-spacing: var(--ds-ui-tracking-caps); text-transform: uppercase; color: var(--ds-ui-color-goldfill); }
  .ds-land-h2 { margin-top: var(--ds-ui-space-12); font-size: var(--ds-ui-size-30); line-height: 1.2; color: var(--ds-ui-color-ink); }
  .ds-land-sec--forest .ds-land-h2 { color: var(--ds-ui-color-onforest); }
  .ds-land-head { margin-bottom: var(--ds-ui-space-40); }
  .ds-land-rule { width: calc(var(--ds-ui-space-40) + var(--ds-ui-space-8)); height: var(--ds-ui-dim-line); background: var(--ds-ui-color-goldfill); }
  .ds-land-body { font-size: var(--ds-ui-size-18); line-height: 1.625; color: var(--ds-ui-color-muted); }
  .ds-land-fine { margin-top: var(--ds-ui-space-40); font-size: var(--ds-ui-size-14); line-height: 1.4286; color: var(--ds-ui-color-muted); }
  .ds-land-rise { animation: ds-land-rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }

  /* The site's button, in the owner's proportions on this page: 14 px, sharp corners, a little tracking. */
  .ds-land .ds-button { padding: 0 calc(calc(var(--ds-ui-space-24) + var(--ds-ui-space-4)) - var(--ds-ui-dim-line)); border-radius: var(--ds-ui-radius-sharp); font-size: var(--ds-ui-size-14); font-weight: var(--ds-ui-weight-regular); letter-spacing: var(--ds-ui-tracking-button); transition: background-color 0.15s, border-color 0.15s; }
  .ds-land .ds-button--onforest:not(.ds-button--primary) { border-color: color-mix(in srgb, var(--ds-ui-color-onforest) 60%, transparent); }
  .ds-land .ds-button--onforest:not(.ds-button--primary):hover { background: color-mix(in srgb, var(--ds-ui-color-onforest) 10%, transparent); }
  .ds-land-more { margin-top: var(--ds-ui-space-40); }
  .ds-land-more .ds-button { border-color: var(--ds-ui-color-forest); color: var(--ds-ui-color-forest); background: transparent; }
  .ds-land-more .ds-button:hover { background: var(--ds-ui-color-band); }
  .ds-land-acts { display: flex; flex-wrap: wrap; gap: var(--ds-ui-space-12); }

  /* ---- the header: solid forest like the rest of the site (owner 2026-11-16); the photograph starts below it ------------- */
  .ds-land-top { position: sticky; top: 0; z-index: var(--ds-layer-sticky); background: var(--ds-ui-color-forest); color: var(--ds-ui-color-onforest); }
  .ds-land-top__in { box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; height: var(--ds-ui-dim-siteheadphone); max-width: var(--ds-ui-dim-homewide); margin: 0 auto; padding: 0 calc(var(--ds-ui-space-16) + var(--ds-ui-space-4)); }
  .ds-land-top a { color: inherit; text-decoration: none; }
  .ds-land-top__logo { display: block; }
  .ds-land-top__logo img { display: block; height: var(--ds-ui-dim-sitelogophone); width: auto; }
  .ds-land-top__nav { display: none; align-items: center; gap: var(--ds-ui-space-32); font-size: var(--ds-ui-size-14); line-height: 1.4286; }
  .ds-land-top__link { display: inline-flex; align-items: center; min-height: var(--ds-ui-tap); font-size: var(--ds-ui-size-14); line-height: 1.4286; }
  .ds-land-top__link:hover { color: var(--ds-ui-color-goldfill); }

  /* ---- the hero ---------------------------------------------------------------------------------------------------- */
  .ds-land-hero { position: relative; display: flex; align-items: center; justify-content: center; min-height: 80svh; overflow: hidden; background: var(--ds-ui-color-forest); color: var(--ds-ui-color-onforest); text-align: center; }
  .ds-land-hero__photo { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; animation: ds-land-zoom 8s ease-out both; }
  .ds-land-hero__scrim { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: color-mix(in srgb, var(--ds-ui-color-forest) 55%, transparent); }
  .ds-land-hero__in { position: relative; box-sizing: border-box; max-width: var(--ds-ui-dim-homenarrow); margin: 0 auto; padding: var(--ds-ui-space-64) calc(var(--ds-ui-space-16) + var(--ds-ui-space-4)) 0; }
  .ds-land-rule--center { margin: 0 auto var(--ds-ui-space-24); }
  .ds-land-hero__h { font-size: var(--ds-ui-size-36); line-height: 1.08; animation-delay: 120ms; }
  .ds-land-hero__lede { max-width: var(--ds-ui-dim-homelede); margin: var(--ds-ui-space-24) auto 0; font-size: var(--ds-ui-size-18); line-height: 1.5556; color: var(--ds-ui-color-onforestmuted); animation-delay: 240ms; }
  .ds-land-hero__acts { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--ds-ui-space-12); margin-top: calc(var(--ds-ui-space-32) + var(--ds-ui-space-4)); animation-delay: 360ms; }

  /* ---- Just Arrived ------------------------------------------------------------------------------------------------ */
  .ds-land-new { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--ds-ui-space-16); row-gap: var(--ds-ui-space-40); }
  .ds-land-piece { display: block; color: inherit; text-decoration: none; }
  .ds-land-piece__photo, .ds-land-cat__photo { overflow: hidden; }
  .ds-land-piece__photo { aspect-ratio: 1; background: var(--ds-ui-color-surface); }
  .ds-land-piece__photo img, .ds-land-cat__photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1); }
  .ds-land-piece:hover img, .ds-land-cat:hover img { transform: scale(1.05); }
  .ds-land-piece__title { margin-top: var(--ds-ui-space-16); font-size: var(--ds-ui-size-16); line-height: 1.375; }
  .ds-land-piece__meta { margin-top: var(--ds-ui-space-4); font-size: var(--ds-ui-size-14); line-height: 1.4286; color: var(--ds-ui-color-muted); }

  /* ---- the collection's categories --------------------------------------------------------------------------------- */
  .ds-land-cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ds-ui-space-12); }
  .ds-land-cat { display: block; color: inherit; text-decoration: none; }
  .ds-land-cat__photo { aspect-ratio: 4 / 5; background: var(--ds-ui-color-band); }
  .ds-land-cat__name { display: flex; align-items: center; justify-content: space-between; margin-top: var(--ds-ui-space-12); font-size: var(--ds-ui-size-18); line-height: 1.5556; }
  .ds-land-cat__go { font-family: Arial, sans-serif; color: var(--ds-ui-color-goldfill); transition: transform 0.15s; }
  .ds-land-cat:hover .ds-land-cat__go { transform: translateX(var(--ds-ui-space-4)); }

  /* ---- the story ---------------------------------------------------------------------------------------------------- */
  .ds-land-story .ds-land-h2 + .ds-land-body { margin-top: var(--ds-ui-space-24); }
  .ds-land-story .ds-land-body + .ds-land-body { margin-top: var(--ds-ui-space-16); }
  .ds-land-pull { margin-top: var(--ds-ui-space-32); padding-left: calc(var(--ds-ui-space-16) + var(--ds-ui-space-4)); border-left: var(--ds-ui-dim-line) solid var(--ds-ui-color-goldfill); font-family: var(--ds-ui-font-serif); font-size: var(--ds-ui-size-20); font-style: italic; line-height: 1.4; }

  /* ---- four facts --------------------------------------------------------------------------------------------------- */
  .ds-land-facts { background: var(--ds-ui-color-surface); border-bottom: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); }
  .ds-land-facts__in { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--ds-ui-space-32); padding-top: var(--ds-ui-space-40); padding-bottom: var(--ds-ui-space-40); }
  .ds-land-fact { padding-right: var(--ds-ui-space-16); }
  .ds-land-fact .ds-land-rule { margin-bottom: var(--ds-ui-space-12); }
  .ds-land-h3 { font-size: var(--ds-ui-size-18); line-height: 1.5556; }
  .ds-land-fact p { margin-top: var(--ds-ui-space-4); font-size: var(--ds-ui-size-14); line-height: 1.4286; color: var(--ds-ui-color-muted); }

  /* ---- the Plaza heritage ------------------------------------------------------------------------------------------- */
  .ds-land-heritage { display: grid; grid-template-columns: minmax(0, 1fr); gap: calc(var(--ds-ui-space-40) + var(--ds-ui-space-8)); }
  .ds-land-heritage__text > * + * { margin-top: calc(var(--ds-ui-space-16) + var(--ds-ui-space-4)); }
  .ds-land-heritage__text .ds-land-body { color: var(--ds-ui-color-onforestmuted); }
  .ds-land-heritage__quote { font-family: var(--ds-ui-font-serif); font-size: var(--ds-ui-size-20); font-style: italic; line-height: 1.4; color: var(--ds-ui-color-onforest); }
  .ds-land-heritage__note { font-size: var(--ds-ui-size-14); line-height: 1.4286; color: var(--ds-ui-color-onforestmuted); }
  .ds-land-years { margin: 0; padding: 0; list-style: none; }
  .ds-land-years li { display: flex; align-items: baseline; gap: var(--ds-ui-space-24); padding-bottom: var(--ds-ui-space-24); border-bottom: var(--ds-ui-dim-line) solid color-mix(in srgb, var(--ds-ui-color-onforest) 15%, transparent); color: var(--ds-ui-color-onforestmuted); }
  .ds-land-years li + li { margin-top: var(--ds-ui-space-32); }
  .ds-land-years__n { font-weight: var(--ds-ui-weight-light); font-size: var(--ds-ui-size-36); line-height: 1.1111; color: var(--ds-ui-color-goldfill); }

  /* ---- expert advice ------------------------------------------------------------------------------------------------ */
  .ds-land-tips { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: var(--ds-ui-space-40); }
  .ds-land-tip__n { font-size: var(--ds-ui-size-14); line-height: 1.4286; color: var(--ds-ui-color-goldfill); }
  .ds-land-tip__h { margin-top: var(--ds-ui-space-8); font-size: var(--ds-ui-size-24); line-height: 1.3333; }
  .ds-land-body--tip { margin-top: var(--ds-ui-space-12); font-size: var(--ds-ui-size-16); }
  .ds-land-tip--end { display: flex; flex-direction: column; justify-content: flex-end; }
  .ds-land-tip__quote { font-family: var(--ds-ui-font-serif); font-size: var(--ds-ui-size-20); font-style: italic; line-height: 1.4; }
  .ds-land-ask { margin: calc(var(--ds-ui-space-16) - var(--ds-ui-space-12)) 0 calc(var(--ds-ui-space-12) * -1); padding: var(--ds-ui-space-12) 0; font-size: var(--ds-ui-size-14); line-height: 1.4286; color: var(--ds-ui-color-forest); text-decoration: underline; text-underline-offset: var(--ds-ui-space-4); }
  .ds-land-ask:hover { color: var(--ds-ui-color-goldfill); }

  /* ---- visit us ----------------------------------------------------------------------------------------------------- */
  .ds-land-visit { position: relative; overflow: hidden; }
  .ds-land-visit__photo { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; opacity: var(--ds-ui-opacity-photo); }
  .ds-land-visit__scrim { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--ds-ui-color-scrim) 90%, transparent) 0%, color-mix(in srgb, var(--ds-ui-color-scrim) 55%, transparent) 45%, transparent 80%); }
  .ds-land-visit__in { position: relative; }
  .ds-land-visit__h { max-width: var(--ds-ui-dim-homelede); }
  .ds-land-visit__info { display: grid; gap: var(--ds-ui-space-8); max-width: var(--ds-ui-dim-homelede); margin-top: var(--ds-ui-space-32); color: var(--ds-ui-color-onforestmuted); }
  .ds-land-visit .ds-land-acts { margin-top: var(--ds-ui-space-40); }
  .ds-land-visit__text { margin-top: var(--ds-ui-space-16); font-size: var(--ds-ui-size-14); line-height: 1.4286; color: var(--ds-ui-color-onforestmuted); }

  /* ---- the footer: slim ---------------------------------------------------------------------------------------------- */
  .ds-land-foot { background: var(--ds-ui-color-forest); color: var(--ds-ui-color-onforestmuted); }
  .ds-land-foot__in { display: flex; flex-direction: column; gap: var(--ds-ui-space-24); padding-top: var(--ds-ui-space-40); padding-bottom: var(--ds-ui-space-40); border-top: var(--ds-ui-dim-line) solid color-mix(in srgb, var(--ds-ui-color-onforest) 10%, transparent); font-size: var(--ds-ui-size-14); line-height: 1.4286; }
  .ds-land-foot__in img { align-self: flex-start; display: block; height: var(--ds-ui-dim-footlogo); width: auto; }
  .ds-land-foot__in p { margin: 0; }

  /* ---- 768 px and wider: the owner's desktop layout ------------------------------------------------------------------- */
  @media (min-width: 768px) {
    .ds-land-sec { padding-top: calc(var(--ds-ui-space-64) + var(--ds-ui-space-32) + var(--ds-ui-space-16)); padding-bottom: calc(var(--ds-ui-space-64) + var(--ds-ui-space-32) + var(--ds-ui-space-16)); }
    .ds-land-in { padding-left: var(--ds-ui-space-32); padding-right: var(--ds-ui-space-32); }
    .ds-land-head { margin-bottom: calc(var(--ds-ui-space-40) + var(--ds-ui-space-16)); }
    .ds-land-h2 { font-size: var(--ds-ui-size-48); line-height: 1; }
    .ds-land-top__in { padding-left: var(--ds-ui-space-32); padding-right: var(--ds-ui-space-32); }
    .ds-land-top__logo img { height: var(--ds-ui-dim-sitelogo); }
    .ds-land-top__in { height: var(--ds-ui-dim-sitehead); }
    .ds-land-top__nav { display: flex; }
    .ds-land-hero__h { font-size: var(--ds-ui-size-72); }
    .ds-land-new { grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--ds-ui-space-24); }
    .ds-land-cats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: calc(var(--ds-ui-space-16) + var(--ds-ui-space-4)); }
    .ds-land-story { max-width: var(--ds-ui-dim-homenarrow); }
    .ds-land-facts__in { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .ds-land-heritage { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ds-land-years__n { font-size: var(--ds-ui-size-48); line-height: 1; }
    .ds-land-tips { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: calc(var(--ds-ui-space-40) + var(--ds-ui-space-8)); }
    .ds-land-foot__in { flex-direction: row; justify-content: space-between; padding-left: var(--ds-ui-space-32); padding-right: var(--ds-ui-space-32); }
  }

}
/* ---- design/css/pages/parts.css · the layout of the parts page (/admin/parts) only: sections, swatches, scale bars and
   the boxes the specimens sit in. It never restyles a shared part (docs/v5-design.md). ---- */

@layer pages {
  .ds-parts { max-width: var(--ds-ui-dim-page); margin: 0 auto; padding: var(--ds-ui-space-24) var(--ds-ui-space-24) var(--ds-ui-space-64); }
  .ds-parts-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--ds-ui-space-16); padding-bottom: var(--ds-ui-space-16); margin-bottom: var(--ds-ui-space-24); border-bottom: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); }
  .ds-parts-toc { display: flex; flex-wrap: wrap; gap: var(--ds-ui-space-8) var(--ds-ui-space-16); margin: 0 0 var(--ds-ui-space-24); padding: 0; list-style: none; }
  .ds-parts-section { display: flex; flex-direction: column; gap: var(--ds-ui-space-16); padding: var(--ds-ui-space-24) 0; border-top: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); }
  .ds-parts-section > h2 { margin: 0; font-family: var(--ds-ui-font-serif); font-size: var(--ds-ui-size-20); font-weight: var(--ds-ui-weight-regular); }
  .ds-parts-section > *, .ds-parts-spec, .ds-parts-box > * { min-width: 0; }
  .ds-parts-note { margin: 0; max-width: var(--ds-ui-dim-bubble); color: var(--ds-ui-color-muted); }
  .ds-parts-note code, .ds-parts-code { font-family: ui-monospace, Consolas, monospace; font-size: var(--ds-ui-size-12); color: var(--ds-ui-color-ink); }
  .ds-parts-spec { display: flex; flex-direction: column; gap: var(--ds-ui-space-8); }
  .ds-parts-spec > .ds-label { margin: 0; }
  .ds-parts-box { display: flex; align-items: center; flex-wrap: wrap; gap: var(--ds-ui-space-12); padding: var(--ds-ui-space-16); border: var(--ds-ui-dim-line) dashed var(--ds-ui-color-line2); border-radius: var(--ds-ui-radius); }
  .ds-parts-box--forest { background: var(--ds-ui-color-forest); }
  .ds-parts-box--col { align-items: stretch; flex-direction: column; flex-wrap: nowrap; }
  .ds-parts-box--flush { padding: 0; }
  .ds-parts-box--narrow { max-width: var(--ds-ui-dim-dialogsm); }
  .ds-parts-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--ds-ui-dim-menu), 1fr)); gap: var(--ds-ui-space-16); }
  .ds-parts-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--ds-ui-dim-menu), 1fr)); gap: var(--ds-ui-space-12); }
  .ds-parts-swatch { display: flex; align-items: center; gap: var(--ds-ui-space-8); font-size: var(--ds-ui-size-12); }
  .ds-parts-chip { flex: none; width: var(--ds-ui-photo-48); height: var(--ds-ui-photo-48); border: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); border-radius: var(--ds-ui-radius); }
  .ds-parts-chip--forest { background: var(--ds-ui-color-forest); }
  .ds-parts-chip--forest2 { background: var(--ds-ui-color-forest2); }
  .ds-parts-chip--ink { background: var(--ds-ui-color-ink); }
  .ds-parts-chip--muted { background: var(--ds-ui-color-muted); }
  .ds-parts-chip--line { background: var(--ds-ui-color-line); }
  .ds-parts-chip--line2 { background: var(--ds-ui-color-line2); }
  .ds-parts-chip--soft { background: var(--ds-ui-color-soft); }
  .ds-parts-chip--bg { background: var(--ds-ui-color-bg); }
  .ds-parts-chip--surface { background: var(--ds-ui-color-surface); }
  .ds-parts-chip--gold { background: var(--ds-ui-color-gold); }
  .ds-parts-chip--goldbar { background: var(--ds-ui-color-goldbar); }
  .ds-parts-chip--goldtint { background: var(--ds-ui-color-goldtint); }
  .ds-parts-chip--goldtext { background: var(--ds-ui-color-goldtext); }
  .ds-parts-chip--ok { background: var(--ds-ui-color-ok); }
  .ds-parts-chip--okbg { background: var(--ds-ui-color-okbg); }
  .ds-parts-chip--red { background: var(--ds-ui-color-red); }
  .ds-parts-chip--onforestmuted { background: var(--ds-ui-color-onforestmuted); }
  .ds-parts-scale { display: flex; align-items: baseline; gap: var(--ds-ui-space-16); }
  .ds-parts-scale > .ds-label { flex: none; width: var(--ds-ui-photo-72); }
  .ds-parts-bar { flex: none; height: var(--ds-ui-space-12); background: var(--ds-ui-color-gold); }
  .ds-parts-bar--4 { width: var(--ds-ui-space-4); }
  .ds-parts-bar--8 { width: var(--ds-ui-space-8); }
  .ds-parts-bar--12 { width: var(--ds-ui-space-12); }
  .ds-parts-bar--16 { width: var(--ds-ui-space-16); }
  .ds-parts-bar--24 { width: var(--ds-ui-space-24); }
  .ds-parts-bar--32 { width: var(--ds-ui-space-32); }
  .ds-parts-bar--40 { width: var(--ds-ui-space-40); }
  .ds-parts-bar--64 { width: var(--ds-ui-space-64); }
  .ds-parts-toastbox .ds-toast { position: static; transform: none; animation: none; }
  .ds-parts-menubox { min-height: calc(var(--ds-ui-dim-menu) * 1.5); align-items: flex-start; }
  /* The staff frame, shown inside a box: a transformed ancestor makes the fixed bars (tab bar, action bar) sit in the box. */
  .ds-parts-frame { position: relative; transform: translateZ(0); height: 80dvh; overflow: hidden; border: var(--ds-ui-dim-line) solid var(--ds-ui-color-line2); border-radius: var(--ds-ui-radius); }
  .ds-parts-frame .ds-app { height: 100%; min-height: 0; }
  .ds-parts-frame .ds-rail { height: 100%; }
  .ds-parts-frame .ds-main { min-height: 0; overflow-y: auto; }
  .ds-parts-record { max-width: var(--ds-ui-dim-page); }
}
/* ---- design/css/pages/picker.css · the customer picker (admin/_customer_picker.html; owner 2026-11-12; V5 language) ----
   A select-looking control that opens a panel (a ds-search box, then two-line rows) in flow beneath it, so it never
   clips in a dialog and is full width on a phone. The chosen state is aria-current on the control; a row the list marks
   chosen has aria-selected. Tokens only. */

@layer pages {
  .ds-picker { display: flex; flex-direction: column; gap: var(--ds-ui-space-8); min-width: 0; }
  .ds-picker__bar { display: flex; align-items: center; gap: var(--ds-ui-space-8); }
  .ds-picker__control {
    display: flex; align-items: center; justify-content: space-between; gap: var(--ds-ui-space-8); flex: 1 1 0; min-width: 0; height: var(--ds-ui-control-md);
    padding: 0 var(--ds-ui-control-padx); border: var(--ds-ui-dim-line) solid var(--ds-ui-color-line2); border-radius: var(--ds-ui-radius);
    background: var(--ds-ui-color-surface); color: var(--ds-ui-color-ink); text-align: left; cursor: pointer;
    font: inherit; font-size: var(--ds-ui-control-font);
  }
  .ds-picker__control:hover { border-color: var(--ds-ui-color-muted); }
  .ds-picker__control:focus-visible { border-color: var(--ds-ui-color-gold); outline: var(--ds-ui-dim-bar) solid var(--ds-ui-color-focus); outline-offset: 0; }
  .ds-picker__control[aria-current="true"] { border-color: var(--ds-ui-color-goldbar); background: var(--ds-ui-color-goldtint); }
  .ds-picker__control[aria-current="true"] .ds-picker__value { font-family: var(--ds-ui-font-serif); font-weight: var(--ds-ui-weight-medium); }
  .ds-picker__control[aria-expanded="true"] .ds-picker__chev { transform: rotate(180deg); }
  .ds-picker__value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ds-picker__value--empty { color: var(--ds-ui-color-muted); }
  .ds-picker__chev { flex: none; }
  .ds-picker__panel { display: flex; flex-direction: column; gap: var(--ds-ui-space-8); padding: var(--ds-ui-space-8); border: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); border-radius: var(--ds-ui-radius); background: var(--ds-ui-color-surface); }
  .ds-picker__panel[hidden] { display: none; }
}
/* ---- design/css/pages/public.css · the public website on the V5 shared parts (docs/v5-design.md) --------------------
   Page layout only: where the shared parts sit on the website's pages (the header's second row, the footer, the
   collection and its filter panel, the piece page, Visit Us, the saved pieces) and the few parts that exist only here
   (the swipeable photograph row and its dots, the filter groups, the photo viewer). It never restyles a shared part:
   buttons, fields, chips, cards, dialogs, the pager and the header are `ds-*` parts, written as the parts page shows.
   Tokens `--ds-ui-*` only; the six text sizes; spacing steps. Classes ds-site-* are this sheet's own. ---- */

@layer pages {

  /* ---- shell ---------------------------------------------------------------------------------------------------- */
  /* The website's ground is white (owner 2026-11-19), not the warm off-white of the staff and client pages. */
  .ds-site { display: flex; flex-direction: column; min-height: 100dvh; background: var(--ds-ui-color-surface); }
  .ds-site-top { position: sticky; top: 0; z-index: var(--ds-layer-sticky); background: var(--ds-ui-color-forest); }
  .ds-site-top .ds-sitehead { max-width: var(--ds-ui-dim-sitemax); margin: 0 auto; }
  .ds-site-logo { display: block; flex: none; }
  .ds-site-saved { position: relative; }
  .ds-site-saved .ds-count { position: absolute; top: var(--ds-ui-space-4); right: var(--ds-ui-space-4); }

  /* P2 prototype: the categories as the page's navigation, a row of tabs under the title (not in the header, not in the filters). */
  .ds-site-tiers { margin: 0 0 var(--ds-ui-space-24); border-bottom: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); }
  .ds-site-tiers__in { display: flex; flex-wrap: wrap; gap: 0 var(--ds-ui-space-32); }
  .ds-site-tiers__link {
    position: relative; display: inline-flex; align-items: center; gap: var(--ds-ui-space-4); flex: none; min-height: var(--ds-ui-tap); color: var(--ds-ui-color-muted); text-decoration: none; white-space: nowrap; cursor: pointer; list-style: none;
    font-size: var(--ds-ui-size-12); font-weight: var(--ds-ui-weight-medium); letter-spacing: var(--ds-ui-tracking-label); text-transform: uppercase;
  }
  .ds-site-tiers__link::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: var(--ds-ui-dim-bar);
    background: var(--ds-ui-color-forest); transform: scaleX(0); transition: transform var(--ds-motion-normal) var(--ds-motion-easing);
  }
  .ds-site-tiers__link:hover { color: var(--ds-ui-color-ink); }
  .ds-site-tiers__link[aria-current="page"] { color: var(--ds-ui-color-ink); }
  .ds-site-tiers__link[aria-current="page"]::after, .ds-site-tiers__link:hover::after { transform: scaleX(1); }

  .ds-site-staffbar { position: relative; }
  .ds-site-main { display: block; flex: 1 0 auto; width: 100%; max-width: var(--ds-ui-dim-sitemax); margin: 0 auto; padding: var(--ds-ui-space-32) var(--ds-ui-space-64) var(--ds-ui-space-64); }


  /* The phone menu (a shared dialog): the categories and links as large serif rows. */
  .ds-site-menu { gap: 0; }
  .ds-site-menu a { display: flex; align-items: center; justify-content: space-between; min-height: var(--ds-ui-tap); padding: var(--ds-ui-space-12) 0; border-bottom: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); font-size: var(--ds-ui-size-20); text-decoration: none; }
  .ds-site-menu a[aria-current="page"] { color: var(--ds-ui-color-forest); }

  /* ---- page titles and the small common blocks --------------------------------------------------------------------- */
  /* Page titles: sans, light and smaller (owner 2026-11-19: the serif titles were too bold and too large). */
  .ds-site-h1 { margin: 0; font-family: var(--ds-ui-font-sans); font-size: var(--ds-ui-size-28); font-weight: var(--ds-ui-weight-light); line-height: var(--ds-ui-line-title); }
  .ds-site-h2 { margin: 0; font-size: var(--ds-ui-size-20); font-weight: var(--ds-ui-weight-regular); line-height: var(--ds-ui-line-heading); }
  /* The shared parts' serif titles are sans on the website (owner 2026-11-19): popups, the empty state, the photo viewer. */
  .ds-site .ds-dialog__title, .ds-site .ds-empty__title, .ds-site .ds-viewer__title, .ds-site .ds-viewer__none { font-family: var(--ds-ui-font-sans); }

  .ds-site-head { display: flex; flex-direction: column; gap: var(--ds-ui-space-8); margin: 0 0 var(--ds-ui-space-24); }
  .ds-site-gone { margin: 0 0 var(--ds-ui-space-24); }
  .ds-site-list { margin: 0; padding: 0; list-style: none; }
  .ds-site-heartform { margin: 0; }

  /* ---- the collection ------------------------------------------------------------------------------------------- */
  .ds-site-catalog { display: grid; grid-template-columns: var(--ds-ui-dim-aside) minmax(0, 1fr); column-gap: var(--ds-ui-space-40); }
  .ds-site-aside { padding-right: var(--ds-ui-space-24); border-right: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); }
  .ds-site-resultscol { position: relative; min-width: 0; }
  .ds-site-sort { position: relative; }
  .ds-site-sort select { appearance: none; padding-right: var(--ds-ui-space-32); }
  .ds-site-sort > .ds-icon { position: absolute; right: var(--ds-ui-space-12); top: 50%; width: var(--ds-ui-icon-sm); height: var(--ds-ui-icon-sm); margin-top: calc(var(--ds-ui-icon-sm) / -2); pointer-events: none; }
  /* Sort listbox (mfj.js builds it over the select when script runs; the select stays the source of truth). */
  .ds-site-sort--js > .ds-site-sort__k, .ds-site-sort--js > select, .ds-site-sort--js > .ds-icon { display: none; }
  .ds-site-sort__k { color: var(--ds-ui-color-muted); }
  .ds-site-sort__btn .ds-icon { position: static; width: var(--ds-ui-icon-sm); height: var(--ds-ui-icon-sm); margin: 0; transition: transform var(--ds-motion-fast) var(--ds-motion-easing); }
  .ds-site-sort__btn[aria-expanded="true"] .ds-icon { transform: rotate(180deg); }
  .ds-site-sort__list { margin: 0; list-style: none; }
  .ds-site-sort__list[hidden] { display: none; }
  .ds-site-sort__list:focus { outline: none; }
  .ds-site-sort__opt { justify-content: space-between; }
  .ds-site-sort__opt .ds-icon { visibility: hidden; color: var(--ds-ui-color-forest); }
  .ds-site-sort__opt[data-active] { background: var(--ds-ui-color-soft); }
  .ds-site-sort__opt[aria-selected="true"] { font-weight: var(--ds-ui-weight-medium); }
  .ds-site-sort__opt[aria-selected="true"] .ds-icon { visibility: visible; }
  .ds-site-sort__list:focus-visible .ds-site-sort__opt[data-active] { outline: var(--ds-ui-dim-bar) solid var(--ds-ui-color-focus); outline-offset: calc(var(--ds-ui-dim-bar) * -1); }

  .ds-site-busy { display: none; position: absolute; left: 0; right: 0; top: 0; height: var(--ds-ui-dim-bar); overflow: hidden; background: var(--ds-ui-color-soft); }
  .ds-site-busy::after { content: ""; display: block; width: 40%; height: 100%; background: var(--ds-ui-color-forest); animation: ds-site-busy var(--ds-motion-spinner) ease-in-out infinite; }
  @keyframes ds-site-busy { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
  .ds-site-loadnote { display: none; margin: 0 0 var(--ds-ui-space-12); font-size: var(--ds-ui-size-12); }
  .ds-site-catalog.htmx-request .ds-site-busy, .ds-site-catalog.htmx-request .ds-site-loadnote { display: block; }
  .ds-site-catalog.htmx-request .ds-site-results { opacity: var(--ds-ui-opacity-disabled); transition: opacity var(--ds-motion-normal) var(--ds-motion-easing); }
  .ds-site-error { margin: 0 0 var(--ds-ui-space-16); }
  .ds-site-filtersbtn .ds-count { margin-left: var(--ds-ui-space-4); }

  /* The Filter panel and the filters sheet: one macro, checkbox rows. */
  .ds-site-refine__head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 0 var(--ds-ui-space-16); border-bottom: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); }
  .ds-site-refine__head h2 { margin: 0; font-size: var(--ds-ui-size-16); font-weight: var(--ds-ui-weight-medium); }
  /* The filters sheet's own title follows the panel's heading: sans (owner 2026-11-19). */
  .ds-dialog:has(.ds-site-refine--sheet) .ds-dialog__title { font-family: var(--ds-ui-font-sans); font-weight: var(--ds-ui-weight-medium); }
  .ds-site-group { border-bottom: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); }
  .ds-site-group:last-of-type { border-bottom: 0; }
  .ds-site-group__title { display: flex; align-items: center; gap: var(--ds-ui-space-8); min-height: var(--ds-ui-tap); padding: var(--ds-ui-space-8) 0; list-style: none; cursor: pointer; font-size: var(--ds-ui-size-16); font-weight: var(--ds-ui-weight-regular); }
  .ds-site-group__title::-webkit-details-marker { display: none; }
  .ds-site-group__chev { margin-left: auto; width: var(--ds-ui-icon-sm); height: var(--ds-ui-icon-sm); transition: transform var(--ds-motion-fast) var(--ds-motion-easing); }
  .ds-site-group[open] > .ds-site-group__title .ds-site-group__chev { transform: rotate(180deg); }
  .ds-site-group__body { display: grid; gap: var(--ds-ui-space-8); min-width: 0; margin: 0; padding: 0 0 var(--ds-ui-space-16); border: 0; }
  .ds-site-options { display: grid; gap: var(--ds-ui-space-4); }
  .ds-site-find { display: block; }
  .ds-site-group__none { display: none; margin: 0; font-size: var(--ds-ui-size-12); }
  .ds-site-group__body[data-nomatch] .ds-site-group__none { display: block; }
  .ds-site-group__body [data-unmatched] { display: none; }
  .ds-site-apply { margin: var(--ds-ui-space-16) 0 0; }
  .ds-site-refine--sheet .ds-site-group__body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--ds-ui-space-24); }
  .ds-site-refine--sheet .ds-site-options { display: contents; }
  .ds-site-refine--sheet .ds-site-find, .ds-site-refine--sheet .ds-site-group__none,
  .ds-site-refine--sheet .ds-site-apply { grid-column: 1 / -1; }

  .ds-site-pager { margin-top: var(--ds-ui-space-40); padding-top: var(--ds-ui-space-16); border-top: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); }
  .ds-site-pager .ds-pager { margin-top: 0; justify-content: flex-end; }
  /* The one result count, at the right end of the toolbar row after Sort; under 1100 px it wraps onto its own line. */
  .ds-site-count { margin-left: var(--ds-ui-space-16); font-size: var(--ds-ui-size-14); white-space: nowrap; }
  .ds-filterbar > .ds-site-count { flex: none; }
  /* Four across on the desktop (owner trial 2026-11-16: photographs near 250 px); tablet and phone keep their counts. */
  @media (min-width: 1100px) {
    .ds-site-results .ds-piece-grid--client { grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--ds-ui-space-16); row-gap: var(--ds-ui-space-32); }
  }
  /* The filter panel follows the page: sticky under the header, its own scroll when taller than the window. */
  .ds-site-aside { position: sticky; top: calc(var(--ds-ui-dim-sitehead) + var(--ds-ui-space-16)); align-self: start; max-height: calc(100dvh - var(--ds-ui-dim-sitehead) - var(--ds-ui-space-32)); overflow-y: auto; overscroll-behavior: contain; }

  /* ---- the piece card on the website: the shared piece_card with the swipe gallery; the whole card a link --------------- */
  .ds-site-card { min-width: 0; }
  .ds-site-card .ds-piece { height: 100%; }
  /* The piece's name on the website's cards: sans, body size (owner 2026-11-19), not the shared card's serif heading. */
  .ds-site-card .ds-piece__title { font-family: var(--ds-ui-font-sans); font-size: var(--ds-ui-size-16); line-height: var(--ds-ui-line-heading); }
  /* The photograph's row is above the title link's ::after so a swipe scrolls it; each photograph is its own link. */
  .ds-site-card .ds-piece__title a::after { content: ""; position: absolute; inset: 0; }
  .ds-site-card .ds-piece__title a:hover { text-decoration: underline; text-underline-offset: var(--ds-ui-dim-mark); }
  .ds-site-stage__row { display: flex; height: 100%; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .ds-site-stage__row::-webkit-scrollbar { display: none; }
  /* Previous / next arrows (the viewer's own step buttons, driven by data-swipe-step); hidden at the ends and on phones, where a swipe and the dots do it. */
  .ds-site-stage__step { position: absolute; top: 50%; z-index: 2; margin-top: calc(var(--ds-ui-control-md) / -2); box-shadow: var(--ds-ui-shadow-heart); }
  .ds-site-stage__step--prev { left: var(--ds-ui-space-16); }
  .ds-site-stage__step--next { right: var(--ds-ui-space-16); }
  .ds-site-gallery[data-at="start"] .ds-site-stage__step--prev, .ds-site-gallery[data-at="end"] .ds-site-stage__step--next { display: none; }

  /* ---- the piece ------------------------------------------------------------------------------------------------ */
  /* The label column takes its longest label ("Round diamond") so a stone's name never wraps beside its weight. */
  .ds-site-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-ui-space-8); margin: 0 0 var(--ds-ui-space-24); color: var(--ds-ui-color-muted); font-size: var(--ds-ui-size-12); }
  .ds-site-crumbs a:hover { color: var(--ds-ui-color-ink); text-decoration: underline; }
  .ds-site-crumbs .ds-icon { width: var(--ds-ui-icon-sm); height: var(--ds-ui-icon-sm); }
  .ds-site-crumbs [aria-current] { color: var(--ds-ui-color-ink); }
  /* Owner 2026-11-20: the photograph is 500 by 500 (two and a half tiles) and the text takes the rest of a centred block. */
  .ds-site-piece { display: grid; grid-template-columns: calc(var(--ds-ui-dim-tile) * 2.5) minmax(0, 1fr); column-gap: var(--ds-ui-space-64); align-items: start; max-width: var(--ds-ui-dim-narrow); margin: 0 auto; }
  .ds-site-gallery { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--ds-ui-space-16); }
  .ds-site-stage { position: relative; width: 100%; }
  .ds-site-stage__slide { flex: 0 0 100%; min-width: 0; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; }
  .ds-site-stage__open { position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
  .ds-site-stage__slide video { display: block; width: 100%; height: 100%; object-fit: contain; }
  .ds-site-stage .ds-site-dots { bottom: var(--ds-ui-space-16); }
  .ds-site-gallery[data-at="end"]:has([data-video]) .ds-site-stage .ds-site-dots { bottom: var(--ds-ui-dim-dotlift); }

  .ds-site-pieceinfo { min-width: 0; }
  .ds-site-pieceinfo h1 { margin: 0; font-size: var(--ds-ui-size-28); font-weight: var(--ds-ui-weight-light); line-height: var(--ds-ui-line-title); }
  .ds-site-pieceno { margin-right: var(--ds-ui-space-8); }
  /* The same structure as his drawing: number, title, price; a hairline; Save and Inquire; a hairline; Description; a
     hairline; Details with Gemstones and Mounting side by side. The short list of key facts under the price is gone. */
  .ds-site-acts { display: flex; gap: var(--ds-ui-space-12); padding-top: var(--ds-ui-space-16); border-top: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); }
  .ds-site-specs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ds-site-specs > .ds-col { padding-right: var(--ds-ui-space-32); }
  .ds-site-specs > .ds-col + .ds-col { padding-right: 0; padding-left: var(--ds-ui-space-32); border-left: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); }
  .ds-site-specs > .ds-col:only-child { grid-column: 1 / -1; padding-right: 0; }
  .ds-site-acts .ds-site-heartform { flex: 0 0 auto; }
  .ds-site-inquire { flex: 1; }
  .ds-site-savebtn[aria-pressed="true"] .ds-icon { color: var(--ds-ui-color-red); fill: currentColor; }
  .ds-site-infosec { margin-top: var(--ds-ui-space-8); padding-top: var(--ds-ui-space-16); border-top: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); }
  .ds-site-infosec h2, .ds-site-infosec h3, .ds-site-infosec p { margin: 0; }
  .ds-site-infosec h3 { font-size: var(--ds-ui-size-16); }
  .ds-site-sub { display: block; }

  .ds-site-fold { margin-top: var(--ds-ui-space-40); border-top: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); }
  .ds-site-fold__title { display: flex; align-items: center; gap: var(--ds-ui-space-8); min-height: var(--ds-ui-tap); padding: var(--ds-ui-space-16) 0; list-style: none; cursor: pointer; }
  .ds-site-fold__title::-webkit-details-marker { display: none; }
  .ds-site-fold__chev { margin-left: auto; transition: transform var(--ds-motion-fast) var(--ds-motion-easing); }
  .ds-site-fold[open] > .ds-site-fold__title .ds-site-fold__chev { transform: rotate(180deg); }
  /* Related Pieces: one row that swipes (scroll-snap); the arrows sit on the edges and mfj.js shows them. */
  .ds-site-rail { position: relative; }
  .ds-site-rail__row { display: flex; gap: var(--ds-ui-space-24); margin: 0; padding: 0; list-style: none; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; overscroll-behavior-x: contain; }
  .ds-site-rail__row::-webkit-scrollbar { display: none; }
  .ds-site-rail__row > li { flex: 0 0 var(--ds-ui-dim-railcard); scroll-snap-align: start; }
  .ds-site-rail__btn { position: absolute; top: calc(var(--ds-ui-dim-railcard) / 2 - var(--ds-ui-control-md) / 2); z-index: 4; box-shadow: var(--ds-ui-shadow-heart); }
  .ds-site-rail__btn[hidden] { display: none; }
  .ds-site-rail__btn:disabled { opacity: 0; pointer-events: none; }
  .ds-site-rail__btn--prev { left: calc(var(--ds-ui-control-md) / -2); }
  .ds-site-rail__btn--next { right: calc(var(--ds-ui-control-md) / -2); }
  .ds-site-related > .ds-underline { display: inline-flex; align-items: center; min-height: var(--ds-ui-tap); margin: var(--ds-ui-space-16) 0 var(--ds-ui-space-24); }

  /* ---- saved pieces, Visit Us --------------------------------------------------------------------------------------- */
  .ds-site-narrow { max-width: var(--ds-ui-dim-narrow); margin: 0 auto; }
  .ds-site-savedacts { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--ds-ui-space-16); margin-top: var(--ds-ui-space-40); }
  .ds-site-visit { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); column-gap: var(--ds-ui-space-64); align-items: start; max-width: var(--ds-ui-dim-narrow); margin: 0 auto; }
  .ds-site-visit__photo { width: 100%; height: auto; aspect-ratio: 4 / 3.4; object-fit: cover; object-position: 50% 62%; border-radius: var(--ds-ui-radius); }
  .ds-site-visit__info p { margin: 0; }
  .ds-site-visit__info h2 { margin: 0; }
  .ds-site-visit__info .ds-icon { flex: none; margin-top: var(--ds-ui-space-4); }
  .ds-site-hours { grid-template-columns: var(--ds-ui-dim-hourslabel) minmax(0, 1fr); }
  .ds-site-hours__full { grid-column: 1 / -1; }
  .ds-site-channels { max-width: var(--ds-ui-dim-channels); }
  .ds-site-channel { justify-content: flex-start; }

  /* ---- the inquiry popup (a shared dialog) and its page ------------------------------------------------------------- */
  .ds-site-modetext { display: none; }
  .ds-site-inqform:not(:has(input[name="mode"]:checked)) .ds-site-modetext:first-child { display: inline; }
  .ds-site-inqform:has(input[name="mode"]:not([type="radio"])) .ds-site-modetext[data-mode-text="general"],
  .ds-site-inqform:has(input[name="mode"][value="piece"]:checked) .ds-site-modetext[data-mode-text="piece"],
  .ds-site-inqform:has(input[name="mode"][value="saved"]:checked) .ds-site-modetext[data-mode-text="saved"],
  .ds-site-inqform:has(input[name="mode"][value="general"]:checked) .ds-site-modetext[data-mode-text="general"] { display: inline; }
  .ds-site-inqabout { display: none; }
  .ds-site-inqform:has(input[name="mode"][value="piece"]:checked) .ds-site-inqabout[data-mode-show~="piece"],
  .ds-site-inqform:has(input[name="mode"][value="saved"]:checked) .ds-site-inqabout[data-mode-show~="saved"] { display: block; }
  .ds-site-inqform abbr { text-decoration: none; }
  .ds-site-inqfoot { justify-content: center; text-align: center; }
  .ds-site-inqfoot p { flex: 1 1 100%; margin: 0; }
  .ds-site-okmark { display: grid; place-items: center; width: var(--ds-ui-tap); height: var(--ds-ui-tap); border-radius: 50%; background: var(--ds-ui-color-okbg); color: var(--ds-ui-color-ok); }
  .ds-site-panel { max-width: var(--ds-ui-dim-dialogsm); margin: 0 auto; }
  /* Contact Us: the form below the photograph and visit block, at the block's width and a readable measure. */
  .ds-site-contactform { max-width: var(--ds-ui-dim-narrow); margin: var(--ds-ui-space-64) auto 0; scroll-margin-top: var(--ds-ui-dim-sitehead); }
  .ds-site-contactform .ds-site-panel { max-width: var(--ds-ui-dim-dialogmd); margin: 0; }


  /* ---- tablet and phone (under 1100) -------------------------------------------------------------------------------- */
  @media (max-width: 1099px) {
    .ds-site-main { padding-left: var(--ds-ui-space-24); padding-right: var(--ds-ui-space-24); }
    .ds-site-main { padding-top: var(--ds-ui-space-24); padding-bottom: var(--ds-ui-space-40); }
    .ds-site-catalog { grid-template-columns: minmax(0, 1fr); }
    .ds-site-aside { display: none; }
    .ds-filterbar > .ds-site-count { flex: 1 1 100%; margin-left: 0; text-align: right; }
    .ds-site-crumbs a { display: inline-flex; align-items: center; min-height: var(--ds-ui-tap); }
    /* Stacked: the photograph and the text share one centred column, so a held-sideways tablet does not get a page-high photograph. */
    .ds-site-piece { grid-template-columns: minmax(0, 1fr); row-gap: var(--ds-ui-space-24); max-width: calc(var(--ds-ui-dim-narrow) * 0.6); margin: 0 auto; }
    .ds-site-gallery { width: 100%; max-width: calc(var(--ds-ui-dim-tile) * 2.5); margin: 0 auto; }
    .ds-site-pieceinfo h1, .ds-site-h1 { font-size: var(--ds-ui-size-28); }
    .ds-site-visit { column-gap: var(--ds-ui-space-32); }
    .ds-site-rail__row { gap: var(--ds-ui-space-16); }
    /* Two or three cards across: the title steps down to the body size so it does not break into four lines. */
    .ds-site-card .ds-piece__title { font-size: var(--ds-ui-size-16); }
  }
  @media (max-width: 639px) {
    .ds-site-main { padding-left: var(--ds-ui-space-16); padding-right: var(--ds-ui-space-16); }
    .ds-site-tiers__in { gap: 0 var(--ds-ui-space-24); }
    .ds-site-rail__row { gap: var(--ds-ui-space-12); }
    .ds-site-rail__row > li { flex-basis: var(--ds-ui-dim-railcardphone); }
    .ds-site-rail__btn { display: none; }
    .ds-site-savedacts { flex-direction: column; }
    .ds-site-savedacts .ds-button { width: 100%; }
    .ds-site-visit { grid-template-columns: minmax(0, 1fr); row-gap: var(--ds-ui-space-24); }
    .ds-site-visit__photo { aspect-ratio: 4 / 3; }
    .ds-site-stage__step { display: none; }
    .ds-site-specs { grid-template-columns: minmax(0, 1fr); row-gap: var(--ds-ui-space-16); }
    .ds-site-specs > .ds-col, .ds-site-specs > .ds-col + .ds-col { padding: 0; border-left: 0; }
    .ds-site-channels { max-width: none; }
    .ds-site-hours { grid-template-columns: minmax(0, 1fr) auto; }
    .ds-site-panel { border: 0; }
    .ds-site-contactform { margin-top: var(--ds-ui-space-40); }
  }
}
/* ---- design/css/pages/selections.css · the layout of the staff Selections pages only (list, New selection, the editor
   and its popups). It never restyles a shared part (docs/v5-design.md): the buttons, fields, chips, tables, cards, menus,
   dialogs and piece grids come from the shared layer; what is here is a grid, a few gaps and the page's own small
   hooks. Tokens only. ---- */

@layer pages {

  /* ---- the list ---- */
  #inquiries[hidden], #results-error[hidden] { display: none; }
  .ds-sel-inq__text { flex: 1 1 calc(var(--ds-ui-dim-menu) + var(--ds-ui-dim-tile)); min-width: 0; }
  .ds-sel-inq + .ds-sel-inq { border-top: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); }
  .ds-sel-pre { white-space: pre-line; overflow-wrap: anywhere; }
  .ds-sel-loading { display: none; }
  .htmx-request > .ds-sel-loading { display: block; }
  @media (max-width: 639px) { .ds-sel-by { flex: 1 1 100%; } }
  .ds-sel-stack { display: flex; gap: var(--ds-ui-space-4); }

  /* ---- New selection and the editor's forms ---- */
  .ds-sel-narrow { max-width: var(--ds-ui-dim-dialogsm); }
  .ds-sel-inline { display: inline-block; vertical-align: middle; }

  /* ---- the photograph that opens the viewer ---- */
  .ds-sel-photobtn { display: block; flex: none; padding: 0; border: 0; background: none; cursor: pointer; border-radius: var(--ds-ui-radius); }
  .ds-sel-photobtn:focus-visible { outline: var(--ds-ui-dim-bar) solid var(--ds-ui-color-gold); outline-offset: var(--ds-ui-dim-bar); }

  /* ---- the editor's items: one table row per piece, laid out as photograph | text and fields | heart | menu ---- */
  .ds-sel-pieces, .ds-sel-pieces tbody { display: block; width: 100%; }
  .ds-sel-pieces caption { display: block; }
  .ds-sel-pieces tr {
    display: grid; grid-template-columns: var(--ds-ui-photo-72) minmax(0, 1fr) auto auto; align-items: start;
    gap: var(--ds-ui-space-12) var(--ds-ui-space-16); padding: var(--ds-ui-space-16) 0; border-top: var(--ds-ui-dim-line) solid var(--ds-ui-color-line);
  }
  .ds-sel-pieces tr.is-gone { opacity: .6; }
  .ds-sel-pieces td { display: block; min-width: 0; padding: 0; }
  .ds-sel-pieces__main { display: flex; flex-direction: column; gap: var(--ds-ui-space-8); }
  .ds-sel-pieces__heart, .ds-sel-pieces__act { align-self: start; }
  .ds-sel-slots { display: flex; flex-wrap: wrap; gap: var(--ds-ui-space-8); }
  .ds-sel-slots__price { flex: 1 1 var(--ds-ui-dim-facts); max-width: var(--ds-ui-dim-menu); }
  .ds-sel-slots__note { flex: 3 1 var(--ds-ui-dim-tile); }
  .ds-sel-slot { justify-content: flex-start; gap: var(--ds-ui-space-8); min-width: 0; text-align: left; font-weight: var(--ds-ui-weight-regular); }
  .ds-sel-slot > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  @media (max-width: 639px) {
    .ds-sel-pieces tr { grid-template-columns: var(--ds-ui-photo-72) minmax(0, 1fr) auto; }
    .ds-sel-pieces__photo { grid-column: 1; grid-row: 1 / span 2; }
    .ds-sel-pieces__main { grid-column: 2; grid-row: 1 / span 2; }
    .ds-sel-pieces__act { grid-column: 3; grid-row: 1; }
    .ds-sel-pieces__heart { grid-column: 3; grid-row: 2; }
    .ds-sel-slots__price { max-width: none; }
  }

  /* ---- the Add items window: filters above the scrolling grid, a tick on each card ---- */
  .ds-sel-picker__filters { flex: none; padding: var(--ds-ui-space-12) var(--ds-ui-space-24); border-bottom: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); }
  .ds-sel-picker__selects { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(var(--ds-ui-dim-facts) + var(--ds-ui-space-32)), 1fr)); gap: var(--ds-ui-space-8); }
  .ds-sel-pickcard { position: relative; border-radius: var(--ds-ui-radius); }
  .ds-sel-pickcard:has(input:checked:not(:disabled)) { outline: var(--ds-ui-dim-bar) solid var(--ds-ui-color-gold); outline-offset: var(--ds-ui-dim-bar); }
  .ds-sel-pickcard:has(input:disabled) { opacity: .7; }
  .ds-sel-tick { display: inline-flex; align-items: center; justify-content: center; min-width: var(--ds-ui-tap); min-height: var(--ds-ui-tap); background: var(--ds-ui-color-surface); border-radius: var(--ds-ui-radius); }
}
/* ---- design/css/pages/today.css · the layout of Today only (board Main; phone boards Today-phone-queue and -person): the
   two columns, the person's name line, the row of photographs, the context strip, and the phone's one-screen-at-a-time
   switch. It never restyles a shared part (docs/v5-design.md). ---- */

@layer pages {
  .ds-today__bands { margin: 0 0 var(--ds-ui-space-16); }
  .ds-today__bands:empty { display: none; }
  .ds-today__notice { flex-wrap: wrap; }
  .ds-today__notice form { margin: 0; }

  /* The two columns: the queue (fixed), the person (the rest). */
  .ds-today { display: grid; grid-template-columns: var(--ds-ui-dim-queue) minmax(0, 1fr); align-items: start; border: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); border-radius: var(--ds-ui-radius); background: var(--ds-ui-color-surface); }
  .ds-today--empty { display: block; border: 0; }
  .ds-today__queue { min-width: 0; border-right: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); }
  .ds-today__queuehead { padding: var(--ds-ui-space-16) var(--ds-ui-space-16) var(--ds-ui-space-8); }
  .ds-today__date { margin: 0; font-weight: var(--ds-ui-weight-regular); }
  .ds-today__tabs { padding: 0 var(--ds-ui-space-16); flex-wrap: wrap; gap: 0 var(--ds-ui-space-16); } /* four tabs: wrap instead of scrolling */
  .ds-today__showall { display: block; padding: var(--ds-ui-space-12) var(--ds-ui-space-16); color: var(--ds-ui-color-muted); }

  /* The person. */
  .ds-today__person { display: flex; flex-direction: column; gap: var(--ds-ui-space-16); min-width: 0; padding: var(--ds-ui-space-24) var(--ds-ui-space-32) var(--ds-ui-space-32); }
  .ds-today__person > .ds-label, .ds-today__person > p, .ds-today__person > hr { margin: 0; }
  .ds-today__name { margin: 0; font-weight: var(--ds-ui-weight-regular); line-height: var(--ds-ui-line-title); }
  .ds-today__namerow { align-items: center; margin-top: calc(var(--ds-ui-space-8) * -1); }
  .ds-today__meta { align-items: center; margin-top: calc(var(--ds-ui-space-8) * -1); }
  .ds-today__link { color: var(--ds-ui-color-ink); overflow-wrap: anywhere; }
  .ds-today__reason { max-width: 44em; }
  .ds-today__step { max-width: 44em; }
  .ds-today__back { display: inline-flex; align-items: center; gap: var(--ds-ui-space-4); color: var(--ds-ui-color-ink); font-weight: var(--ds-ui-weight-semibold); text-decoration: none; min-height: var(--ds-ui-tap); }

  /* Pieces to show: one row of photographs as wide as fits; "Show all N" (a details, no script) opens the rest as a wrapped grid.
     Closed, rows after the first are zero high and clipped; open, they are ordinary rows. */
  .ds-today__more { display: flex; flex-direction: column; gap: var(--ds-ui-space-12); max-width: 44em; }
  .ds-today__pieces { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(var(--ds-ui-photo-96) + var(--ds-ui-space-24)), 1fr)); grid-template-rows: auto; grid-auto-rows: 0; gap: 0 var(--ds-ui-space-16); overflow: hidden; }
  .ds-today__pieces > a { color: inherit; text-decoration: none; min-width: 0; }
  .ds-today__more:has(details[open]) .ds-today__pieces { grid-auto-rows: auto; gap: var(--ds-ui-space-24) var(--ds-ui-space-16); }
  .ds-today__disclose > summary { cursor: pointer; list-style: none; width: fit-content; min-height: var(--ds-ui-tap); display: inline-flex; align-items: center; }
  .ds-today__disclose > summary::-webkit-details-marker { display: none; }
  .ds-today__disclose[open] > summary { font-size: 0; }
  .ds-today__disclose[open] > summary::after { content: "Show fewer"; font-size: var(--ds-ui-size-12); }

  /* The context strip: only the facts there are. */
  .ds-today__strip { display: flex; }
  .ds-today__cell { display: flex; flex-direction: column; gap: var(--ds-ui-space-4); flex: 1 1 0; min-width: 0; padding: var(--ds-ui-space-12) var(--ds-ui-space-16); }
  .ds-today__cell + .ds-today__cell { border-left: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); }

  /* Why: the evidence lines, quiet. */
  .ds-today__tick { display: inline-flex; color: var(--ds-ui-color-ok); }

  /* Call / Text / E-mail: phone only. */
  .ds-today__reach { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--ds-ui-space-8); }
  .ds-today__reach > .ds-button { min-height: var(--ds-ui-tap); }

  .ds-actbar .ds-menu > summary { min-height: var(--ds-ui-control-lg); min-width: var(--ds-ui-control-lg); }

  @media (max-width: 1099px) {
    .ds-today { grid-template-columns: var(--ds-ui-dim-side) minmax(0, 1fr); }
    .ds-today__person { padding: var(--ds-ui-space-24); }
    .ds-today__strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ds-today__cell:nth-child(n+3) { border-top: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); }
    .ds-today__cell + .ds-today__cell { border-left: 0; }
    .ds-today__cell:nth-child(even) { border-left: var(--ds-ui-dim-line) solid var(--ds-ui-color-line); }
  }

  /* Phone: the queue is one screen and the person the next (the server says which with data-view). */
  @media (max-width: 639px) {
    .ds-today { display: block; border: 0; background: none; }
    .ds-today__queue { border-right: 0; }
    .ds-today[data-view="person"] .ds-today__queue, .ds-today[data-view="queue"] .ds-today__person { display: none; }
    .ds-today__queuehead { padding-inline: 0; }
    .ds-today__tabs { padding-inline: 0; }
    .ds-today__person { padding: 0; }
    /* Closed: one swipeable row; open: the wrapped grid above. */
    .ds-today__more:not(:has(details[open])) .ds-today__pieces { display: flex; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--ds-ui-space-16); gap: var(--ds-ui-space-12); margin-inline: calc(var(--ds-ui-space-16) * -1); padding-inline: var(--ds-ui-space-16); }
    .ds-today__more:not(:has(details[open])) .ds-today__pieces > a { flex: 0 0 calc(var(--ds-ui-photo-96) + var(--ds-ui-space-40)); scroll-snap-align: start; }
  }
}
