/*
  Controls: buttons, fields, selects, checkboxes, switches, choice cards, swatches, steppers,
  segmented controls, chips, drop zone, keycaps.

  Principles (docs/DESIGN.md, Controls):
  - No decorative borders on buttons. Hierarchy comes from fill: primary (solid graphite / yellow in dark),
    secondary (tonal), ghost (none), link (underlined text).
  - Buttons never move on hover: no lift, no arrow nudging forward. Hover changes colour only (filled
    buttons turn yellow in both themes, tonal ones a shade darker); only a click presses them in a little.
  - Fields have the newsletter's format: label above, icon and example placeholder in one row, no box;
    a yellow line draws in under the row on focus (red on error). The search fields share it.
    States change the ring, never the size, so nothing jumps.
  - Every control is at least 44px tall on touch screens (36px "sm" only in dense team tables and toolbars).
*/

/* ---------------------------------------------------------------- date */
/* A date field looks like the others: the calendar icon leads the row (FIELD_ICONS), the browser's own
   picker button at the end is hidden, and a click anywhere in the row opens the calendar (ui.js). */
.control .input[type="date"] { cursor: pointer; }
.control .input[type="date"]::-webkit-calendar-picker-indicator { display: none; }
.control:has(.input[type="date"]) { cursor: pointer; }

/* ---------------------------------------------------------------- buttons */
.btn {
  --btn-bg: transparent;
  --btn-ink: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  height: var(--control-h); padding: 0 var(--s-5);
  border: 0; border-radius: var(--r-btn);
  background: var(--btn-bg); color: var(--btn-ink);
  font: 500 var(--t-body)/1 var(--font); letter-spacing: 0; white-space: nowrap; text-decoration: none;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.btn .icon { width: 18px; height: 18px; flex: none; transition: transform var(--dur) var(--ease); }
.btn:focus-visible { border-radius: var(--r-btn); }
.btn:active { transform: scale(.985); }
@media (hover: hover) and (pointer: fine) {
  .btn:is(.btn--primary, .btn--accent):hover { box-shadow: var(--shadow-md); }
}

.btn--primary { --btn-bg: var(--action); --btn-ink: var(--action-ink); }
.btn--primary:hover { --btn-bg: var(--action-hover); --btn-ink: var(--action-hover-ink); }
.btn--accent { --btn-bg: var(--accent); --btn-ink: var(--accent-ink); }
.btn--accent:hover { --btn-bg: color-mix(in oklab, var(--accent) 88%, #ffffff); }
.btn--secondary { --btn-bg: color-mix(in oklab, var(--ink) 7%, transparent); }
.btn--secondary:hover { --btn-bg: color-mix(in oklab, var(--ink) 12%, transparent); }
.btn--ghost:hover { --btn-bg: color-mix(in oklab, var(--ink) 7%, transparent); }
.btn--danger { --btn-bg: var(--danger); --btn-ink: #fff; }
:root[data-theme="dark"] .btn--danger { --btn-ink: #2a0a06; }
.btn--danger:hover { --btn-bg: color-mix(in oklab, var(--danger) 88%, var(--ink)); }
.btn--danger-text { --btn-ink: var(--danger); }
.btn--on-warn { --btn-bg: var(--inverse); --btn-ink: var(--inverse-ink); }

/* Text links with an icon, everywhere alike: no line at rest; on hover / keyboard focus a 2px line draws in
   from the left under the label and leaves to the right (the motion of the navigation and footer links,
   .line-text below), and the arrow leans (motion.css). Its icon is an accent icon (chrome.css): yellow in
   both themes – it says "link" at rest. */
.btn--link { height: auto; min-height: var(--control-h); padding: 0; border-radius: var(--r-xs); text-decoration: none; }
.btn--link .btn__label {
  padding-bottom: 3px;
  background: linear-gradient(currentColor, currentColor) right bottom / 0 2px no-repeat;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  transition: background-size var(--dur-panel) var(--ease);
}
.btn--link:is(:hover, :focus-visible) .btn__label { background-position: left bottom; background-size: 100% 2px; }
.btn--link:active { transform: none; }
/* in a grid (a card, a stack) a text link keeps its own width and starts on the left like the text
   around it, instead of stretching across and standing alone in the middle */
.btn--link { justify-self: start; }
.btn--on-dark { --btn-ink: var(--inverse-ink); }
/* A quiet action (a receipt's PDF): word and icon in the text colour at rest, no box, no line; under the
   pointer or the keyboard both turn yellow – the word takes --accent-text (the brand yellow on dark ground,
   a readable ochre on light), the icon becomes an accent icon (chrome.css). */
.btn--accent-link { transition: color var(--dur) var(--ease); }
.btn--accent-link:is(:hover, :focus-visible) { --btn-ink: var(--accent); }
/* by day the letters stay graphite and a yellow marker stripe runs under them (yellow letters would not
   read on white – the same marker as the product page's price); the icon is an accent icon (chrome.css) */
:root:not([data-theme="dark"]) :is(.btn--accent-link:is(:hover, :focus-visible), .dropzone__input:is(:hover, :focus-visible) ~ .dropzone__action) {
  --btn-ink: var(--ink);
  text-decoration: underline var(--accent); text-decoration-thickness: .42em; text-underline-offset: -.22em; text-decoration-skip-ink: none;
}
.btn--accent-link:active { transform: none; }

.btn--sm { height: var(--control-h-sm); padding: 0 var(--s-4); font-size: var(--t-small); gap: 6px; }
.btn--sm .icon { width: 16px; height: 16px; }
.btn--sm.btn--link { min-height: var(--control-h-sm); padding: 0; }
.btn--lg { height: var(--control-h-lg); padding: 0 var(--s-6); font-size: 17px; }
.btn--xl {
  width: min(100%, 640px); height: clamp(60px, 1.4vw + 46px, 72px); padding: 0 var(--s-7);
  justify-content: space-between; border-radius: var(--r-md);
  font: var(--display-weight) clamp(20px, .6vw + 16px, 26px)/1 var(--font); letter-spacing: var(--tracking-display);
}
.btn--xl .icon { width: 26px; height: 26px; }
.btn--block { width: 100%; }
/* split: a wide button that leads on (label + arrow) – the label left, the arrow at the far end, as the
   start page's call to action */
.btn--split { justify-content: space-between; padding-inline: var(--s-5); }

.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; box-shadow: none; transform: none; }

/* Busy: the label stays (so the button does not change width), a spinner replaces the icons. */
.btn[aria-busy="true"] { pointer-events: none; opacity: .85; }
.btn[aria-busy="true"] .icon { display: none; }
.btn[aria-busy="true"]::before {
  content: ""; width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin 700ms linear infinite;
}

/* A confirmation flash after "Add to cart". */
.btn.is-confirmed { animation: confirm-pop calc(500ms * var(--motion-scale)) var(--ease-enter); }

.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }
.btn-row--center { justify-content: center; }

/* ---------------------------------------------------------------- icon buttons */
.icon-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px; padding: 0; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--ink);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
}
.icon-btn .icon { width: 20px; height: 20px; }
.icon-btn:hover { background: color-mix(in oklab, var(--ink) 8%, transparent); }
.icon-btn:active { transform: scale(.94); }
.icon-btn--sm { width: 32px; height: 32px; }
.icon-btn--sm .icon { width: 18px; height: 18px; }
/* Every cross that closes or removes – dialogs and sheets, the menu sheets, the demo bar, toasts, the
   search field's clear, the shop's filter chips: under the pointer (or the keyboard's focus) only its
   lines turn red, like the cart's bin – no disc behind it. A chip keeps its label; only its cross turns. */
:is(button, a):not(.chip):has(> .icon--x) { transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease); }
:is(button, a):not(.chip):has(> .icon--x):is(:hover, :focus-visible) { color: var(--danger); background: none; }
.chip--removable > .icon--x { transition: color var(--dur) var(--ease); }
.chip--removable:is(:hover, :focus-visible) > .icon--x { color: var(--danger); }
.icon-btn--solid { background: var(--raised); box-shadow: var(--shadow-md); border-radius: var(--r-pill); }
.icon-btn--solid:hover { background: var(--action-hover); color: var(--action-hover-ink); }

