/*
 * Mesurit components: the one stylesheet for the site, the admin and the
 * brand guide. Built only from the tokens in tokens.css; no colour, size or
 * radius is repeated here or anywhere else. The brand guide shows every
 * component with its states (public/brand-guide/index.html, Components).
 *
 * Classes only, no element resets, so it can sit next to any page style.
 * States that can be forced for the brand guide have an .is-* twin
 * (.is-hover, .is-focus, .is-disabled).
 */

/* ── Surfaces ───────────────────────────────────────────────── */

/* A dark surface: components inside switch to their light-on-dark look. */
.inverse {
  --color-focus: var(--color-focus-inverse);
  --color-bg: var(--mesurit-navy);
}

/* ── Eyebrow ────────────────────────────────────────────────── */

/* Small capitals above a heading: what the section is about. */
.eyebrow {
  display: block;
  margin-bottom: var(--space-3);
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--color-text);
}

.inverse .eyebrow {
  color: var(--color-accent);
}

/* ── Buttons and links ──────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 12px 22px;
  border: 0;
  border-radius: var(--radius-button);
  font: inherit;
  font-weight: var(--fw-semibold);
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 0.15s,
    box-shadow 0.15s,
    color 0.15s;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.btn-primary:hover,
.btn-primary.is-hover {
  background: var(--color-accent-hover);
}

.btn-secondary {
  background: transparent;
  color: var(--color-heading);
  box-shadow: inset 0 0 0 1.5px var(--color-heading);
}

.btn-secondary:hover,
.btn-secondary.is-hover {
  background: var(--color-heading);
  color: var(--color-text-inverse);
}

/* Quiet: an action that should not compete, such as Preview or Cancel. */
.btn-quiet {
  background: transparent;
  color: var(--color-heading);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-quiet:hover,
.btn-quiet.is-hover {
  background: var(--mesurit-line);
}

/* Danger: an action that throws something away. */
.btn-danger {
  background: transparent;
  color: var(--color-error);
  box-shadow: inset 0 0 0 1.5px var(--color-error);
}

.btn-danger:hover,
.btn-danger.is-hover {
  background: var(--color-error);
  color: var(--mesurit-white);
}

/* Small: for dense screens such as the admin and table rows. */
.btn-small {
  min-height: 36px;
  padding: 6px 14px;
  font-size: var(--fs-small);
}

.btn:focus-visible,
.btn.is-focus {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn-secondary:focus-visible,
.btn-secondary.is-focus {
  box-shadow:
    inset 0 0 0 1.5px var(--color-heading),
    var(--focus-ring);
}

.btn-danger:focus-visible,
.btn-danger.is-focus {
  box-shadow:
    inset 0 0 0 1.5px var(--color-error),
    var(--focus-ring);
}

.btn:disabled,
.btn.is-disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.inverse .btn-primary {
  color: var(--color-on-accent);
}

.inverse .btn-secondary {
  color: var(--color-text-inverse);
  box-shadow: inset 0 0 0 1.5px var(--color-border-inverse);
}

.inverse .btn-secondary:hover,
.inverse .btn-secondary.is-hover {
  background: var(--color-text-inverse);
  color: var(--color-heading);
}

/* On a yellow surface (on-accent) the primary button turns navy, so it does
   not disappear into the yellow. */
.on-accent .btn-primary {
  background: var(--color-heading);
  color: var(--color-text-inverse);
}

.on-accent .btn-primary:hover,
.on-accent .btn-primary.is-hover {
  background: var(--color-surface-inverse);
}

.link-arrow {
  font-weight: var(--fw-semibold);
  color: var(--color-heading);
  text-decoration: none;
  border-bottom: 2px solid var(--color-accent);
  padding-bottom: 1px;
}

.link-arrow::after {
  content: " →";
}

.inverse .link-arrow {
  color: var(--color-text-inverse);
}

.on-accent .link-arrow {
  border-bottom-color: var(--color-heading);
}

/* ── Cards ──────────────────────────────────────────────────── */

.card {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--space-6);
}

.card .icon {
  width: 44px;
  height: 44px;
  margin-bottom: var(--space-5);
}

.card h3 {
  margin-bottom: var(--space-3);
}

.card-dark {
  background: var(--color-surface-inverse);
  box-shadow: none;
  border: 1px solid var(--color-border-inverse);
}

.card-dark.no-border {
  border-color: transparent;
}

/* ── Labels ─────────────────────────────────────────────────── */

/* A status: what state something is in. Short, one or two words. */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
  font-weight: var(--fw-semibold);
  line-height: 1.5;
  white-space: nowrap;
  background: var(--mesurit-line);
  color: var(--color-text);
}

/* With .badge-dot the colour is also a shape, not only a colour. */
.badge-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-info {
  background: color-mix(in srgb, var(--mesurit-navy) 9%, var(--mesurit-white));
  color: var(--color-heading);
}

.badge-success {
  background: var(--color-success-soft);
  color: var(--color-success);
}

.badge-warning {
  background: var(--mesurit-yellow-soft);
  color: var(--color-heading);
}

.badge-warning.badge-dot::before {
  background: var(--mesurit-yellow-hover);
}

.badge-error {
  background: var(--color-error-soft);
  color: var(--color-error);
}

/* A tag: a value someone chose, such as a filter or a multiselect choice. */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 2px 4px 2px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-input);
  background: var(--color-surface);
  color: var(--color-heading);
  font-size: 0.8125rem;
  font-weight: var(--fw-semibold);
  line-height: 1.5;
}

.pill:not(:has(.pill-remove)) {
  padding-right: 10px;
}

.pill-remove {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.pill-remove:hover {
  background: var(--mesurit-line);
}

.pill-remove:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Attention needed: a yellow mark with an exclamation mark. The reason goes
   in a title and in visually hidden text. */
.alert-mark {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-size: 0.6875rem;
  font-weight: var(--fw-bold);
  line-height: 1;
}

/* Something AI does: a yellow label with a spark. */
.ai-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-size: 0.75rem;
  font-weight: var(--fw-bold);
  line-height: 1.5;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

.ai-label svg {
  width: 12px;
  height: 12px;
}

/* ── Fields ─────────────────────────────────────────────────── */

.field {
  position: relative;
  display: grid;
  gap: var(--space-2);
  align-content: start;
}

.field > label:not(.check, .radio, .switch),
.field-label {
  margin: 0;
  font-weight: var(--fw-semibold);
  color: var(--color-heading);
  font-size: var(--fs-small);
}

/* A required field gets an asterisk; an optional one may say so instead. */
.field .required {
  color: var(--color-error);
  margin-left: 2px;
  text-decoration: none;
}

/* Fields on navy: labels and hints turn light; the inputs keep their white
   surface. */
.inverse .field > label:not(.check, .radio, .switch),
.inverse .field-label {
  color: var(--color-text-inverse);
}

.inverse .field .hint,
.inverse .field .optional {
  color: var(--color-text-muted-inverse);
}

/* Red is too dark on navy; the required mark turns yellow there. */
.inverse .field .required {
  color: var(--color-accent);
}

.field .optional {
  font-weight: var(--fw-regular);
  color: var(--color-text-muted);
}

.field .hint {
  margin: 0;
  font-size: var(--fs-small);
  color: var(--color-text-muted);
}

/* A hint with a counter on the right, such as "120 / 160". */
.hint-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
}

.hint-row .count {
  flex: none;
  font-size: var(--fs-small);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.hint-row .count.is-over {
  color: var(--color-error);
  font-weight: var(--fw-semibold);
}

.input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: var(--radius-input);
  border: 1px solid var(--color-border-input);
  background: var(--color-surface);
  color: var(--color-heading);
  font: inherit;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.input::placeholder {
  color: var(--color-text-muted);
}

.input:hover,
.input.is-hover {
  border-color: var(--color-heading);
}

.input:focus-visible,
.input.is-focus {
  outline: none;
  border-color: var(--color-heading);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mesurit-navy) 18%, transparent);
}

.input:disabled,
.input.is-disabled {
  cursor: not-allowed;
  border-color: var(--mesurit-line);
  background: var(--mesurit-offwhite);
  color: var(--color-text-muted);
}

/* Read-only: shown, not editable, still selectable and sent with the form. */
.input[readonly] {
  border-style: dashed;
  background: var(--mesurit-offwhite);
}

textarea.input {
  min-height: 112px;
  resize: vertical;
}

select.input {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231B2A41' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 40px;
}

.field.has-error .input,
.field.has-error .input-group,
.field.has-error .combo-control {
  border-color: var(--color-error);
  box-shadow: inset 0 0 0 1px var(--color-error);
}

.field.is-valid .input,
.field.is-valid .input-group {
  border-color: var(--color-success);
}

/* The message sits in the gap below the field, so it never changes the
   height of the field. Keep it to one line. */
.field .error,
.field .success {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: flex;
  gap: var(--space-2);
  align-items: center;
  margin-top: 6px;
  font-size: var(--fs-small);
  line-height: 1.3;
  font-weight: var(--fw-semibold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.field .error {
  color: var(--color-error);
}

.field .success {
  color: var(--color-success);
}

.field .error svg,
.field .success svg {
  flex: none;
}

/* A field with a hint shows the error in place of the hint. */
.field.has-error .hint,
.field.has-error .hint-row {
  visibility: hidden;
}

.field:has(.hint) .error,
.field:has(.hint-row) .error {
  top: auto;
  bottom: 0;
}

.form-grid {
  display: grid;
  gap: var(--space-7) var(--space-5);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
}

/* ── Input groups: prefix, suffix, phone, search ────────────── */

/* The group is the box; the input inside has no border of its own. */
.input-group {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: 48px;
  border-radius: var(--radius-input);
  border: 1px solid var(--color-border-input);
  background: var(--color-surface);
  overflow: hidden;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.input-group:hover {
  border-color: var(--color-heading);
}

.input-group:focus-within {
  border-color: var(--color-heading);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mesurit-navy) 18%, transparent);
}

.input-group .input {
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.input-group .input:focus-visible {
  box-shadow: none;
}

/* Fixed text before or after the value, such as a unit. */
.input-addon {
  display: flex;
  align-items: center;
  flex: none;
  padding: 0 14px;
  background: var(--mesurit-offwhite);
  color: var(--color-text-muted);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-small);
}

.input-addon:first-child {
  border-right: 1px solid var(--mesurit-line);
}

.input-addon:last-child {
  border-left: 1px solid var(--mesurit-line);
}

/* A choice before the value, such as the country code of a phone number. */
select.input-addon {
  appearance: none;
  border: 0;
  border-right: 1px solid var(--mesurit-line);
  padding-right: 30px;
  color: var(--color-heading);
  font: inherit;
  font-weight: var(--fw-semibold);
  cursor: pointer;
  background: var(--mesurit-offwhite)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231B2A41' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E")
    right 8px center / 16px no-repeat;
}

select.input-addon:focus-visible {
  outline: none;
  background-color: var(--mesurit-line);
}

/* Numbers line up: digits of equal width, right-aligned. */
.input-number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* An icon inside the group, such as the magnifier of a search field. */
.input-icon {
  display: flex;
  align-items: center;
  flex: none;
  padding-left: 14px;
  color: var(--color-text-muted);
}

.input-icon + .input {
  padding-left: 10px;
}

.input-clear {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  font: inherit;
  font-size: 1.25rem;
  cursor: pointer;
}

.input-clear:hover {
  color: var(--color-heading);
}

.input-clear:focus-visible {
  outline: none;
  box-shadow: inset var(--focus-ring);
}

.input-group.is-disabled {
  border-color: var(--mesurit-line);
  background: var(--mesurit-offwhite);
}

/* ── Select with search, multiselect ────────────────────────── */

.combo {
  position: relative;
}

.combo-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  padding: 6px 40px 6px 10px;
  border-radius: var(--radius-input);
  border: 1px solid var(--color-border-input);
  background: var(--color-surface)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231B2A41' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E")
    right 12px center / 18px no-repeat;
  cursor: text;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.combo-control:hover {
  border-color: var(--color-heading);
}

.combo-control:focus-within,
.combo.is-open .combo-control {
  border-color: var(--color-heading);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mesurit-navy) 18%, transparent);
}

.combo-input {
  flex: 1 1 4ch;
  min-width: 4ch;
  min-height: 34px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--color-heading);
  font: inherit;
}

.combo-input:focus {
  outline: none;
}

.combo-input::placeholder {
  color: var(--color-text-muted);
}

.combo-list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 264px;
  overflow-y: auto;
  margin: 0;
  padding: var(--space-1);
  list-style: none;
  border-radius: var(--radius-input);
  border: 1px solid var(--color-line);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

/* In the brand guide a list can be shown open, in the flow of the page. */
.combo-list.is-static {
  position: static;
  margin-top: 6px;
}

.combo-option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--color-heading);
  font-size: var(--fs-small);
  cursor: pointer;
}

.combo-option:hover,
.combo-option.is-active {
  background: var(--mesurit-offwhite);
}

.combo-option[aria-selected="true"] {
  font-weight: var(--fw-semibold);
}

/* A tick for what is chosen: on the right in a single select... */
.combo-option[aria-selected="true"]::after {
  content: "";
  width: 16px;
  height: 16px;
  margin-left: auto;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231B2A41' stroke-width='2.5'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

/* ...and a checkbox on the left in a multiselect. */
.combo-multi .combo-option::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--color-border-input);
  border-radius: 5px;
  background: var(--color-surface);
}

.combo-multi .combo-option[aria-selected="true"]::before {
  border-color: var(--color-heading);
  background: var(--color-accent)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 104 104'%3E%3Cpath d='M22 52 L42 72 L82 32' stroke='%231B2A41' stroke-width='14' fill='none'/%3E%3C/svg%3E")
    center / 12px no-repeat;
}

.combo-multi .combo-option[aria-selected="true"]::after {
  content: none;
}

.combo-option[aria-disabled="true"] {
  cursor: not-allowed;
  color: var(--color-text-muted);
}

.combo-option[aria-disabled="true"]:hover {
  background: transparent;
}

.combo-empty {
  padding: 10px 12px;
  color: var(--color-text-muted);
  font-size: var(--fs-small);
}

/* ── Checkboxes and radio buttons ───────────────────────────── */

.check,
.radio {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  font-size: var(--fs-small);
  color: var(--color-text);
  cursor: pointer;
}

.check input,
.radio input,
.choice-card input {
  appearance: none;
  flex: none;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  border: 1.5px solid var(--color-border-input);
  background: var(--color-surface);
  cursor: pointer;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.check input,
.choice-card input[type="checkbox"] {
  border-radius: 5px;
}

.radio input,
.choice-card input[type="radio"] {
  border-radius: 50%;
}

.check input:hover,
.radio input:hover,
.check.is-hover input,
.radio.is-hover input {
  border-color: var(--color-heading);
}

.check input:checked,
.choice-card input[type="checkbox"]:checked {
  border-color: var(--color-heading);
  background: var(--color-accent)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 104 104'%3E%3Cpath d='M22 52 L42 72 L82 32' stroke='%231B2A41' stroke-width='14' fill='none'/%3E%3C/svg%3E")
    center / 14px no-repeat;
}

/* Half: some of the items below are chosen, such as "select all". */
.check input:indeterminate {
  border-color: var(--color-heading);
  background: var(--color-accent)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 104 104'%3E%3Cpath d='M28 52 H76' stroke='%231B2A41' stroke-width='14' fill='none'/%3E%3C/svg%3E")
    center / 14px no-repeat;
}

.radio input:checked,
.choice-card input[type="radio"]:checked {
  border-color: var(--color-heading);
  background: radial-gradient(circle, var(--color-heading) 0 4px, var(--color-accent) 4.5px);
}

.check input:focus-visible,
.radio input:focus-visible,
.check.is-focus input,
.radio.is-focus input {
  outline: none;
  box-shadow: var(--focus-ring);
}

.check:has(input:disabled),
.radio:has(input:disabled) {
  cursor: not-allowed;
  color: var(--color-text-muted);
}

.check input:disabled,
.radio input:disabled,
.choice-card input:disabled {
  cursor: not-allowed;
  border-color: var(--mesurit-line);
  background-color: var(--mesurit-offwhite);
}

.check input:disabled:checked,
.check input:disabled:indeterminate,
.radio input:disabled:checked {
  opacity: 0.45;
}

.check.has-error input,
.radio.has-error input,
.choices.has-error .check input,
.choices.has-error .radio input {
  border-color: var(--color-error);
  box-shadow: inset 0 0 0 1px var(--color-error);
}

.check .help,
.radio .help {
  display: block;
  color: var(--color-text-muted);
}

/* A group of checkboxes or radio buttons: one question, one legend. */
.choices {
  position: relative;
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.choices legend {
  padding: 0;
  margin-bottom: var(--space-3);
  font-weight: var(--fw-semibold);
  color: var(--color-heading);
  font-size: var(--fs-small);
}

.choices .error {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
  color: var(--color-error);
}

/* ── Choice cards ───────────────────────────────────────────── */

/* A radio button or checkbox as a whole card, for a few weighty choices. */
.choice-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: var(--space-4);
}

.choice-card {
  position: relative;
  display: grid;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-5) var(--space-4) 52px;
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border-input);
  /* The background is a property, so a picture inside can match it. */
  --choice-bg: var(--color-surface);
  background: var(--choice-bg);
  color: var(--color-text);
  font-size: var(--fs-small);
  cursor: pointer;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.choice-card input {
  position: absolute;
  top: calc(var(--space-4) + 1px);
  left: var(--space-5);
}

.choice-card strong {
  color: var(--color-heading);
  font-size: 1rem;
}

.choice-card:hover,
.choice-card.is-hover {
  border-color: var(--color-heading);
}

.choice-card:has(input:checked) {
  border-color: var(--color-heading);
  box-shadow: inset 0 0 0 1px var(--color-heading);
  --choice-bg: color-mix(in srgb, var(--mesurit-yellow-soft) 45%, var(--mesurit-white));
}

.choice-card:has(input:focus-visible) {
  box-shadow:
    inset 0 0 0 1px var(--color-heading),
    var(--focus-ring);
}

.choice-card:has(input:focus-visible) input {
  box-shadow: none;
}

.choice-card:has(input:disabled) {
  cursor: not-allowed;
  border-color: var(--mesurit-line);
  --choice-bg: var(--mesurit-offwhite);
  color: var(--color-text-muted);
}

.choice-card:has(input:disabled) strong {
  color: var(--color-text-muted);
}

/* With a picture: an icon of the 48 grid above the text, such as how a blind
   is mounted. The picture's fill turns yellow when the card is chosen, and
   what it draws in the background colour (--icon-bg: the outline that keeps
   a cord free of the slats, a hollow rod) takes the card's background. Large
   is for pictures with a thin line and much detail, such as the positions of
   the controls. */
.choice-card.has-picture {
  justify-items: center;
  align-content: start;
  text-align: center;
  padding: var(--space-5) var(--space-4) var(--space-4);
}

.choice-card.has-picture input {
  top: var(--space-4);
  left: var(--space-4);
}

.choice-card.has-picture svg {
  width: 96px;
  height: 96px;
  margin-bottom: var(--space-2);
  color: var(--color-heading);
  --icon-bg: var(--choice-bg);
}

.choice-card.has-picture.is-large svg {
  width: 128px;
  height: 128px;
}

.choice-card.has-picture:has(input:checked) svg {
  --icon-fill: var(--color-accent);
  --icon-fill-opacity: 1;
}

.choice-card.has-picture:has(input:disabled) svg {
  color: var(--color-text-muted);
}

/* ── Switch ─────────────────────────────────────────────────── */

/* For a setting that takes effect at once, without a save button. */
.switch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--fs-small);
  color: var(--color-text);
  cursor: pointer;
}

.switch input {
  appearance: none;
  position: relative;
  flex: none;
  width: 44px;
  height: 26px;
  margin: 0;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--color-border-input);
  background: var(--mesurit-line);
  cursor: pointer;
  transition:
    background-color 0.15s,
    border-color 0.15s;
}

.switch input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--mesurit-white);
  box-shadow: 0 1px 2px rgb(27 42 65 / 0.25);
  transition: transform 0.15s;
}