/* ---------------------------------------------------------------- links */
/* The site's link underline for any label: wrap it in .line-text and a 2px line draws in from the left
   while its link or button is hovered or focused, and leaves to the right (the motion of the main
   navigation). It is drawn under every line, so a wrapping label stays underlined line by line; the
   current item ([aria-current]) keeps its line. Footer, mega menu and shop subcategories use it. */
.line-text {
  padding-bottom: 3px;
  background: linear-gradient(currentColor, currentColor) right bottom / 0 2px no-repeat;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  transition: background-size var(--dur-panel) var(--ease);
}
:is(a, button):is(:hover, :focus-visible) .line-text, [aria-current] .line-text { background-position: left bottom; background-size: 100% 2px; }
.link { font-weight: 500; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; transition: text-decoration-color var(--dur) var(--ease); }
.link:hover { text-decoration-color: currentColor; }
.link-plain { display: inline-flex; align-items: center; gap: 4px; text-underline-offset: 3px; }
.link-plain:hover { text-decoration: underline; }
.link-plain .icon { width: 14px; height: 14px; }

/* ---------------------------------------------------------------- fields
   Every form field has the newsletter's format: the label flush above, then one row with a leading
   icon, the text and its trailing parts (show password, chevron) – no box and, at rest, no line. The
   icon and an example in the placeholder say what goes in. On focus the brand-yellow 2px line draws in
   under the row from the left (the navigation's underline) and the icon becomes an accent icon
   (chrome.css); an invalid field shows the line in red, its message under it. */
.field { display: grid; gap: 2px; align-content: start; min-width: 0; }
.field__label { font-size: var(--t-small); font-weight: 600; color: var(--ink); }
/* An icon before a field's label (where the field keeps its whole width for the words – the feedback
   message): muted at rest; while the field is in use it turns yellow like the icons inside fields
   (chrome.css "accent icons": yellow at night, graphite on a yellow layer by day). */