.switch input:checked {
  border-color: var(--color-heading);
  background: var(--color-heading);
}

.switch input:checked::after {
  transform: translateX(18px);
  background: var(--color-accent);
}

.switch input:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.switch:has(input:disabled) {
  cursor: not-allowed;
  color: var(--color-text-muted);
}

.switch input:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

/* ── Segmented control ──────────────────────────────────────── */

/* Two to four options side by side, one of them chosen. */
.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  margin: 0;
  border: 0;
  border-radius: var(--radius-button);
  background: var(--mesurit-line);
}

.segmented label {
  position: relative;
}

.segmented input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.segmented span {
  display: block;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
  color: var(--color-text);
  white-space: nowrap;
  transition:
    background-color 0.15s,
    color 0.15s;
}

.segmented label:hover span {
  color: var(--color-heading);
}

.segmented input:checked + span {
  background: var(--color-surface);
  color: var(--color-heading);
  box-shadow: 0 1px 2px rgb(27 42 65 / 0.12);
}

.segmented input:focus-visible + span {
  box-shadow: var(--focus-ring);
}

/* ── Tables ─────────────────────────────────────────────────── */

/* The wrapper scrolls sideways on narrow screens, so the page never does. */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-card);
  border: 1px solid var(--color-line);
  background: var(--color-surface);
}

/* On navy a table keeps its light surface, so its text stays dark. */
.inverse .table-wrap {
  border-color: transparent;
  color: var(--color-text);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-small);
}

.table th,
.table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--color-line);
  vertical-align: middle;
}

.table thead th {
  color: var(--color-heading);
  font-weight: var(--fw-semibold);
  background: var(--mesurit-offwhite);
  white-space: nowrap;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover td {
  background: color-mix(in srgb, var(--mesurit-offwhite) 60%, var(--mesurit-white));
}

.table tbody tr.is-selected td {
  background: color-mix(in srgb, var(--mesurit-yellow-soft) 45%, var(--mesurit-white));
}

/* Numbers: right-aligned, digits of equal width. */
.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* The column with a select-all checkbox. */
.table .select {
  width: 1%;
  padding-right: 0;
}

.table .select .check {
  gap: 0;
}

/* The last column with actions, aligned to the right. */
.table .actions {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}

/* A sortable column: the whole heading is a button. */
.sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: -4px -6px;
  padding: 4px 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.sort::after {
  content: "";
  width: 10px;
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 14' fill='%235D6A7E'%3E%3Cpath d='M5 0l4 5H1zM5 14l4-5H1z'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

[aria-sort="ascending"] .sort::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 14' fill='%231B2A41'%3E%3Cpath d='M5 0l4 5H1z'/%3E%3C/svg%3E");
}

[aria-sort="descending"] .sort::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 14' fill='%231B2A41'%3E%3Cpath d='M5 14l4-5H1z'/%3E%3C/svg%3E");
}

.sort:hover {
  background: var(--mesurit-line);
}

.sort:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* No rows: say so, and offer the next step. */
.table-empty {
  padding: var(--space-7) var(--space-4) !important;
  text-align: center !important;
  color: var(--color-text-muted);
}

/* ── Messages ───────────────────────────────────────────────── */

/* A message in the page, next to what it is about. */
.alert {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-button);
  font-size: var(--fs-small);
  line-height: 1.45;
  border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
}

.alert > svg {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

.alert strong {
  display: block;
}

.alert p,
.alert ul {
  margin: 0;
}

.alert ul {
  padding-left: 1.25rem;
  margin-top: var(--space-1);
}

.alert a {
  color: inherit;
  font-weight: var(--fw-semibold);
}

.alert-info {
  background: color-mix(in srgb, var(--mesurit-navy) 7%, var(--mesurit-white));
  color: var(--color-heading);
}

.alert-success {
  background: var(--color-success-soft);
  color: var(--color-success);
}

.alert-warning {
  background: var(--mesurit-yellow-soft);
  color: var(--color-heading);
  border-color: color-mix(in srgb, var(--mesurit-yellow-hover) 60%, transparent);
}

.alert-error {
  background: var(--color-error-soft);
  color: var(--color-error);
}

/* ── Tabs ───────────────────────────────────────────────────── */

/* Views of one thing, side by side. As links (aria-current) between
   pages, or as buttons (role="tab", aria-selected) within a page. */
.tabs {
  display: flex;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
  /* The baseline is drawn inside, so the chosen line can cover it without
     overflowing: the row scrolls sideways on narrow screens, never down. */
  box-shadow: inset 0 -1px 0 var(--color-line);
  overflow-x: auto;
  overflow-y: hidden;
}

.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-3);
  border: 0;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: var(--color-text-muted);
  font: inherit;
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s;
}

.tab:hover,
.tab.is-hover {
  color: var(--color-heading);
  background: color-mix(in srgb, var(--mesurit-line) 55%, transparent);
}

/* The chosen tab: a navy line on the baseline, like a ruler's edge. */
.tab[aria-current="page"],
.tab[aria-selected="true"] {
  color: var(--color-heading);
}

.tab[aria-current="page"]::after,
.tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 2px 2px 0 0;
  background: var(--color-heading);
}

.tab:focus-visible,
.tab.is-focus {
  outline: none;
  color: var(--color-heading);
  box-shadow: inset 0 0 0 2px var(--color-focus);
}

.tab:disabled,
.tab[aria-disabled="true"] {
  cursor: not-allowed;
  color: color-mix(in srgb, var(--color-text-muted) 55%, transparent);
}

/* A count in a tab: how many items the view holds. */
.tab-count {
  min-width: 20px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--mesurit-line);
  color: var(--color-text);
  font-size: 0.75rem;
  line-height: 20px;
  text-align: center;
}

.tab[aria-current="page"] .tab-count,
.tab[aria-selected="true"] .tab-count {
  background: var(--color-heading);
  color: var(--color-text-inverse);
}

.tab-panel {
  padding-top: var(--space-5);
}

/* ── Breadcrumb ─────────────────────────────────────────────── */

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-small);
  color: var(--color-text-muted);
}

.breadcrumb li {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.breadcrumb li + li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-top: 1.5px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.6;
}

.breadcrumb a {
  color: var(--color-text);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--color-heading);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.breadcrumb [aria-current="page"] {
  color: var(--color-heading);
  font-weight: var(--fw-semibold);
}

/* ── Main navigation ──────────────────────────────────────────── */

/* The bar on the left of the admin: the lockup, links in groups that fold,
   and a foot with the user. Navy but quiet: light weights, soft washes of
   off-white instead of solid colours, yellow only as a dot and a warning.
   Every link has an icon. Collapsed (.is-collapsed) it is a narrow strip of
   icons; the labels stay for screen readers and show as a tooltip. The page
   places the bar (fixed, sliding in on a phone); this is how it looks. */
.mainnav {
  --mainnav-text: color-mix(in srgb, var(--mesurit-offwhite) 72%, transparent);
  --mainnav-heading: color-mix(in srgb, var(--mesurit-offwhite) 82%, transparent);
  --mainnav-quiet: var(--color-text-muted-inverse);
  --mainnav-wash: color-mix(in srgb, var(--mesurit-offwhite) 6%, transparent);
  --mainnav-wash-strong: color-mix(in srgb, var(--mesurit-offwhite) 10%, transparent);
  --mainnav-line: color-mix(in srgb, var(--mesurit-offwhite) 10%, transparent);
  display: flex;
  flex-direction: column;
  width: 14.5rem;
  background: var(--color-bg-inverse);
  color: var(--mainnav-text);
}

.mainnav a {
  color: inherit;
  text-decoration: none;
}

.mainnav :focus-visible {
  outline: 1px solid var(--color-focus-inverse);
  outline-offset: 1px;
}

.mainnav-brand {
  display: block;
  padding: 1.75rem var(--space-5) var(--space-5);
}

.mainnav-brand img {
  display: block;
  width: 7.75rem;
  height: auto;
}

.mainnav-brand .mainnav-mark {
  display: none;
  width: 2rem;
  height: 2rem;
}

.mainnav-brand span {
  display: block;
  margin-top: var(--space-3);
  font-size: 0.6875rem;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mainnav-quiet);
}

.mainnav-links {
  flex: 1;
  overflow-y: auto;
  padding: 0 0.875rem var(--space-4);
}

.mainnav-group + .mainnav-group {
  margin-top: var(--space-5);
}

/* A group heading: a fold button, clearly above the links it holds. */
.mainnav-heading {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  padding: 0.375rem 0.625rem;
  font: inherit;
  font-size: 0.6875rem;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: left;
  color: var(--mainnav-heading);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.mainnav-heading:hover {
  background: var(--mainnav-wash);
  color: var(--mesurit-offwhite);
}

.mainnav-heading-label {
  flex: 1;
}

.mainnav-chevron {
  width: 0.4375rem;
  height: 0.4375rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.15s ease;
}

.mainnav-heading[aria-expanded="false"] .mainnav-chevron {
  transform: rotate(-45deg);
}

.mainnav-links ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1px;
}

/* The links of a group step in, along a fine line, like ticks on a ruler. */
.mainnav-group.is-titled ul {
  margin: var(--space-1) 0 0 1.0625rem;
  padding-left: var(--space-2);
  border-left: 1px solid var(--mainnav-line);
}

.mainnav-group ul[hidden] {
  display: none;
}

.mainnav-links a {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0.4375rem 0.625rem;
  border-radius: 8px;
  font-size: var(--fs-small);
  font-weight: var(--fw-regular);
  letter-spacing: 0.01em;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.mainnav-links a:hover,
.mainnav-links a.is-hover {
  background: var(--mainnav-wash);
  color: var(--mesurit-offwhite);
}

.mainnav-links a[aria-current="page"] {
  background: var(--mainnav-wash-strong);
  color: var(--mesurit-offwhite);
  font-weight: var(--fw-semibold);
}

/* A small icon before each link, quiet until the link is current. */
.mainnav-icon {
  flex: none;
  width: 1.0625rem;
  height: 1.0625rem;
  opacity: 0.75;
}

.mainnav-links a[aria-current="page"] .mainnav-icon,
.mainnav-links a:hover .mainnav-icon,
.mainnav-links a.is-hover .mainnav-icon {
  opacity: 1;
}

.mainnav-label {
  flex: 1;
  min-width: 0;
}

/* The current page gets a small yellow dot, unless a warning sits there. */
.mainnav-links a[aria-current="page"]:not(:has(.alert-mark))::after,
.mainnav-dot {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-accent);
}

/* Collapse and expand the bar. */
.mainnav-collapse {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0 0.875rem var(--space-2);
  padding: 0.4375rem 0.625rem;
  font: inherit;
  font-size: var(--fs-small);
  text-align: left;
  color: var(--mainnav-quiet);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.mainnav-collapse:hover {
  background: var(--mainnav-wash);
  color: var(--mesurit-offwhite);
}

.mainnav-collapse svg {
  flex: none;
  width: 1.0625rem;
  height: 1.0625rem;
}

/* The account: one row at the foot with who you are and in which
   organisation. It opens the account menu upward, over the links: the
   organisations with your role in each, the language and signing out. */
.mainnav-account {
  position: relative;
  margin: 0 0.875rem var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--mainnav-line);
}

.mainnav-account-button {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2) 0.625rem;
  font: inherit;
  text-align: left;
  color: var(--mainnav-text);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.mainnav-account-button:hover,
.mainnav-account-button[aria-expanded="true"] {
  background: var(--mainnav-wash);
  color: var(--mesurit-offwhite);
}

.mainnav-account-button .avatar {
  width: 28px;
  height: 28px;
  font-size: 0.6875rem;
}

.mainnav-account-text {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}

.mainnav-account-name,
.mainnav-account-meta {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mainnav-account-name {
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
  color: var(--mesurit-offwhite);
}

.mainnav-account-meta {
  font-size: 0.75rem;
  color: var(--mainnav-quiet);
}

.mainnav-account-button > svg {
  flex: none;
  width: 1rem;
  height: 1rem;
  opacity: 0.75;
}

/* Wider than the bar, so organisation names fit. */
.mainnav-account .menu-list {
  top: auto;
  bottom: calc(100% + 6px);
  left: 0;
  right: auto;
  width: 17rem;
}

/* A link in the menu keeps the menu's colour, not the bar's. */
.mainnav-account a.menu-item {
  color: var(--color-heading);
}

/* Collapsed: the foot steps aside, the account keeps its initials. */
.mainnav.is-collapsed .mainnav-account {
  margin: 0 0.625rem var(--space-4);
}

.mainnav.is-collapsed .mainnav-account-button {
  justify-content: center;
  padding: var(--space-2) 0;
}

.mainnav.is-collapsed .mainnav-account-text,
.mainnav.is-collapsed .mainnav-account-button > svg {
  display: none;
}

/* Collapsed: the mark and the icons. Group headings and the foot step aside,
   and folded groups open, so every link is there. */
.mainnav.is-collapsed {
  width: 4.25rem;
}

.mainnav.is-collapsed .mainnav-brand {
  padding: 1.5rem 0 var(--space-5);
  text-align: center;
}

.mainnav.is-collapsed .mainnav-lockup,
.mainnav.is-collapsed .mainnav-brand span,
.mainnav.is-collapsed .mainnav-heading {
  display: none;
}

.mainnav.is-collapsed .mainnav-brand .mainnav-mark {
  display: inline-block;
}

.mainnav.is-collapsed .mainnav-links {
  padding: 0 0.625rem var(--space-4);
}

.mainnav.is-collapsed .mainnav-group + .mainnav-group {
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--mainnav-line);
}

.mainnav.is-collapsed .mainnav-group ul,
.mainnav.is-collapsed .mainnav-group ul[hidden] {
  display: grid;
  margin: 0;
  padding: 0;
  border: 0;
}

.mainnav.is-collapsed .mainnav-links a,
.mainnav.is-collapsed .mainnav-collapse {
  justify-content: center;
  padding: 0.625rem 0;
}

.mainnav.is-collapsed .mainnav-collapse {
  margin: 0 0.625rem var(--space-5);
}

.mainnav.is-collapsed .mainnav-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The dot and the warning sit in the corner of the icon. */
.mainnav.is-collapsed .mainnav-links a[aria-current="page"]:not(:has(.alert-mark))::after,
.mainnav.is-collapsed .mainnav-links a .alert-mark {
  position: absolute;
  top: 0.3rem;
  right: 0.45rem;
}

.mainnav.is-collapsed .mainnav-links a .alert-mark {
  transform: scale(0.8);
}

@media (prefers-reduced-motion: reduce) {
  .mainnav-links a,
  .mainnav-heading,
  .mainnav-chevron,
  .mainnav-collapse {
    transition: none;
  }
}

/* ── Secondary menu ─────────────────────────────────────────── */

/* The links within one part of a screen, in a column of its own beside the
   content: the blocks in the studio, later the settings of a page. No frame:
   the column it sits in is the box. Groups with a small heading. Hover is a
   light wash; the current link has the wash, a yellow bar on its left and
   heavier text. */
.subnav {
  display: grid;
  align-content: start;
  gap: var(--space-5);
}

.subnav-group {
  display: grid;
  gap: var(--space-2);
}

.subnav-title {
  margin: 0;
  padding: 0 var(--space-3);
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.subnav ul {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.subnav a {
  display: block;
  position: relative;
  padding: 6px var(--space-3);
  border-radius: var(--radius-button);
  color: var(--color-text);
  font-size: var(--fs-small);
  text-decoration: none;
}

.subnav a:hover,
.subnav a.is-hover {
  background: var(--mesurit-offwhite);
  color: var(--color-heading);
}

.subnav a[aria-current] {
  background: var(--mesurit-offwhite);
  color: var(--color-heading);
  font-weight: var(--fw-semibold);
}

.subnav a[aria-current]::before {
  content: "";
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: 0;
  width: 3px;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
}

.subnav a:focus-visible,
.subnav a.is-focus {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* ── Pagination ─────────────────────────────────────────────── */

.pagination ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.page-link {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-button);
  color: var(--color-heading);
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}

a.page-link:hover {
  background: var(--mesurit-line);
}

a.page-link:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.page-link[aria-current="page"] {
  background: var(--color-heading);
  color: var(--color-text-inverse);
}

/* Previous on the first page, next on the last: shown, not clickable. */
.page-link[aria-disabled="true"] {
  color: color-mix(in srgb, var(--color-text-muted) 55%, transparent);
  cursor: not-allowed;
}

.page-gap {
  min-width: 24px;
  text-align: center;
  color: var(--color-text-muted);
}

.pagination-summary {
  font-size: var(--fs-small);
  color: var(--color-text-muted);
}

/* ── Menu ───────────────────────────────────────────────────── */

/* A list of actions behind a button, such as "⋯" in a table row. */
.menu {
  position: relative;
  display: inline-block;
}

.menu-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-button);
  background: transparent;
  color: var(--color-heading);
  font: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.menu-button:hover,
.menu-button[aria-expanded="true"] {
  background: var(--mesurit-line);
}

.menu-button:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.menu-list {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  margin: 0;
  padding: var(--space-1);
  list-style: none;
  border-radius: var(--radius-input);
  border: 1px solid var(--color-line);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.menu-list.is-static {
  position: static;
  display: inline-block;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-heading);
  font: inherit;
  font-size: var(--fs-small);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.menu-item:hover,
.menu-item:focus-visible,
.menu-item.is-active {
  outline: none;
  background: var(--mesurit-offwhite);
}

.menu-item.is-danger {
  color: var(--color-error);
}

.menu-item.is-danger:hover,
.menu-item.is-danger:focus-visible {
  background: var(--color-error-soft);
}

.menu-item:disabled,
.menu-item[aria-disabled="true"] {
  cursor: not-allowed;
  color: var(--color-text-muted);
  background: transparent;
}

.menu-separator {
  height: 1px;
  margin: var(--space-1) 0;
  background: var(--color-line);
}

/* An icon before an item, and quiet text after it, such as a role. */
.menu-item > svg {
  flex: none;
  width: 1rem;
  height: 1rem;
}

.menu-item-meta {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* One choice of several: a check marks the current one. */
.menu-item[role="menuitemradio"] > svg {
  visibility: hidden;
}

.menu-item[aria-checked="true"] {
  font-weight: var(--fw-semibold);
}

.menu-item[aria-checked="true"] > svg {
  visibility: visible;
}

/* A small heading over a group of items. */
.menu-heading {
  margin: 0;
  padding: var(--space-2) 12px var(--space-1);
  font-size: 0.6875rem;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* A line of text that is not an action, such as the e-mail address. */
.menu-note {
  margin: 0;
  padding: var(--space-2) 12px var(--space-1);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* A setting inside the menu: a label with a small control, such as the
   language as a segmented control. */
.menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 6px 4px 6px 12px;
  font-size: var(--fs-small);
  color: var(--color-heading);
}

.menu-row .segmented span {
  padding: 4px 10px;
  font-size: 0.8125rem;
}

/* ── Dialog ─────────────────────────────────────────────────── */

/* A question that needs an answer before going on, on a native <dialog>. */
.dialog {
  width: min(100% - 2 * var(--space-4), 480px);
  max-height: calc(100% - 2 * var(--space-6));
  padding: 0;
  border: 0;
  border-radius: var(--radius-card);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 24px 64px rgb(27 42 65 / 0.24);
}

.dialog::backdrop {
  background: color-mix(in srgb, var(--mesurit-navy) 45%, transparent);
}

/* In the brand guide a dialog can be shown in the flow of the page. */
.dialog.is-static {
  position: static;
  display: block;
  margin: 0;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-line);
}

.dialog-body {
  padding: var(--space-6) var(--space-6) var(--space-5);
}

.dialog-body h2,
.dialog-body h3 {
  margin: 0 0 var(--space-3);
  font-size: var(--fs-h4);
  color: var(--color-heading);
}

.dialog-body p {
  margin: 0;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-line);
  background: var(--mesurit-offwhite);
  border-radius: 0 0 var(--radius-card) var(--radius-card);
}

/* ── Sheet ──────────────────────────────────────────────────── */

/* A panel that slides in over the page and leaves the page in view: more
   room than a dialog, without going to a page of its own. On a native
   <dialog>: showModal() dims the page, show() leaves it usable.
   .sheet-side comes in from the right, .sheet-bottom from below. */
.sheet {
  position: fixed;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 24px 64px rgb(27 42 65 / 0.24);
}

/* Only when open: a closed <dialog> has to stay display: none. */
.sheet[open],
.sheet.is-static {
  display: flex;
  flex-direction: column;
}

/* The parts may sit in a <form method="dialog">, so a button closes it. */
.sheet > form {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.sheet::backdrop {
  background: color-mix(in srgb, var(--mesurit-navy) 45%, transparent);
  opacity: 0;
}

.sheet[open]::backdrop {
  opacity: 1;
}

/* From the right, the full height. --sheet-size sets another width. A
   strip of the page stays in view, also on a phone. */
.sheet-side {
  inset: 0 0 0 auto;
  width: min(100% - var(--space-6), var(--sheet-size, 480px));
  height: 100%;
  border-radius: var(--radius-card) 0 0 var(--radius-card);
  transform: translateX(100%);
}

/* From below, as high as its content, up to most of the screen. On a wide
   screen it is centred. --sheet-size sets another width. */
.sheet-bottom {
  inset: auto 0 0;
  width: min(100%, var(--sheet-size, 640px));
  max-height: min(85%, 100% - var(--space-7));
  margin-inline: auto;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  transform: translateY(100%);
}

.sheet-side[open],
.sheet-bottom[open] {
  transform: none;
}

@media (prefers-reduced-motion: no-preference) {
  .sheet {
    transition:
      transform 0.24s ease-out,
      display 0.24s allow-discrete,
      overlay 0.24s allow-discrete;
  }

  .sheet::backdrop {
    transition:
      opacity 0.24s ease-out,
      display 0.24s allow-discrete,
      overlay 0.24s allow-discrete;
  }

  @starting-style {
    .sheet-side[open] {
      transform: translateX(100%);
    }

    .sheet-bottom[open] {
      transform: translateY(100%);
    }

    .sheet[open]::backdrop {
      opacity: 0;
    }
  }
}

/* In the brand guide a sheet can be shown in the flow of the page. */
.sheet.is-static {
  position: static;
  width: auto;
  height: auto;
  max-height: none;
  margin: 0;
  border: 1px solid var(--color-line);
  box-shadow: var(--shadow-card);
  transform: none;
  transition: none;
}

/* The grip on a bottom sheet: it shows the sheet can be pulled down. */
.sheet-handle {
  flex: none;
  width: 40px;
  height: 4px;
  margin: var(--space-3) auto 0;
  border-radius: var(--radius-pill);
  background: var(--color-border-input);
}

.sheet-header {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-4) var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-line);
}

.sheet-header h2,
.sheet-header h3,
.sheet-header h4 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: var(--fs-h4);
  color: var(--color-heading);
}