.field__label-icon { display: inline-block; width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px; color: var(--muted); transition: color var(--dur) var(--ease); }
.field:focus-within .field__label-icon { color: var(--accent); }
:root:not([data-theme="dark"]) .field:focus-within .field__label-icon { color: var(--ink); filter: drop-shadow(0 1.6px 0 var(--accent)); }
.field__optional { font-weight: 400; color: var(--muted); }
/* required: a yellow star after the label – an accent like the icons (chrome.css: graphite on a
   yellow layer in light, plain yellow in dark) */
.field__required { display: inline-block; margin-left: 3px; font-weight: 700; }
.field__hint { margin-top: 4px; font-size: var(--t-label); color: var(--muted); line-height: 1.45; }
.field__error {
  display: flex; align-items: flex-start; gap: 6px; margin-top: 4px;
  font-size: var(--t-label); font-weight: 500; color: var(--danger); line-height: 1.45;
  animation: error-in calc(220ms * var(--motion-scale)) var(--ease-enter);
}
.field__error::before {
  content: "!"; flex: none; display: inline-grid; place-items: center; width: 16px; height: 16px; margin-top: 1px;
  border-radius: 50%; background: var(--danger); color: var(--raised); font-size: 11px; font-weight: 700;
}

.control {
  --field-line: var(--accent);
  position: relative; display: flex; align-items: center; gap: 12px; min-width: 0;
  background: linear-gradient(var(--field-line), var(--field-line)) left bottom / 0 2px no-repeat;
  transition: background-size var(--dur-panel) var(--ease);
}
.control:focus-within { background-size: 100% 2px; }
.control:has(.input[aria-invalid="true"]) { --field-line: var(--danger); background-size: 100% 2px; }
.input {
  flex: 1; width: 100%; min-width: 0; height: var(--control-h); margin: 0; padding: 0;
  border: 0; border-radius: 0; background: none; color: var(--ink);
  font: 500 var(--t-body)/1.4 var(--font); outline: none;
  -webkit-appearance: none; appearance: none;
}
.input::placeholder { color: var(--muted); font-weight: 400; transition: opacity var(--dur) var(--ease); }
.input:focus::placeholder { opacity: .65; }
.input:focus-visible { box-shadow: none; }
.input:disabled { opacity: .55; cursor: not-allowed; }
.input[type="number"] { -moz-appearance: textfield; }
.input::-webkit-outer-spin-button, .input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
/* A text area starts as one row, exactly as tall as the other fields (10 + 24 + 10 = 44px), and grows
   line by line with its text up to 40% of the screen – by CSS where supported (field-sizing), else
   ui.js startTextAreas(). Its icon stays beside the first line. */
.control--area { align-items: flex-start; }
.control--area .control__icon { margin-top: 13px; }
.input--area { height: auto; min-height: var(--control-h); max-height: 40vh; padding: 10px 0; line-height: 24px; resize: none; overflow-y: auto; field-sizing: content; }

.control__icon { flex: none; width: 18px; height: 18px; color: var(--muted); pointer-events: none; transition: color var(--dur) var(--ease); }
.control__action {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; margin-right: -6px; padding: 0;
  border: 0; border-radius: var(--r-xs); background: none; color: var(--muted);
  transition: color var(--dur) var(--ease);
}
.control__action:is(:hover, :focus-visible) { color: var(--ink); }
/* the eye while the password shows: yellow – plain at night, graphite on a yellow layer by day */
.input[type="text"] + .control__action[data-action="toggle-password"] { color: var(--accent); }
:root:not([data-theme="dark"]) .input[type="text"] + .control__action[data-action="toggle-password"] .icon { color: var(--ink); filter: drop-shadow(0 1.6px 0 var(--accent)); }
.control__action .icon { width: 18px; height: 18px; }

/* select: the native element (phones keep their own pickers), its value in the row, a chevron at the end */
.control--select .input { padding-right: 26px; cursor: pointer; text-overflow: ellipsis; }
.control--select option { background: var(--raised); color: var(--ink); }
.control__chevron { position: absolute; right: 0; width: 16px; height: 16px; color: var(--muted); pointer-events: none; transition: color var(--dur) var(--ease), transform var(--dur-panel) var(--ease); }
.control--select:is(:hover, :focus-within) .control__chevron { color: var(--ink); }
/* while its list is open the field counts as in use, wherever the focus is: the line stays drawn, the
   icon stays yellow (chrome.css), the chevron turns like the navigation's (separate rules: browsers
   without :open drop only these) */
.control:has(.input:open) { background-size: 100% 2px; }
.control--select:has(.input:open) .control__chevron { color: var(--ink); transform: rotate(180deg); }
/* The open list in the field's own language, where the browser lets a select be styled
   (appearance: base-select; elsewhere the native list stays): square corners, a hairline frame, rows
   that take the neutral hover, the chosen one marked by the yellow bar of the current item (as in the
   phone menu). It opens under the whole row, icon included, and fades in. Keyboard, screen readers and
   phone pickers keep working, because it is still the native <select>. */