.sheet-close {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-button);
  background: transparent;
  color: var(--color-heading);
  cursor: pointer;
}

.sheet-close svg {
  width: 1.125rem;
  height: 1.125rem;
}

.sheet-close:hover {
  background: var(--mesurit-line);
}

.sheet-close:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* The body scrolls; the header and the actions stay in place. */
.sheet-body {
  flex: 1;
  min-height: 0;
  padding: var(--space-5);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sheet-body > :first-child {
  margin-top: 0;
}

.sheet-body > :last-child {
  margin-bottom: 0;
}

.sheet-actions {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--color-line);
  background: var(--mesurit-offwhite);
}

/* ── Toast ──────────────────────────────────────────────────── */

/* A short confirmation that comes and goes, bottom right. The region
   holds them; each toast is one line with an optional action. */
.toast-region {
  position: fixed;
  z-index: 60;
  right: var(--space-5);
  bottom: var(--space-5);
  display: grid;
  gap: var(--space-3);
  width: min(100% - 2 * var(--space-5), 380px);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4);
  border-radius: var(--radius-button);
  background: var(--color-bg-inverse);
  color: var(--color-text-inverse);
  font-size: var(--fs-small);
  box-shadow: 0 12px 32px rgb(27 42 65 / 0.24);
}

.toast > svg {
  flex: none;
  width: 20px;
  height: 20px;
}

.toast-success > svg {
  color: var(--mesurit-success-soft);
}

.toast-error {
  background: var(--color-error);
}

.toast p {
  flex: 1;
  margin: 0;
}

.toast-action {
  border: 0;
  padding: 6px 8px;
  border-radius: 6px;
  background: transparent;
  color: var(--color-accent);
  font: inherit;
  font-weight: var(--fw-semibold);
  cursor: pointer;
}

.toast-error .toast-action {
  color: var(--color-text-inverse);
  text-decoration: underline;
}

.toast-close {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
}

.toast-action:focus-visible,
.toast-close:focus-visible {
  outline: 2px solid var(--color-focus-inverse);
  outline-offset: 1px;
}

/* ── Tooltip ────────────────────────────────────────────────── */

/* A short explanation on hover and on keyboard focus. Never the only place
   for information someone needs. */
.tooltip {
  position: relative;
  display: inline-flex;
}

.tooltip-text {
  position: absolute;
  z-index: 40;
  bottom: calc(100% + 12px);
  left: 50%;
  width: max-content;
  max-width: 240px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--color-bg-inverse);
  color: var(--color-text-inverse);
  font-size: 0.8125rem;
  font-weight: var(--fw-regular);
  line-height: 1.4;
  text-align: center;
  transform: translateX(-50%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s;
}

.tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  border: 5px solid transparent;
  border-top-color: var(--color-bg-inverse);
  transform: translateX(-50%);
}

.tooltip:hover .tooltip-text,
.tooltip:focus-within .tooltip-text,
.tooltip.is-open .tooltip-text {
  opacity: 1;
  visibility: visible;
}

/* A small round help button that carries a tooltip. */
.help-button {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1.5px solid var(--color-border-input);
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-heading);
  font: inherit;
  font-size: 0.75rem;
  font-weight: var(--fw-bold);
  line-height: 1;
  cursor: help;
}

.help-button:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* ── Loading ────────────────────────────────────────────────── */

/* A tape measure: a navy case with a yellow reel that turns. The ticks on
   the reel make the turning visible, like a tape being wound in. */
.spinner {
  --size: 20px;
  position: relative;
  display: inline-block;
  flex: none;
  width: var(--size);
  height: var(--size);
  border-radius: 28%;
  background: var(--mesurit-navy);
  vertical-align: middle;
}

/* The reel: yellow, with navy ticks round the rim. */
.spinner::before {
  content: "";
  position: absolute;
  /* 15% leaves a reel of a whole, even number of pixels at 20 and 40 px, so
     its centre is on the pixel grid and it turns without wobbling. */
  inset: 15%;
  border-radius: 50%;
  /* A smooth yellow rim, with the ticks in a band just inside it. */
  background:
    radial-gradient(circle closest-side, var(--mesurit-yellow) 0 50%, transparent 51% 78%, var(--mesurit-yellow) 79%),
    repeating-conic-gradient(var(--mesurit-navy) 0 9deg, var(--mesurit-yellow) 9deg 30deg);
  animation: spin 1.1s linear infinite;
}

/* The axle in the middle. */
.spinner::after {
  content: "";
  position: absolute;
  inset: 42%;
  border-radius: 50%;
  background: var(--mesurit-navy);
}

.spinner-large {
  --size: 40px;
}

/* A button that is busy keeps its width and shows a spinner. */
.btn.is-busy {
  cursor: progress;
}

/* A busy button stays at full strength while the form around it waits. */
.btn.is-busy:disabled {
  opacity: 1;
}

/* In a button the case goes: only the turning reel is left, larger, as a
   ring of navy ticks around its axle. */
.btn .spinner {
  --size: 22px;
  background: none;
}

.btn .spinner::before {
  inset: 0;
  background: repeating-conic-gradient(currentColor 0 10deg, transparent 10deg 30deg);
  -webkit-mask: radial-gradient(circle closest-side, transparent 0 48%, #000 50% 98%, transparent 100%);
  mask: radial-gradient(circle closest-side, transparent 0 48%, #000 50% 98%, transparent 100%);
}

.btn .spinner::after {
  inset: 40%;
  background: currentColor;
}

/* Grey blocks in the shape of what is coming. */
.skeleton {
  display: block;
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(
      90deg,
      transparent 0,
      color-mix(in srgb, var(--mesurit-white) 70%, transparent) 50%,
      transparent 100%
    )
    0 0 / 200% 100% no-repeat,
    var(--mesurit-line);
  animation: shimmer 1.4s ease-in-out infinite;
}

.skeleton-title {
  height: 22px;
  width: 60%;
}

.skeleton-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  from {
    background-position: 150% 0, 0 0;
  }
  to {
    background-position: -50% 0, 0 0;
  }
}

/* ── Progress ───────────────────────────────────────────────── */

/* A measuring tape pulled out of its case: the case on the left, the
   yellow tape with ticks as long as the progress, a hook at its end. */
.progress {
  --value: 0%;
  --height: 20px;
  --case: calc(var(--height) + 2px);
  --tick: var(--mesurit-navy);
  position: relative;
  display: block;
  height: var(--height);
  /* The track the tape runs along. */
  background: linear-gradient(var(--mesurit-line) 0 0) left center / 100% 4px no-repeat;
  border-radius: 2px;
}

/* The tape: ticks every few pixels, a longer one every five. */
.progress::before {
  content: "";
  position: absolute;
  top: 18%;
  bottom: 18%;
  left: 0;
  width: max(var(--case), var(--value));
  border-right: 2px solid var(--mesurit-navy);
  background:
    repeating-linear-gradient(to right, var(--tick) 0 1px, transparent 1px 30px) top left / 100% 60% no-repeat,
    repeating-linear-gradient(to right, var(--tick) 0 1px, transparent 1px 6px) top left / 100% 30% no-repeat,
    var(--mesurit-yellow);
  transition: width 0.3s ease;
}

/* The case. */
.progress::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: var(--case);
  height: var(--case);
  border-radius: 28%;
  background: radial-gradient(circle, var(--mesurit-yellow) 0 18%, var(--mesurit-navy) 19%);
  transform: translateY(-50%);
}

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-2);
  font-size: var(--fs-small);
  color: var(--color-heading);
  font-weight: var(--fw-semibold);
}

.progress-label span:last-child {
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
}

/* Not known how long: the tape is pulled out and wound in again. */
.progress.is-indeterminate::before {
  animation: tape-measure 1.8s ease-in-out infinite;
}

@keyframes tape-measure {
  0%,
  100% {
    width: var(--case);
  }
  50% {
    width: 85%;
  }
}

/* ── File upload ────────────────────────────────────────────── */

.dropzone {
  position: relative;
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  padding: var(--space-6) var(--space-5);
  border: 1.5px dashed var(--color-border-input);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--fs-small);
  text-align: center;
  transition:
    border-color 0.15s,
    background-color 0.15s;
}

.dropzone > svg {
  width: 28px;
  height: 28px;
  color: var(--color-heading);
}

.dropzone strong {
  color: var(--color-heading);
}

/* The real file input covers the zone, so a click or a drop reaches it. */
.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone:hover,
.dropzone.is-hover {
  border-color: var(--color-heading);
}

.dropzone:focus-within {
  border-color: var(--color-heading);
  box-shadow: var(--focus-ring);
}

/* A file is dragged over the zone. */
.dropzone.is-dragover {
  border-style: solid;
  border-color: var(--color-heading);
  background: color-mix(in srgb, var(--mesurit-yellow-soft) 50%, var(--mesurit-white));
}

.dropzone.has-error {
  border-color: var(--color-error);
}

.file-list {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
}

.file-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-input);
  background: var(--color-surface);
  font-size: var(--fs-small);
}

.file-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-heading);
}

.file-item .file-meta {
  color: var(--color-text-muted);
}

.file-item .progress {
  --height: 12px;
  margin-top: 6px;
}

.file-item.has-error {
  border-color: var(--color-error);
  background: var(--color-error-soft);
}

.file-item.has-error .file-meta {
  color: var(--color-error);
  font-weight: var(--fw-semibold);
}

/* ── Avatar ─────────────────────────────────────────────────── */

/* Initials in a circle, for people: team members, "by Bjorn". A photo can
   take its place later. */
.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-heading);
  color: var(--color-text-inverse);
  font-size: 0.75rem;
  font-weight: var(--fw-bold);
  letter-spacing: 0.02em;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-small {
  width: 24px;
  height: 24px;
  font-size: 0.625rem;
}

.avatar-large {
  width: 48px;
  height: 48px;
  font-size: 1rem;
}

.avatar-yellow {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

/* Overlapping avatars for a group, with a white ring between them. */
.avatar-group {
  display: inline-flex;
}

.avatar-group .avatar {
  box-shadow: 0 0 0 2px var(--color-surface);
}

.avatar-group .avatar + .avatar {
  margin-left: -8px;
}

/* A person: avatar, name and a second line. */
.person {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--fs-small);
}

.person-name {
  display: block;
  color: var(--color-heading);
  font-weight: var(--fw-semibold);
}

.person-meta {
  display: block;
  color: var(--color-text-muted);
}

/* ── Empty state ────────────────────────────────────────────── */

/* An invitation, not an apology: what will be here, and the first step. */
.empty-state {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  padding: var(--space-8) var(--space-5);
  border: 1.5px dashed var(--color-line);
  border-radius: var(--radius-card);
  text-align: center;
}

.empty-state > svg {
  width: 36px;
  height: 36px;
  color: var(--color-heading);
}

.empty-state h3,
.empty-state h4 {
  margin: 0;
  font-size: var(--fs-h4);
  color: var(--color-heading);
}

.empty-state p {
  margin: 0;
  max-width: 44ch;
  color: var(--color-text-muted);
}

.empty-state .btn {
  margin-top: var(--space-2);
}

/* ── Page blocks ────────────────────────────────────────────── */

.faq {
  display: grid;
  gap: var(--space-3);
}

.faq details {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--color-line);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5);
  cursor: pointer;
  list-style: none;
  font-weight: var(--fw-semibold);
  color: var(--color-heading);
  border-radius: var(--radius-card);
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--mesurit-offwhite)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231B2A41' stroke-width='2'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E")
    center / 16px no-repeat;
  transition: transform 0.2s;
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq details p {
  padding: 0 var(--space-5) var(--space-5);
  max-width: var(--measure);
}

.statement {
  background: var(--color-accent);
  color: var(--color-on-accent);
  border-radius: var(--radius-card);
  padding: var(--space-9) var(--space-7);
}

.statement p {
  font-size: var(--fs-h1);
  line-height: var(--lh-tight);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-heading);
  max-width: 14ch;
}

/* A new line in the text is a line of its own; one that does not fit breaks
   into parts of about the same length. */
.statement-line {
  display: block;
  text-wrap: balance;
}

/* On a phone the surface keeps less room at its sides, so a line of the
   statement fits more often. */
@media (max-width: 640px) {
  .statement {
    padding: var(--space-8) var(--space-5);
  }
}

.statement .eyebrow {
  color: var(--color-on-accent);
}

/* On navy: white text, the eyebrow in yellow as everywhere on navy. */
.statement.inverse {
  background: var(--color-bg-inverse);
  color: var(--color-text-inverse);
}

.statement.inverse .eyebrow {
  color: var(--color-accent);
}

.cta-band {
  border-radius: var(--radius-card);
  padding: var(--space-8) var(--space-7);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
}

.cta-band h3 {
  font-size: var(--fs-h2);
  line-height: var(--lh-tight);
  max-width: 20ch;
}

/* ── Blocks ─────────────────────────────────────────────────── */

/* The sections a page is built from (src/content/blocks). Only tokens and
   the components above; a block never sets a colour, size or font of its
   own. Classes start with b- so they never meet page styles. */

.block {
  padding: var(--space-9) 0;
  color: var(--color-text);
}

.block-wrap {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

/* The closed set of backgrounds an editor may choose. */
.block-light {
  background: var(--mesurit-offwhite);
}

.block-white {
  background: var(--mesurit-white);
}

.block-navy {
  background: var(--color-bg-inverse);
  color: var(--color-text-inverse);
}

.block-yellow {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

/* Two blocks in a row on the same background share one gap: the second
   gives up its top padding, so the space between them is that of one block
   and not of two. Not after a block that brings no bottom padding of its
   own (a section heading leads into the next block, the platform strip ends
   on its line). */
.block-light:not(.b-section-heading, .b-platforms) + .block-light,
.block-white:not(.b-section-heading, .b-platforms) + .block-white,
.block-navy:not(.b-section-heading, .b-platforms) + .block-navy,
.block-yellow:not(.b-section-heading, .b-platforms) + .block-yellow {
  padding-top: 0;
}

/* The statement and the call to action are bands with half the padding; the
   block after one makes up the other half. */
.block-light:is(.b-statement, .b-cta) + .block-light,
.block-white:is(.b-statement, .b-cta) + .block-white,
.block-navy:is(.b-statement, .b-cta) + .block-navy,
.block-yellow:is(.b-statement, .b-cta) + .block-yellow {
  padding-top: var(--space-7);
}

@media (max-width: 640px) {
  .block-light:is(.b-statement, .b-cta) + .block-light,
  .block-white:is(.b-statement, .b-cta) + .block-white,
  .block-navy:is(.b-statement, .b-cta) + .block-navy,
  .block-yellow:is(.b-statement, .b-cta) + .block-yellow {
    padding-top: var(--space-4);
  }
}

/* Type of the blocks, from the type scale. Headings break into lines of
   about the same length, so no word is left alone on the last line. */
.b-display,
.b-heading,
.b-title {
  margin: 0;
  text-wrap: balance;
  color: var(--color-heading);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-heading);
}

.b-display {
  font-size: var(--fs-h1);
  line-height: var(--lh-tight);
}

.b-heading {
  font-size: var(--fs-h2);
  line-height: var(--lh-tight);
}

.b-title {
  font-size: var(--fs-h4);
  line-height: var(--lh-snug);
}

.b-lead {
  margin: 0;
  max-width: var(--measure);
  font-size: var(--fs-lead);
  line-height: var(--lh-body);
  color: var(--color-text);
}

.inverse .b-display,
.inverse .b-heading,
.inverse .b-title {
  color: var(--color-text-inverse);
}

.inverse .b-lead,
.inverse .b-card-open p,
.card-dark p {
  color: var(--color-text-muted-inverse);
}

.b-intro {
  display: grid;
  gap: var(--space-4);
  max-width: 48rem;
  margin-bottom: var(--space-7);
}

.b-intro .eyebrow {
  margin: 0;
}

.b-intro.is-centred {
  margin-inline: auto;
  justify-items: center;
  text-align: center;
}

.b-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* Header: sticky, with the menu folding into a button on a phone. */
.b-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--color-line);
}

.b-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  min-height: 72px;
}

.b-header-logo img {
  display: block;
  height: 32px;
  width: auto;
}

.b-header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.b-header-nav ul {
  display: flex;
  gap: var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.b-header-nav ul a {
  color: var(--color-heading);
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
  text-decoration: none;
}

.b-header-nav ul a:hover {
  text-decoration: underline;
  text-decoration-color: var(--color-accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

/* A menu item with a submenu: the link, an arrow button, and the submenu
   in a panel under it. It opens on hover, on focus and with the button. */
.b-header-item.has-sub {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
}

.b-sub-toggle {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-button);
  background: none;
  color: var(--color-heading);
  cursor: pointer;
}

.b-sub-toggle svg {
  width: 16px;
  height: 16px;
  transform: rotate(180deg);
  transition: transform 0.15s ease;
}

.b-header-item.is-open .b-sub-toggle svg,
.b-header-item.has-sub:hover .b-sub-toggle svg {
  transform: none;
}

.b-sub-toggle:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.b-header-nav ul.b-header-sub {
  position: absolute;
  top: 100%;
  left: calc(-1 * var(--space-4));
  z-index: 1;
  display: none;
  gap: 2px;
  min-width: 232px;
  padding: var(--space-2);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  background: var(--mesurit-white);
  box-shadow: var(--shadow-card);
}

.b-header-item.has-sub:hover .b-header-sub,
.b-header-item.has-sub:focus-within .b-header-sub,
.b-header-item.is-open .b-header-sub {
  display: grid;
}

.b-header-nav ul.b-header-sub a {
  display: block;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-button);
  font-weight: var(--fw-regular);
}

.b-header-nav ul.b-header-sub a:hover {
  background: var(--mesurit-offwhite);
  text-decoration: none;
}

/* The language switch: the codes, the current one marked. */
.b-header-nav ul.b-header-langs {
  gap: var(--space-1);
  align-items: center;
}

.b-header-nav ul.b-header-langs a {
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-button);
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
}