@supports (appearance: base-select) {
  .control--select .input, .control--select .input::picker(select) { appearance: base-select; }
  .control--select .input { display: flex; align-items: center; min-block-size: 0; }
  .control--select .input::picker-icon { display: none; }
  .control--select .input::picker(select) {
    /* under the field; above it only when it does not fit below (the browser's default picks the larger side) */
    position-try-order: normal;
    margin: 0; margin-block-start: 2px; margin-inline-start: -30px; padding: 4px 0;
    min-inline-size: calc(anchor-size(self-inline) + 30px);
    border: 0; border-radius: 0; background: var(--raised); color: var(--ink);
    box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--line);
    opacity: 0; transition: opacity var(--dur) var(--ease), display var(--dur) allow-discrete, overlay var(--dur) allow-discrete;
  }
  .control--select .input::picker(select):popover-open { opacity: 1; }
  @starting-style { .control--select .input::picker(select):popover-open { opacity: 0; } }
  .control--compact .input::picker(select) { margin-inline-start: -24px; min-inline-size: calc(anchor-size(self-inline) + 24px); }
  .control--select option {
    display: flex; align-items: center; min-block-size: 40px; padding: 0 14px 0 16px;
    border-radius: 0; background: none; color: var(--ink); font: 500 var(--t-small)/1.3 var(--font);
    cursor: pointer; transition: background-color var(--dur-fast) var(--ease);
  }
  .control--select option::checkmark { display: none; }
  .control--select hr { margin: 4px 0; border: 0; border-top: 1px solid var(--line); }
  .control--select option:is(:hover, :focus-visible) { background: var(--highlight); outline: none; box-shadow: none; }
  .control--select option:checked { font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
  .control--select option:checked:is(:hover, :focus-visible) { box-shadow: inset 3px 0 0 var(--accent); }
  .control--select option:disabled { color: var(--muted); cursor: default; }
  /* groups (the period select: recent, months, quarters, years): a small grey title, a hairline between groups */
  .control--select optgroup { padding-block: 6px 2px; font: 600 11px/1.3 var(--font); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
  .control--select optgroup:not(:first-child) { margin-block-start: 4px; border-block-start: 1px solid var(--line); }
  .control--select optgroup option { letter-spacing: 0; text-transform: none; }
}
/* combobox (ui/components/combo.js): the field's row to type into, its list under it in the open
   select's language – square, a hairline frame, neutral hover, the chosen row with the yellow bar */
.control--combo .input { padding-right: 26px; text-overflow: ellipsis; }
.control--combo .control__chevron { transition: transform var(--dur-panel) var(--ease), color var(--dur) var(--ease); }
.control--combo:hover .control__chevron, .control--combo.is-open .control__chevron { color: var(--ink); }
.control--combo.is-open .control__chevron { transform: rotate(180deg); }
.combo__list {
  position: absolute; top: calc(100% + 2px); left: 0; z-index: 70; display: flex; flex-direction: column;
  min-width: 100%; max-height: min(320px, 50vh); margin: 0; padding: 4px 0; overflow-y: auto; overscroll-behavior: contain;
  list-style: none; background: var(--raised); box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--line);
  animation: fade-in var(--dur) var(--ease);
}
.combo__list[hidden], .combo__list [hidden] { display: none; }
.combo__option {
  display: flex; align-items: center; flex: none; min-height: 40px; padding: 0 14px 0 16px;
  font: 500 var(--t-small)/1.3 var(--font); color: var(--ink); cursor: pointer; white-space: nowrap;
}
.combo__option:hover, .combo__option.is-active { background: var(--highlight); }
.combo__option[aria-selected="true"] { font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.combo__sep { flex: none; margin: 4px 0; border-top: 1px solid var(--line); }
.combo__empty { padding: 10px 16px; font-size: var(--t-small); color: var(--muted); }
/* the phone's code: a short row (+41), a list wide enough for the country names */
.control--combo-code { gap: 8px; }
.control--combo-code .input { width: 7ch; flex: none; padding-right: 22px; }
.control--combo-code .combo__list { min-width: 260px; }
/* compact: the toolbars' selects (sorting, filters) – the same row, a little smaller */
.control--compact { gap: 8px; }
.control--compact .input { height: 40px; font-size: 15px; }
.control--compact .control__icon { width: 16px; height: 16px; }

/* ---------------------------------------------------------------- checkbox */
.field--check { gap: 4px; }
.check { position: relative; display: flex; align-items: flex-start; gap: var(--s-3); cursor: pointer; font-size: var(--t-body); line-height: 1.45; }
.check__input { position: absolute; opacity: 0; width: 20px; height: 20px; margin: 0; }
.check__box {
  flex: none; display: grid; place-items: center; width: 20px; height: 20px; margin-top: 1px;
  border-radius: 6px; background: var(--raised); box-shadow: inset 0 0 0 1.5px var(--line-strong);
  transition: background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.check__box .icon { width: 14px; height: 14px; stroke-width: 3; color: var(--action-ink); opacity: 0; transform: scale(.4); transition: opacity var(--dur-fast) var(--ease), transform var(--dur) var(--ease-enter); }
.check:hover .check__box { box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--ink) 45%, transparent); }
.check__input:checked + .check__box { background: var(--action); box-shadow: none; }
.check__input:checked + .check__box .icon { opacity: 1; transform: none; }
.check__input:focus-visible + .check__box { box-shadow: var(--focus-ring); }
.check__input[aria-invalid="true"] + .check__box { box-shadow: inset 0 0 0 2px var(--danger); }