.b-header-nav ul.b-header-langs a[aria-current] {
  background: var(--mesurit-line);
  color: var(--color-heading);
}

.b-menu-button {
  display: none;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-button);
  background: transparent;
  color: var(--color-heading);
  font: inherit;
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
  cursor: pointer;
}

.b-menu-button svg {
  width: 18px;
  height: 18px;
}

.b-menu-button:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

@media (max-width: 860px) {
  .b-menu-button {
    display: inline-flex;
  }

  .b-header-nav {
    display: none;
  }

  .b-header-menu.is-open .b-header-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: grid;
    gap: var(--space-5);
    padding: var(--space-5) var(--gutter) var(--space-6);
    background: inherit;
    border-bottom: 1px solid var(--color-line);
    background: var(--mesurit-offwhite);
  }

  .b-header-menu.is-open .b-header-nav ul {
    display: grid;
    gap: var(--space-4);
  }

  /* On a phone a submenu stands open under its item, indented. */
  .b-header-item.has-sub {
    display: grid;
    gap: var(--space-3);
  }

  .b-sub-toggle {
    display: none;
  }

  .b-header-menu.is-open .b-header-nav ul.b-header-sub {
    position: static;
    display: grid;
    gap: var(--space-3);
    min-width: 0;
    padding: 0 0 0 var(--space-4);
    border: 0;
    border-left: 2px solid var(--color-line);
    border-radius: 0;
    background: none;
    box-shadow: none;
  }

  .b-header-nav ul.b-header-sub a {
    padding: 0;
  }

  .b-header-menu.is-open .b-header-nav ul.b-header-langs {
    display: flex;
  }

  .b-header-nav .btn {
    justify-self: start;
  }
}

/* Hero: the page's only H1. Split puts the visual on the right. */
.b-hero .block-wrap {
  display: grid;
  gap: var(--space-8);
  align-items: center;
}

@media (min-width: 960px) {
  .b-hero:not(.is-centred) .block-wrap {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  }
}

.b-hero-text {
  display: grid;
  gap: var(--space-5);
  justify-items: start;
}

.b-hero-text .eyebrow {
  margin: 0;
}

.b-hero.is-centred .b-hero-text {
  max-width: 48rem;
  margin-inline: auto;
  justify-items: center;
  text-align: center;
}

.b-hero.is-centred .b-display {
  font-size: var(--fs-h2);
}

/* A product page made of the components, with one sticker at 19 degrees:
   the one relaxed element a page may have. */
.b-hero-visual {
  position: relative;
  padding: var(--space-6);
  border-radius: var(--radius-card);
  background:
    repeating-linear-gradient(to right, color-mix(in srgb, var(--mesurit-navy) 25%, transparent) 0 1px, transparent 1px 12px) top left / 100% 8px no-repeat,
    repeating-linear-gradient(to right, color-mix(in srgb, var(--mesurit-navy) 35%, transparent) 0 1px, transparent 1px 60px) top left / 100% 14px no-repeat,
    var(--color-surface-inverse);
}

.b-mockup {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.b-mockup .eyebrow {
  margin: 0;
}

.b-mockup-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.b-mockup .input {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.b-mockup .btn {
  justify-self: start;
}

.b-mockup-sticker {
  position: absolute;
  top: calc(-1 * var(--space-3));
  right: var(--space-6);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-size: var(--fs-small);
  font-weight: var(--fw-bold);
  transform: rotate(var(--angle-relaxed));
}

/* Section heading on its own. */
.b-section-heading {
  padding-bottom: 0;
}

.b-section-heading .b-intro {
  margin-bottom: 0;
}

/* Platform strip: names as text, between two fine lines that run the full
   width of the page. The lines are the block's own edges, so it has no
   padding of its own; `.block` is repeated to win from the phone padding. */
.block.b-platforms {
  padding: 0;
  border-block: 1px solid var(--color-line);
}

/* A hero right above the strip gives up part of its bottom padding, so the
   strip reads as the hero's last line. */
.b-hero:has(+ .b-platforms) {
  padding-bottom: var(--space-7);
}

@media (max-width: 640px) {
  .b-hero:has(+ .b-platforms) {
    padding-bottom: var(--space-6);
  }
}

.b-platforms-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-3) var(--space-6);
  margin: 0;
  padding: var(--space-4) 0;
}

.b-platforms-label {
  font-size: var(--fs-small);
  color: var(--color-text-muted);
}

.b-platform {
  font-weight: var(--fw-bold);
  color: var(--color-heading);
}

.b-icon-badge {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-button);
  background: var(--mesurit-yellow-soft);
  color: var(--color-heading);
}

.b-icon-badge svg {
  width: 24px;
  height: 24px;
}

.inverse .b-icon-badge {
  background: var(--color-surface-inverse);
  color: var(--color-accent);
}

/* Cards: two, three or four columns, one column on a phone. */
.b-card-grid {
  display: grid;
  gap: var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.b-card-grid > li {
  display: flex;
}

.b-card-grid .card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
}

.b-card-grid .card .icon {
  margin-bottom: var(--space-2);
  color: var(--color-heading);
}

.b-card-grid .card-dark .icon {
  color: var(--color-accent);
}

.b-card-grid .card p {
  margin: 0;
}

/* Open: no frame, the icon in a badge. */
.b-card-grid.is-open {
  gap: var(--space-6);
}

.b-card-open {
  display: grid;
  gap: var(--space-3);
  align-content: start;
  justify-items: start;
  width: 100%;
}

.b-card-open p {
  margin: 0;
}

.b-card-grid .link-arrow {
  margin-top: auto;
  align-self: flex-start;
}

@media (min-width: 720px) {
  .b-card-grid.cols-2,
  .b-card-grid.cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .b-card-grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .b-card-grid.cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Statement and call to action sit on the page with their own surface. */
.b-statement,
.b-cta {
  padding: var(--space-7) 0;
}

.b-statement .eyebrow {
  margin-bottom: var(--space-4);
}

.b-cta .cta-band > div {
  display: grid;
  gap: var(--space-3);
}

/* Footer: a second navigation, on navy. */
.b-footer {
  padding: var(--space-8) 0 var(--space-6);
  color: var(--color-text-muted-inverse);
}

.b-footer-grid {
  display: grid;
  gap: var(--space-7);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
}

.b-footer-brand {
  display: grid;
  gap: var(--space-4);
  align-content: start;
}

.b-footer-brand img {
  height: 32px;
  width: auto;
}

.b-footer-brand p {
  margin: 0;
  max-width: 32ch;
}

.b-footer-column .eyebrow {
  margin: 0 0 var(--space-4);
}

.b-footer-column ul {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.b-footer a {
  color: var(--color-text-inverse);
  text-decoration: none;
}

.b-footer a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.b-footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-8);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border-inverse);
  font-size: var(--fs-small);
}

/* The ruler track, for the step chain and the timeline: steps along one
   ruler that runs down the block, numbered through. In the step chain the
   steps stand per phase. A yellow tape runs out along the
   ruler while the block scrolls by; a dot and a number turn on when the tape
   reaches them, and the mark closes the measurement. Without scroll-driven
   animations, or with reduced motion, the track shows measured. */
.b-track {
  --number: 40px;
  --axis: calc(var(--number) / 2);
  --end: calc(28px + var(--space-4));
  --tick: color-mix(in srgb, var(--mesurit-navy) 40%, transparent);
  position: relative;
  padding-bottom: var(--end);
}

/* The ruler: its edge on the axis, a tick every 10 px, longer every 50. */
.b-track::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: var(--end);
  left: var(--axis);
  width: 15px;
  background:
    linear-gradient(var(--tick) 0 0) top left / 1px 100% no-repeat,
    repeating-linear-gradient(to bottom, var(--tick) 0 2px, transparent 2px 50px) top left / 15px 100% no-repeat,
    repeating-linear-gradient(to bottom, var(--tick) 0 1px, transparent 1px 10px) top left / 7px 100% no-repeat;
}

.b-track-tape {
  position: absolute;
  top: 0;
  bottom: var(--end);
  left: calc(var(--axis) - 1px);
  width: 3px;
  background: var(--color-accent);
}

.b-track-end {
  position: absolute;
  bottom: 0;
  left: calc(var(--axis) - 14px);
}

.b-track-phases {
  position: relative;
  display: grid;
  gap: var(--space-6);
  margin: 0;
  padding: 0;
  list-style: none;
}

.b-track-phase {
  position: relative;
  display: grid;
  gap: var(--space-5);
  align-content: start;
}

.b-track-phase-name {
  margin: 0;
  padding-left: calc(var(--number) + var(--space-4));
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-eyebrow);
  line-height: 20px;
  text-transform: uppercase;
  color: var(--color-heading);
}

/* The dot where a phase starts, on the ruler's edge. */
.b-track-phase::before {
  content: "";
  position: absolute;
  top: 4px;
  left: calc(var(--axis) - 6px);
  width: 12px;
  height: 12px;
  border-radius: var(--radius-pill);
  background: var(--color-heading);
  box-shadow: 0 0 0 4px var(--track-ground, var(--mesurit-offwhite));
}

.block-white .b-track {
  --track-ground: var(--mesurit-white);
}

.b-track-steps {
  display: grid;
  gap: var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.b-track-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
}

.b-track-number {
  min-width: var(--number);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  box-shadow: 0 0 0 4px var(--track-ground, var(--mesurit-offwhite));
  font-size: var(--fs-small);
  font-weight: var(--fw-bold);
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: var(--color-heading);
}

.b-track-step p {
  margin: var(--space-2) 0 0;
}

.b-track-steps {
  position: relative;
}

/* Wide: the ruler stays on the left. With phases, a phase is a row: its name
   first and its steps beside each other. */
@media (min-width: 960px) {
  .b-track-phases {
    gap: var(--space-7);
  }

  .b-track-phase {
    grid-template-columns: 160px minmax(0, 1fr);
    gap: var(--space-6);
    padding-left: calc(var(--number) + var(--space-4));
  }

  .b-track-phase-name {
    padding-left: 0;
  }

  .b-track-phase .b-track-steps {
    grid-column: 2;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-6);
  }

  .b-track-phase .b-track-number {
    box-shadow: none;
  }

  /* Without phases every step is a row on the ruler: its title, then its text. */
  .b-track > .b-track-steps {
    gap: var(--space-6);
  }

  .b-track > .b-track-steps .b-track-text {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: var(--space-6);
    align-items: baseline;
  }

  .b-track > .b-track-steps .b-track-text p {
    margin: 0;
    max-width: var(--measure);
  }
}

/* Measuring: the tape's head is the line at 65% of the screen's height. */
@keyframes track-tape {
  from {
    clip-path: inset(0 0 100% 0);
  }

  to {
    clip-path: inset(0);
  }
}

@keyframes track-reach {
  from {
    background: var(--color-line);
  }
}

@keyframes track-approve {
  from {
    opacity: 0;
    transform: scale(0.4);
  }
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .b-track-tape,
    .b-track-phase::before,
    .b-track-number,
    .b-track-end {
      animation-timing-function: linear;
      animation-fill-mode: both;
      animation-timeline: view(block 0% 35%);
      animation-range: entry-crossing 0% entry-crossing 100%;
    }

    .b-track-tape {
      animation-name: track-tape;
    }

    .b-track-phase::before,
    .b-track-number {
      animation-name: track-reach;
    }

    .b-track-end {
      animation-name: track-approve;
    }
  }
}

/* Feature with media: text beside an image or a video. */
.b-feature-grid {
  display: grid;
  gap: var(--space-7);
  align-items: center;
}

@media (min-width: 960px) {
  .b-feature-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  }

  .b-feature-grid.is-media-left .b-media {
    order: -1;
  }
}

.b-feature-text {
  display: grid;
  gap: var(--space-5);
  justify-items: start;
}

.b-feature-text .eyebrow,
.b-feature-text .b-heading,
.b-feature-text .b-lead {
  margin: 0;
}

.b-points {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.b-points li {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  color: var(--color-heading);
  font-weight: var(--fw-semibold);
}

.inverse .b-points li {
  color: var(--color-text-inverse);
}

.b-points svg {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--color-success);
}

.inverse .b-points svg {
  color: var(--color-accent);
}

.b-media {
  margin: 0;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.b-media img,
.b-media iframe,
.b-media video {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}

.b-media-video {
  aspect-ratio: 16 / 9;
}

/* No media yet: a placeholder in the same shape, so the layout holds. */
.b-media-empty {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--space-3);
  border: 2px dashed var(--color-border-input);
  box-shadow: none;
  background: transparent;
  color: var(--color-text-muted);
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
}

.inverse .b-media-empty {
  border-color: var(--color-border-inverse);
  color: var(--color-text-muted-inverse);
}

.b-media-empty svg {
  width: 40px;
  height: 40px;
}

/* Rules and AI: the introduction beside one example message. */
.b-rules-grid,
.b-form-grid {
  display: grid;
  gap: var(--space-7);
  align-items: start;
}

@media (min-width: 960px) {
  .b-rules-grid,
  .b-form-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  }
}

.b-rules-grid .b-intro,
.b-form-grid .b-intro {
  margin-bottom: 0;
}

.b-rules-card {
  display: grid;
  gap: var(--space-4);
}

.b-rules-advice {
  display: grid;
  gap: var(--space-2);
  justify-items: start;
  padding: var(--space-4);
  border-radius: var(--radius-button);
  border: 1px dashed var(--color-border-input);
}

.b-rules-advice p {
  margin: 0;
  font-size: var(--fs-small);
}

/* Team: a photo, name, role and one line. */
.b-team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: var(--space-6);
  margin: 0;
  padding: 0;
  list-style: none;
}

.b-person {
  display: grid;
  gap: var(--space-2);
  align-content: start;
  justify-items: start;
}

.b-person p {
  margin: 0;
}

.b-person-photo {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  margin-bottom: var(--space-3);
  border-radius: var(--radius-card);
  background: var(--color-surface-inverse);
  color: var(--color-accent);
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
}

.b-person-role {
  color: var(--color-text-muted);
  font-size: var(--fs-small);
}

/* Demo form: the introduction beside the form. */
.b-form-card {
  display: grid;
  gap: var(--space-5);
}

.b-form-card .form-grid {
  gap: var(--space-6) var(--space-4);
}

.b-form-wide {
  grid-column: 1 / -1;
}

.b-form-note {
  margin: 0;
  font-size: var(--fs-small);
  color: var(--color-text-muted);
}

.inverse .b-form-note {
  color: var(--color-text-muted-inverse);
}

.on-accent .b-form-note {
  color: var(--color-on-accent);
}

/* Ruler detail: ticks as a divider, longer every fifth. */
.b-ruler-block {
  padding: var(--space-6) 0;
}

.b-ruler {
  --tick: color-mix(in srgb, currentColor 45%, transparent);
  position: relative;
  height: 24px;
  background:
    linear-gradient(var(--tick) 0 0) bottom left / 100% 1px no-repeat,
    repeating-linear-gradient(to right, var(--tick) 0 2px, transparent 2px 60px) bottom left / 100% 22px no-repeat,
    repeating-linear-gradient(to right, var(--tick) 0 1px, transparent 1px 12px) bottom left / 100% 10px no-repeat;
  color: var(--color-heading);
}

.inverse .b-ruler {
  color: var(--color-text-inverse);
}

.b-ruler-label {
  position: absolute;
  bottom: calc(100% + var(--space-1));
  left: 0;
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-size: var(--fs-small);
  font-weight: var(--fw-bold);
}

/* Comparison: Mesurit's column stands out in soft yellow. */
.b-compare th[scope="row"] {
  font-weight: var(--fw-semibold);
  color: var(--color-heading);
  background: transparent;
}

.b-compare .is-us {
  background: color-mix(in srgb, var(--mesurit-yellow-soft) 55%, var(--mesurit-white));
}

.b-compare thead .is-us {
  background: var(--mesurit-yellow-soft);
}

.b-compare-value {
  display: inline-flex;
  gap: var(--space-2);
  align-items: center;
}

/* A cell written without a capital still starts with one. */
.b-compare-value > span {
  display: inline-block;
}

.b-compare-value > span::first-letter {
  text-transform: uppercase;
}

.b-compare-value svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.b-compare-value.is-yes svg {
  color: var(--color-success);
}

.b-compare-value.is-no {
  color: var(--color-text-muted);
}

/* Updates: date and title, three in a row. */
.b-news-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.b-news-item {
  display: grid;
  gap: var(--space-3);
  height: 100%;
}

.b-news-date {
  margin: 0;
  font-size: var(--fs-small);
  color: var(--color-text-muted);
}

.b-news-item a {
  color: inherit;
  text-decoration: none;
}

.b-news-item a:hover {
  text-decoration: underline;
  text-decoration-color: var(--color-accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

/* Case and quote. */
.b-case-grid {
  display: grid;
  gap: var(--space-6);
  align-items: start;
  margin-top: var(--space-5);
}

@media (min-width: 960px) {
  .b-case-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.b-case-facts {
  display: grid;
  gap: var(--space-5);
  margin: 0;
}

.b-case-facts dt {
  margin-bottom: var(--space-1);
}

.b-case-facts dd {
  margin: 0;
}

.b-quote {
  display: grid;
  gap: var(--space-5);
  margin: 0;
}

.b-quote blockquote {
  margin: 0;
  padding-left: var(--space-5);
  border-left: 4px solid var(--color-accent);
  font-size: var(--fs-lead);
  line-height: var(--lh-snug);
  color: var(--color-heading);
}

/* Figures: the value large, the explanation under it. */
.b-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: var(--space-6);
  margin: 0;
}

.b-stats-grid div {
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-2);
  padding-top: var(--space-4);
  border-top: 2px solid var(--color-accent);
}

.b-stats-grid dd {
  margin: 0;
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  color: var(--color-heading);
  font-variant-numeric: tabular-nums;
}

.inverse .b-stats-grid dd {
  color: var(--color-text-inverse);
}

.b-stats-grid dt {
  font-size: var(--fs-small);
}

/* Customer logos: grey until hovered. */
.b-logos {
  padding: var(--space-7) 0;
}

.b-logos-label {
  margin: 0 0 var(--space-5);
  text-align: center;
  font-size: var(--fs-small);
  color: var(--color-text-muted);
}

.b-logos-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.b-logo {
  display: grid;
  place-items: center;
  height: 64px;
  border-radius: var(--radius-button);
  border: 1px dashed var(--color-line);
  color: var(--color-text-muted);
  font-weight: var(--fw-bold);
  filter: grayscale(1);
  opacity: 0.7;
  transition: opacity 0.15s;
}

.b-logo:hover {
  opacity: 1;
  filter: none;
}

@media (max-width: 640px) {
  .block {
    padding: var(--space-8) 0;
  }

  .b-mockup-fields {
    grid-template-columns: 1fr;
  }
}

/* ── Helpers ────────────────────────────────────────────────── */

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

@media (prefers-reduced-motion: reduce) {
  .btn,
  .input,
  .input-group,
  .combo-control,
  .check input,
  .radio input,
  .choice-card,
  .switch input,
  .switch input::after,
  .segmented span,
  .faq summary::after,
  .tab,
  .tooltip-text,
  .dropzone,
  .progress::before {
    transition: none;
  }

  .spinner,
  .skeleton,
  .progress.is-indeterminate::before {
    animation-duration: 3s;
  }
}