/* ---------------------------------------------------------------- switch */
.toggle { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: var(--s-2) 0; cursor: pointer; }
.toggle__text { display: grid; gap: 2px; }
.toggle__label { font-size: var(--t-small); font-weight: 500; }
.toggle__hint { font-size: var(--t-label); color: var(--muted); }
.toggle__input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle__track { position: relative; flex: none; width: 40px; height: 24px; border-radius: var(--r-pill); background: color-mix(in oklab, var(--ink) 18%, transparent); transition: background-color var(--dur) var(--ease); }
.toggle__thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform var(--dur) var(--ease-enter), background-color var(--dur) var(--ease); }
.toggle__input:checked + .toggle__track { background: var(--action); }
.toggle__input:checked + .toggle__track .toggle__thumb { transform: translateX(16px); background: var(--action-ink); }
.toggle__input:focus-visible + .toggle__track { box-shadow: var(--focus-ring); }

/* ---------------------------------------------------------------- choice cards (radio) */
.choice-group { gap: var(--s-2); }
/* the tiles start as far under their label as a field's content sits under its own: the 2px of .field
   and half of what a control's height leaves around its 20px icon */
.choice-group > legend.field__label { padding-bottom: calc(2px + (var(--control-h) - 20px) / 2); }
/* the way to pay (components/payment.js): TWINT, "or", Stripe – tiles over the full width, each led by
   its emblem (the footer's payment marks, a size larger) */
.payment-choice__ways { display: grid; gap: var(--s-3); }
.payment-choice__or { margin: 0; }
.payment-choice .payment-choice__body { display: flex; align-items: center; gap: var(--s-4); min-height: 72px; }
.payment-choice__text { display: grid; gap: 2px; min-width: 0; }
.payment-choice .payment-choice__mark { flex: none; width: 80px; height: 40px; padding: 0 10px; border-radius: 6px; }
.payment-choice .pay-mark--twint svg { width: 60px; height: 20px; }
.payment-choice .pay-mark--stripe svg { width: 48px; height: 20px; }
.choice-group__options { display: grid; grid-template-columns: repeat(var(--columns, 3), minmax(0, 1fr)); gap: var(--s-2); }
@media (max-width: 479px) { .choice-group__options { grid-template-columns: repeat(min(var(--columns, 3), 2), minmax(0, 1fr)); } }
.choice { position: relative; display: flex; cursor: pointer; }
.choice__input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice__body {
  flex: 1; display: grid; gap: 2px; align-content: start; padding: 12px 14px; min-height: 64px;
  border-radius: var(--r-md); background: var(--raised); box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
}
.choice:hover .choice__body { box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--ink) 45%, transparent); }
.choice__input:checked + .choice__body { box-shadow: inset 0 0 0 2px var(--action); background: color-mix(in oklab, var(--action) 5%, var(--raised)); }
.choice__input:focus-visible + .choice__body { box-shadow: inset 0 0 0 2px var(--action), 0 0 0 4px color-mix(in oklab, var(--action) 22%, transparent); }
.choice__input:active + .choice__body { transform: scale(.985); }
.choice__icon { width: 20px; height: 20px; margin-bottom: 4px; color: var(--muted); transition: color var(--dur) var(--ease); }
.choice__input:checked + .choice__body .choice__icon { color: var(--ink); }
.choice__title { font-weight: 600; }
.choice__meta { font-size: var(--t-label); color: var(--muted); line-height: 1.35; }
.choice__aside { font-size: var(--t-label); font-weight: 500; margin-top: 2px; font-variant-numeric: tabular-nums; }
.choice.is-disabled { opacity: .45; pointer-events: none; }

/* ---------------------------------------------------------------- colour swatches */
.swatch-group__current { font-weight: 400; color: var(--muted); }
.swatch-group__options { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 2px; }
.swatch { position: relative; display: block; cursor: pointer; }
.swatch__input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.swatch__dot {
  display: block; width: 32px; height: 32px; border-radius: 50%; background: var(--swatch);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / .14), 0 0 0 0 var(--bg), 0 0 0 0 var(--action);
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease-enter);
}
.swatch:hover .swatch__dot { transform: scale(1.08); }
.swatch__input:checked + .swatch__dot { box-shadow: inset 0 0 0 1px rgb(0 0 0 / .14), 0 0 0 3px var(--bg), 0 0 0 5px var(--action), 0 0 0 6px var(--action-edge); }
.swatch__input:focus-visible + .swatch__dot { box-shadow: inset 0 0 0 1px rgb(0 0 0 / .14), 0 0 0 3px var(--bg), 0 0 0 5px var(--action), 0 0 0 9px color-mix(in oklab, var(--action) 20%, transparent); }

/* ---------------------------------------------------------------- stepper */
.stepper { display: inline-flex; align-items: center; height: var(--control-h); border-radius: var(--r-btn); background: color-mix(in oklab, var(--ink) 6%, transparent); flex: none; }
.stepper__btn { display: grid; place-items: center; width: 40px; height: 100%; padding: 0; border: 0; border-radius: var(--r-btn); background: none; color: var(--ink); transition: background-color var(--dur) var(--ease); }
.stepper__btn:hover:not(:disabled) { background: color-mix(in oklab, var(--ink) 8%, transparent); }
.stepper__btn:disabled { opacity: .35; }
.stepper__btn .icon { width: 16px; height: 16px; }
.stepper__input { width: 40px; height: 100%; padding: 0; border: 0; background: none; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.stepper__input::-webkit-outer-spin-button, .stepper__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper__input:focus-visible { border-radius: var(--r-xs); }
/* in a form the stepper takes the field format: bare − and +, the number between, the line on focus */
/* (ui.js stepper({ line: true }) is also a .control: the row, its line and the accent icon come from
   there; here it only undoes the pill and puts − and + at the end like a field's trailing parts) */
.stepper--line {
  display: flex; width: 100%; height: auto; border-radius: 0; gap: 4px;
  background: linear-gradient(var(--field-line), var(--field-line)) left bottom / 0 2px no-repeat;
}
.stepper--line .control__icon { margin-right: 8px; }
.stepper--line .stepper__input { flex: 1; width: auto; height: var(--control-h); text-align: left; font-weight: 500; }
.stepper--line .stepper__btn { width: 32px; height: 32px; border-radius: var(--r-xs); color: var(--muted); transition: color var(--dur) var(--ease); }
.stepper--line .stepper__btn:last-child { margin-right: -6px; }
.stepper--line .stepper__btn:hover:not(:disabled) { background: none; color: var(--ink); }
/* small (a cart line): bare as well – muted − and +, the number between, no box; the focus ring stays */
.stepper--sm { height: 32px; background: none; }
.stepper--sm .stepper__btn { width: 28px; color: var(--muted); transition: color var(--dur) var(--ease); }
.stepper--sm .stepper__btn:hover:not(:disabled) { background: none; color: var(--ink); }
.stepper--sm .stepper__input { width: 28px; font-size: var(--t-small); }

/* ---------------------------------------------------------------- segmented control */
.segmented {
  display: inline-flex; gap: 2px; padding: 3px; max-width: 100%;
  border-radius: calc(var(--r-btn) + 3px); background: color-mix(in oklab, var(--ink) 6%, transparent);
}
.segmented__item {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 var(--s-4); border: 0; border-radius: var(--r-btn);
  background: none; color: var(--muted); font-size: var(--t-small); font-weight: 500; white-space: nowrap;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.segmented__item:hover { color: var(--ink); }
.segmented__item:is([aria-pressed="true"], [aria-selected="true"]) { background: var(--raised); color: var(--ink); box-shadow: var(--shadow-sm); }
/* the pill that glides to the chosen item (ui/components/segmented.js); with it, the item itself stays clear */
.segmented { position: relative; isolation: isolate; }
.segmented__thumb {
  position: absolute; top: 0; left: 0; z-index: -1; border-radius: var(--r-btn);
  background: var(--raised); box-shadow: var(--shadow-sm); pointer-events: none;
  transition: transform var(--dur-panel) var(--ease-io), width var(--dur-panel) var(--ease-io), height var(--dur-panel) var(--ease-io);
}
.segmented.has-thumb > .segmented__item:is([aria-pressed="true"], [aria-selected="true"]) { background: none; box-shadow: none; }
.segmented--sm .segmented__item { height: 28px; padding: 0 var(--s-3); font-size: var(--t-label); }
.segmented--scroll { overflow-x: auto; scrollbar-width: none; margin-bottom: var(--s-5); }

/* ---------------------------------------------------------------- chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 var(--s-3);
  border: 0; border-radius: var(--r-pill); background: color-mix(in oklab, var(--ink) 7%, transparent);
  font-size: var(--t-small); font-weight: 500; color: var(--ink); white-space: nowrap;
  transition: background-color var(--dur) var(--ease);
}
.chip:hover { background: color-mix(in oklab, var(--ink) 12%, transparent); }
.chip .icon { width: 14px; height: 14px; }

/* ---------------------------------------------------------------- drop zone (file upload) */
.dropzone {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: var(--s-3); min-height: 84px; padding: var(--s-4);
  border: 1px dashed var(--line-strong); border-radius: var(--r-md); background: var(--surface);
  cursor: pointer; transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.dropzone__input { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.dropzone__icon { display: grid; place-items: center; width: 40px; height: 40px; color: var(--ink); transition: color var(--dur) var(--ease); }
.dropzone__icon .icon { width: 28px; height: 28px; }
.dropzone__text { display: grid; gap: 2px; min-width: 0; }
.dropzone__text strong { overflow-wrap: anywhere; }
.dropzone__text span { font-size: var(--t-small); color: var(--muted); }
.dropzone:hover { border-color: var(--muted); background: var(--highlight); }
.dropzone__input:is(:hover, :focus-visible) ~ .dropzone__action { --btn-ink: var(--accent); }
.dropzone:has(.dropzone__input:focus-visible) { box-shadow: var(--focus-ring); }
.dropzone.is-dragging { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.dropzone.has-file { border-style: solid; }
.dropzone.has-file .dropzone__icon { color: var(--success); }
/* the cloud turns yellow: plain yellow at night, graphite on a yellow layer by day (chrome.css "accent icons") */
.dropzone__input:is(:hover, :focus-visible) ~ .dropzone__icon, .dropzone.is-dragging .dropzone__icon { color: var(--accent); }
:root:not([data-theme="dark"]) :is(.dropzone__input:is(:hover, :focus-visible) ~ .dropzone__icon, .dropzone.is-dragging .dropzone__icon) .icon { color: var(--ink); filter: drop-shadow(0 1.6px 0 var(--accent)); }
.dropzone:has(.dropzone__input[aria-invalid="true"]) { border-color: var(--danger); }
@media (max-width: 479px) {
  .dropzone { grid-template-columns: auto minmax(0, 1fr); }
  .dropzone__action { grid-column: 1 / -1; }
}
/* ---------------------------------------------------------------- pill field (search, newsletter)
   ui/components/search.js pillField(): icon · input · clear · divider · action, all inside one pill.
   The pill is the field: its ring shows focus and errors, the input inside has no border of its own. */
.pill-field {
  position: relative; display: flex; align-items: center; gap: 2px;
  height: 48px; padding: 0 5px 0 16px; border-radius: var(--r-pill);
  background: var(--raised); box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.pill-field:hover { box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--ink) 34%, transparent); }
.pill-field:focus-within { box-shadow: inset 0 0 0 2px var(--action), 0 0 0 1px var(--action-edge), 0 0 0 4px color-mix(in oklab, var(--action) 22%, transparent); }
.pill-field:has(.pill-field__input[aria-invalid="true"]) { box-shadow: inset 0 0 0 1.5px var(--danger), 0 0 0 4px color-mix(in oklab, var(--danger) 14%, transparent); }
.pill-field__icon { width: 18px; height: 18px; flex: none; color: var(--muted); transition: color var(--dur) var(--ease), transform var(--dur-panel) var(--ease-enter); }
.pill-field:focus-within .pill-field__icon { color: var(--ink); transform: scale(1.08); }
.pill-field__input {
  flex: 1; min-width: 0; height: 100%; padding: 0 8px 0 10px; border: 0; background: none;
  color: var(--ink); font-size: 15px; font-weight: 500; outline: none; -webkit-appearance: none; appearance: none;
}
.pill-field__input::placeholder { color: var(--muted); font-weight: 400; transition: opacity var(--dur) var(--ease); }
.pill-field__input:focus::placeholder { opacity: .65; }
.pill-field__input:focus-visible { box-shadow: none; }
.pill-field__input::-webkit-search-cancel-button { -webkit-appearance: none; }
.pill-field__hint { flex: none; margin-right: 8px; transition: opacity var(--dur) var(--ease); }
.pill-field:not(.is-empty) .pill-field__hint { display: none; }
.pill-field:focus-within .pill-field__hint { opacity: 0; }
/* clear: a bare ✕ (no disc behind it), muted until the pointer is on it; as big and as bold as the
   arrow beside it, so the two read as one pair */
.pill-field__clear {
  display: grid; place-items: center; flex: none; width: 32px; height: 32px; margin-right: 0; padding: 0;
  border: 0; border-radius: 50%; background: none; color: var(--muted);
  animation: pop-in calc(240ms * var(--motion-scale)) var(--ease-enter);
  transition: color var(--dur) var(--ease);
}
.pill-field__clear:hover { color: var(--ink); }
.pill-field__clear .icon { width: 18px; height: 18px; stroke-width: 2.5; }
.pill-field.is-empty .pill-field__clear { display: none; }
.pill-field__divider { flex: none; width: 1px; height: 22px; margin: 0 6px 0 4px; background: var(--line-strong); }
.pill-field:has(:is(.pill-field__go--accent, .pill-field__go--bare)) .pill-field__divider { display: none; }
.pill-field__go {
  display: grid; place-items: center; flex: none; width: 38px; height: 38px; padding: 0;
  border: 0; border-radius: 50%; background: var(--action); color: var(--action-ink);
  transition: transform var(--dur) var(--ease-enter), background-color var(--dur) var(--ease);
}
.pill-field__go .icon { width: 18px; height: 18px; transition: transform var(--dur) var(--ease); }
.pill-field__go:hover { background: var(--action-hover); color: var(--action-hover-ink); }
.pill-field__go:active { transform: scale(.92); }
.pill-field__go--accent, .pill-field__go--accent:hover { color: var(--accent-ink); }
.pill-field__go--accent { background: var(--accent); }
.pill-field__go--accent:hover { background: color-mix(in oklab, var(--accent) 86%, #ffffff); }
/* bare: just the arrow, no disc and no ring, bold – an accent icon (yellow in both themes, see
   chrome.css "accent icons") */
.pill-field__go--bare { width: 36px; height: 36px; background: none; border-radius: var(--r-sm); }
.pill-field__go--bare:hover { background: none; }
.pill-field__go--bare .icon { width: 22px; height: 22px; stroke-width: 2.75; }
/* a second icon (the check) waits for success: .is-done on the form swaps it in */
.pill-field__go .icon + .icon { display: none; }
.is-done .pill-field__go .icon:first-child { display: none; }
.is-done .pill-field__go .icon + .icon { display: block; animation: pop-in calc(420ms * var(--motion-scale)) var(--ease-enter); }
.pill-field--sm { height: 40px; padding-left: 14px; }
.pill-field--sm .pill-field__icon { width: 16px; height: 16px; }

/* line variant – the format of every search field and the newsletter: no box and, at rest, no line –
   just the icon and the placeholder. On focus a 2px line in the brand yellow draws in from the left, as
   thick and as low as the navigation's underline and with the same motion; an error shows it in red.
   The magnifier becomes an accent icon on focus (chrome.css). */
.pill-field--line {
  --field-line: var(--accent);
  padding: 0 2px; border-radius: 0; box-shadow: none;
  background: linear-gradient(var(--field-line), var(--field-line)) left bottom / 0 2px no-repeat;
  transition: background-size var(--dur-panel) var(--ease);
}
.pill-field--line:hover { box-shadow: none; }
.pill-field--line:focus-within { background-size: 100% 2px; box-shadow: none; }
.pill-field--line:has(.pill-field__input[aria-invalid="true"]) { --field-line: var(--danger); background-size: 100% 2px; box-shadow: none; }
/* its action (the bare arrow) appears once the field is in use – focused or holding text – and slides
   in; after a newsletter sign-up it stays to show the check (.is-done on the form) */
:not(.is-done) > .pill-field--line.is-empty:not(:focus-within) .pill-field__go { display: none; }
.pill-field--line:is(:focus-within, :not(.is-empty)) .pill-field__go { animation: arrow-in calc(260ms * var(--motion-scale)) var(--ease-enter); }
@keyframes arrow-in { from { opacity: 0; transform: translateX(-6px); } }
.pill-field--line:focus-within .pill-field__icon { transform: none; }
.pill-field--line .pill-field__input { padding-left: 12px; font-size: 16px; }
.pill-field--line .pill-field__go { width: 32px; height: 32px; }

/* ---------------------------------------------------------------- range */
.range { display: grid; gap: var(--s-2); }
.range__label { display: flex; justify-content: space-between; font-size: var(--t-small); font-weight: 500; }
.range__label output { font-variant-numeric: tabular-nums; color: var(--muted); }
.range__input { width: 100%; accent-color: var(--action); }

/* ---------------------------------------------------------------- keycaps */
.kbd-group { display: inline-flex; gap: 3px; vertical-align: middle; }
/* Keyboard hints – keycaps, shortcut lists (.keys-only) – only where a keyboard is the way in: not on a
   touch screen (a phone held upright or turned sideways, a tablet) and never on the phone surface. Where
   a keycap stood for closing, touch gets an X instead (tools.css, the palette). */
@media (hover: none) and (pointer: coarse) { :is(.kbd-group, .keys-only) { display: none !important; } }
[data-surface="mobile"] :is(.kbd-group, .keys-only) { display: none !important; }
.kbd {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 6px; background: var(--raised); color: var(--muted);
  box-shadow: inset 0 -1px 0 var(--line-strong), 0 0 0 1px var(--line);
  font: 500 12px/1 var(--font-mono);
}

/* ---------------------------------------------------------------- password strength */
.strength { display: flex; align-items: center; gap: var(--s-3); margin-top: calc(-1 * var(--s-3)); font-size: var(--t-label); color: var(--muted); }
.strength__bars { display: flex; gap: 4px; }
.strength__bars span { width: 36px; height: 4px; border-radius: 2px; background: color-mix(in oklab, var(--ink) 12%, transparent); transition: background-color var(--dur) var(--ease); }
.strength[data-strength="1"] .strength__bars span:nth-child(-n + 1) { background: var(--danger); }
.strength[data-strength="2"] .strength__bars span:nth-child(-n + 2) { background: var(--warn); }
.strength[data-strength="3"] .strength__bars span { background: var(--success); }
