/* 01-components.css — the design system's components (task 100). Linked after 01-base.css.
   Every class is `.ui-<block>` with BEM elements and modifiers (`.ui-btn--primary`, `.ui-stat__value`); a state is an
   ARIA attribute where one exists (aria-pressed, aria-selected, aria-current, aria-invalid, aria-busy, aria-sort),
   not a class. A component reads ONLY the semantic tokens of 00-tokens.css — no palette name, no colour literal:
   DesignSystemTests fails on a hex, rgb() or hsl() in this file. None depends on Bootstrap. Every one of them, in
   every state and in both themes, is on /Design. */

/* ── Numbers ─────────────────────────────────────────────── */
.ui-num,
.ui-stat__value,
.ui-change,
.ui-table,
.ui-kv dd,
.ui-pagination {
  font-variant-numeric: tabular-nums;
}

/* ── Buttons ─────────────────────────────────────────────── */
.ui-btn {
  --btn-bg: var(--surface-3);
  --btn-fg: var(--text);
  --btn-bg-hover: color-mix(in srgb, var(--surface-3) 80%, var(--text));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  position: relative;
  height: var(--control-md);
  padding: 0 var(--space-4);
  border: 0;
  border-radius: var(--radius-2);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: inherit;
  font-size: var(--text-md);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--duration-1) var(--ease), transform var(--duration-1) var(--ease);
}

.ui-btn:hover {
  background: var(--btn-bg-hover);
  color: var(--btn-fg);
}

.ui-btn:active {
  transform: scale(0.97);
}

.ui-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.ui-btn:disabled,
.ui-btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.ui-btn--primary {
  --btn-bg: var(--accent);
  --btn-fg: var(--accent-contrast);
  --btn-bg-hover: var(--accent-hover);
}

.ui-btn--secondary {
  --btn-bg: var(--surface-3);
  --btn-fg: var(--text);
}

.ui-btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--text-muted);
  --btn-bg-hover: var(--surface-2);
}

.ui-btn--ghost:hover {
  color: var(--text);
}

.ui-btn--danger {
  --btn-bg: var(--down);
  --btn-fg: var(--down-contrast);
  --btn-bg-hover: color-mix(in srgb, var(--down) 85%, var(--text));
}

.ui-btn--sm {
  height: var(--control-sm);
  padding: 0 var(--space-3);
  font-size: var(--text-sm);
}

.ui-btn--lg {
  height: var(--control-lg);
  padding: 0 var(--space-5);
  font-size: var(--text-lg);
}

/* A square icon button; its name is in aria-label. */
.ui-btn--icon {
  width: var(--control-md);
  padding: 0;
}

.ui-btn--icon.ui-btn--sm {
  width: var(--control-sm);
}

.ui-btn svg {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Loading: the label keeps the button's width, a spinner sits over it. */
.ui-btn[aria-busy="true"] {
  color: transparent;
  pointer-events: none;
}

.ui-btn[aria-busy="true"]::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 14px;
  height: 14px;
  border: 2px solid var(--btn-fg);
  border-right-color: transparent;
  border-radius: 50%;
  animation: ui-spin 0.7s linear infinite;
}

/* A busy button that says what it is doing (task 188, data-busy-label — /Account's «Зберігається…»): the words stay,
   the spinner follows them. */
.ui-btn[aria-busy="true"][data-busy-label] {
  color: var(--btn-fg);
  gap: var(--space-2);
}

.ui-btn[aria-busy="true"][data-busy-label]::after {
  position: static;
  margin: 0;
}

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

/* ── Form fields ─────────────────────────────────────────── */
.ui-field {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
}

.ui-label {
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 600;
}

.ui-input,
.ui-select {
  width: 100%;
  height: var(--control-md);
  padding: 0 var(--space-3);
  border: 1px solid transparent;
  border-radius: var(--radius-2);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  /* 16 px on a phone (iOS zooms into a smaller field), --text-md from 901 px (00-tokens.css). */
  font-size: var(--field-font);
  transition: border-color var(--duration-1) var(--ease), background-color var(--duration-1) var(--ease);
}

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

.ui-input:hover,
.ui-select:hover {
  border-color: var(--border-strong);
}

.ui-input:focus-visible,
.ui-select:focus-visible {
  outline: none;
  border-color: var(--focus-ring);
  background: var(--surface-1);
}

.ui-input:disabled,
.ui-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ui-input[aria-invalid="true"],
.ui-select[aria-invalid="true"] {
  border-color: var(--down);
}

.ui-select {
  appearance: none;
  padding-right: var(--space-7);
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
                    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.ui-search {
  position: relative;
  display: block;
}

.ui-search .ui-input {
  padding-left: var(--space-7);
}

.ui-search svg {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  width: 14px;
  height: 14px;
  translate: 0 -50%;
  fill: none;
  stroke: var(--text-faint);
  stroke-width: 2;
  pointer-events: none;
}

.ui-hint {
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.ui-error {
  color: var(--down);
  font-size: var(--text-xs);
  font-weight: 600;
}

/* Checkbox, radio, switch: the native input, drawn by accent-color or as a switch; the label wraps it. */
.ui-check,
.ui-radio,
.ui-switch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text);
  font-size: var(--text-md);
  cursor: pointer;
}

/* Under a finger the label is the target: a 44 px row. The desktop keeps its dense rows. */
@media (max-width: 900px), (pointer: coarse) {
  .ui-check,
  .ui-radio,
  .ui-switch {
    min-height: var(--touch);
  }
}

.ui-check input,
.ui-radio input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
  cursor: inherit;
}

.ui-check input:focus-visible,
.ui-radio input:focus-visible,
.ui-switch input:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.ui-check:has(input:disabled),
.ui-radio:has(input:disabled),
.ui-switch:has(input:disabled) {
  opacity: 0.5;
  cursor: not-allowed;
}

.ui-switch input {
  appearance: none;
  position: relative;
  width: 32px;
  height: 18px;
  margin: 0;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  cursor: inherit;
  transition: background-color var(--duration-2) var(--ease);
}

.ui-switch input::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: translate var(--duration-2) var(--ease), background-color var(--duration-2) var(--ease);
}

.ui-switch input:checked {
  background: var(--accent);
}

.ui-switch input:checked::before {
  translate: 14px 0;
  background: var(--accent-contrast);
}

/* ── Tabs ────────────────────────────────────────────────── */
.ui-tabs {
  display: flex;
  gap: var(--space-4);
  box-shadow: inset 0 -1px 0 var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.ui-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: none;
  min-height: var(--control-sm);
  padding: var(--space-2) 0;
  border: 0;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: var(--text-md);
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}

.ui-tab:hover {
  color: var(--text);
}

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

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

.ui-tab:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-1);
}

.ui-tab__count {
  margin-left: var(--space-1);
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.ui-tabs--pill {
  gap: var(--space-1);
  box-shadow: none;
}

.ui-tabs--pill .ui-tab {
  padding: 6px var(--space-3);
  border-radius: var(--radius-2);
}

.ui-tabs--pill .ui-tab[aria-selected="true"],
.ui-tabs--pill .ui-tab[aria-current="page"] {
  background: var(--surface-3);
}

.ui-tabs--pill .ui-tab::after {
  content: none;
}

/* ── Segmented control (7Д · 30Д · 3М …) ─────────────────── */
.ui-segmented {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: var(--radius-2);
  background: var(--surface-2);
}

.ui-segmented__option {
  min-width: var(--control-sm);
  height: var(--control-sm);
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-1);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: color var(--duration-1) var(--ease), background-color var(--duration-1) var(--ease);
}

.ui-segmented__option:hover {
  color: var(--text);
}

/* A link as an option (/Notifications' «Детально / Компактно», task 139): the current one is aria-current. */
a.ui-segmented__option {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.ui-segmented__option[aria-current="true"],
.ui-segmented__option[aria-current="page"],
.ui-segmented__option[aria-pressed="true"] {
  background: var(--surface-3);
  color: var(--text);
}

.ui-segmented__option:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

/* A count in an option («Набори 29 | Мініфігурки 58», task 186; /Wishlist's): --text-faint on the pressed option's
   --surface-3 was 3.5 : 1 (impeccable detect, light theme) — the option's own muted tone. */
.ui-segmented__option .ui-tab__count {
  color: var(--text-muted);
}

/* ── Chips, badges, change ───────────────────────────────── */
.ui-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  height: 20px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-1);
  background: var(--surface-3);
  color: var(--text);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.ui-chip--muted { background: var(--surface-2); color: var(--text-muted); }
.ui-chip--up { background: var(--up-bg); color: var(--up); }
.ui-chip--down { background: var(--down-bg); color: var(--down); }
.ui-chip--warn { background: var(--warn-bg); color: var(--warn); }
.ui-chip--info { background: var(--info-bg); color: var(--info); }
.ui-chip--accent { background: var(--accent); color: var(--accent-contrast); }

/* A status dot before the text. */
.ui-chip__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* A count on a tab, a menu item or a link. */
.ui-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: var(--text-xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ui-badge--neutral { background: var(--surface-3); color: var(--text); }

/* A signed change: green up, red down, an arrow before it; flat is muted with no arrow. */
.ui-change {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.ui-change--up { color: var(--up); }
.ui-change--down { color: var(--down); }
.ui-change--up::before { content: "▲"; font-size: 0.7em; }
.ui-change--down::before { content: "▼"; font-size: 0.7em; }

.ui-change--fill {
  padding: 2px 6px;
  border-radius: var(--radius-1);
}

.ui-change--fill.ui-change--up { background: var(--up-bg); }
.ui-change--fill.ui-change--down { background: var(--down-bg); }

/* ── Card / panel ────────────────────────────────────────── */
.ui-card {
  border-radius: var(--radius-3);
  background: var(--surface-1);
  box-shadow: var(--shadow-1);
  color: var(--text);
}

.ui-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  box-shadow: inset 0 -1px 0 var(--border);
}

.ui-card__title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 700;
}

.ui-card__body {
  padding: var(--space-4);
}

/* A panel is a card without its own head, one step deeper: a block inside a card. */
.ui-panel {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-2);
  background: var(--surface-2);
}

/* ── Stat tile ───────────────────────────────────────────── */
.ui-stat {
  display: grid;
  gap: var(--space-1);
  align-content: start;
  min-width: 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-3);
  background: var(--surface-1);
  box-shadow: var(--shadow-1);
}

.ui-stat__label {
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
}

.ui-stat__value {
  color: var(--text);
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.ui-stat__value small {
  margin-left: 2px;
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 600;
}

.ui-stat__change {
  font-size: var(--text-sm);
}

/* ── Table ───────────────────────────────────────────────── */
/* The wrapper scrolls; the head sticks to its top. */
.ui-table-wrap {
  max-height: var(--ui-table-height, none);
  overflow: auto;
  border-radius: var(--radius-3);
  background: var(--surface-1);
  box-shadow: var(--shadow-1);
}

.ui-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--text);
  font-size: var(--text-md);
}

.ui-table th,
.ui-table td {
  padding: var(--space-2) var(--space-3);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.ui-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-1);
  box-shadow: inset 0 -1px 0 var(--border);
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
}

.ui-table tbody td {
  box-shadow: inset 0 -1px 0 var(--border);
}

.ui-table tbody tr:last-child td {
  box-shadow: none;
}

.ui-table tbody tr:hover td {
  background: var(--surface-2);
}

.ui-table .ui-num,
.ui-table th.ui-num {
  text-align: right;
}

/* A sortable header: the whole cell is a button, the arrow says the direction; aria-sort is on the <th>. */
.ui-sort {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--control-sm);
  min-width: var(--control-sm);
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.ui-sort:hover,
[aria-sort="ascending"] > .ui-sort,
[aria-sort="descending"] > .ui-sort {
  color: var(--text);
}

.ui-sort::after {
  content: "↕";
  color: var(--text-faint);
  font-size: 0.9em;
}

[aria-sort="ascending"] > .ui-sort::after { content: "↑"; color: var(--accent-text); }
[aria-sort="descending"] > .ui-sort::after { content: "↓"; color: var(--accent-text); }

.ui-sort:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-1);
}

/* ── Meter (task 187) — a share of a whole drawn as a bar: one segment (BrickLink's day spent, the sets whose figures are
   known) or several stacked (the prices' age). The bar is role="img" with its words in aria-label; the legend under it
   prints the same counts, so nothing is read off the colour alone. Each segment's width is an inline style. ─ */
.ui-meter {
  display: flex;
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--surface-3);
}

.ui-meter__bar {
  flex: none;
  min-width: 0;
  height: 100%;
  background: var(--text-muted);
}

.ui-meter__bar + .ui-meter__bar {
  box-shadow: inset 1px 0 0 var(--surface-1);
}

.ui-meter__bar--up,
.ui-meter__key--up { background: var(--up); }
.ui-meter__bar--info,
.ui-meter__key--info { background: var(--info); }
.ui-meter__bar--warn,
.ui-meter__key--warn { background: var(--warn); }
.ui-meter__bar--down,
.ui-meter__key--down { background: var(--down); }
.ui-meter__bar--muted,
.ui-meter__key--muted { background: var(--text-faint); }

.ui-meter__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  margin: var(--space-2) 0 0;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

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

.ui-meter__legend strong {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ui-meter__key {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--text-muted);
}

/* ── Key–value list ──────────────────────────────────────── */
.ui-kv {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2) var(--space-4);
  margin: 0;
  font-size: var(--text-md);
}

.ui-kv dt {
  color: var(--text-muted);
  font-weight: 400;
}

.ui-kv dd {
  margin: 0;
  color: var(--text);
  font-weight: 600;
  text-align: right;
}

/* ── Dropdown menu (a <details>, so it works without script) ─ */
.ui-menu {
  position: relative;
  display: inline-block;
}

.ui-menu > summary {
  list-style: none;
}

.ui-menu > summary::-webkit-details-marker {
  display: none;
}

.ui-menu__list {
  position: absolute;
  top: calc(100% + var(--space-1));
  right: 0;
  z-index: 20;
  display: grid;
  gap: 2px;
  min-width: 180px;
  padding: var(--space-1);
  border-radius: var(--radius-3);
  background: var(--surface-1);
  box-shadow: var(--shadow-2);
}

.ui-menu__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  min-height: var(--control-sm);
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: var(--radius-2);
  background: none;
  color: var(--text);
  font: inherit;
  font-size: var(--text-md);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.ui-menu__item:hover,
.ui-menu__item:focus-visible {
  background: var(--surface-2);
  outline: none;
}

.ui-menu__item--danger {
  color: var(--down);
}

.ui-menu__separator {
  height: 1px;
  margin: var(--space-1) 0;
  background: var(--border);
}

/* A menu's parts since task 125 (the header's account menu): an icon before an item's word, the current page marked, a
   caption over a group, and a row that holds a control rather than being one (the theme switch). */
.ui-menu__item .ui-icon {
  color: var(--text-muted);
}

.ui-menu__item--danger .ui-icon {
  color: inherit;
}

.ui-menu__item[aria-current="page"] {
  background: var(--surface-2);
  color: var(--accent-text);
}

.ui-menu__item[aria-current="page"] .ui-icon {
  color: inherit;
}

.ui-menu__group {
  display: grid;
  gap: 2px;
}

.ui-menu__label {
  padding: var(--space-1) var(--space-3) 2px;
  color: var(--text-faint);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ui-menu__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: var(--control-sm);
  padding: var(--space-1) var(--space-1) var(--space-1) var(--space-3);
  color: var(--text);
  font-size: var(--text-md);
}

.ui-menu__row-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.ui-menu__row-label .ui-icon {
  color: var(--text-muted);
}

/* ── Icon (task 125) — the navigation's line icons on the bottom bar's grid: 24 × 24, a 1.75 stroke, no fill ─ */
.ui-icon {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ui-icon__fill {
  fill: currentColor;
  stroke: none;
}

/* ── Avatar and profile (task 125) — the account's first letter in a circle, beside its address and role; --icon a person
   instead of the letter (the header's account button); --photo the account's picture (task 145) ─ */
.ui-avatar {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: var(--text-md);
  font-weight: 700;
  line-height: 1;
  user-select: none;
}

/* A person instead of the letter: the header's account button (task 125, the owner's «іконку користувача»). */
.ui-avatar--icon .ui-icon {
  stroke-width: 2;
}

.ui-avatar--lg {
  width: 48px;
  height: 48px;
  font-size: var(--text-xl);
}

/* /Account's head (task 188): the circle the profile is about. */
.ui-avatar--xl {
  width: 80px;
  height: 80px;
  font-size: var(--text-2xl);
}

/* A letter on its account's own colour (task 188, AccountInitial.HueOf): the charts' five hues — not their grey —, the
   letter in the hue on a tint of it, ≥ 4.5:1 in both themes (measured in Tasks/188-nav-and-profile.md). */
.ui-avatar--hue-1 { --avatar-hue: var(--chart-1); }
.ui-avatar--hue-2 { --avatar-hue: var(--chart-2); }
.ui-avatar--hue-3 { --avatar-hue: var(--chart-4); }
.ui-avatar--hue-4 { --avatar-hue: var(--chart-5); }
.ui-avatar--hue-5 { --avatar-hue: var(--chart-6); }

[class*="ui-avatar--hue-"] {
  background: color-mix(in srgb, var(--avatar-hue) 14%, var(--surface-1));
  /* The hue a quarter toward the text colour: the light theme's chart hues alone are 4.1–4.4:1 on their tint. */
  color: color-mix(in srgb, var(--avatar-hue) 75%, var(--text));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--avatar-hue) 30%, transparent);
}

/* The account's own picture instead of the letter (task 145): a square the browser cropped, shown in the circle. */
.ui-avatar--photo {
  overflow: hidden;
  background: var(--surface-2);
}

.ui-avatar__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ui-profile {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.ui-profile__text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ui-profile__name {
  overflow: hidden;
  color: var(--text);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-profile__meta {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* ── Provider mark (task 163) — <provider-mark> (Services/Presentation/ProviderMarkTagHelper), the only way a page draws
   a source. A tile on the --mark-* steps: the provider's own square icon filling it, else its letters (__mono) or a
   shop (__glyph) on --surface-3; --wide adds the name on the same line, a third of the tile apart. ─ */
.ui-provider {
  display: inline-flex;
  align-items: center;
  gap: calc(var(--mark) / 3);
  min-width: 0;
  max-width: 100%;
  vertical-align: middle;
}

.ui-provider--20 { --mark: var(--mark-20); }
.ui-provider--24 { --mark: var(--mark-24); }
.ui-provider--32 { --mark: var(--mark-32); }
.ui-provider--48 { --mark: var(--mark-48); }

.ui-provider__tile {
  display: grid;
  flex: none;
  place-items: center;
  width: var(--mark);
  height: var(--mark);
  overflow: hidden;
  border-radius: var(--mark-radius);
  background: var(--surface-3);
  color: var(--text);
}

/* Two classes deep: a photo frame's `.frame img` (its --photo-inset) must not reach the mark's own picture. */
.ui-provider .ui-provider__tile > img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
}

/* Letters stand in for a logo, so they never outweigh a row's title: muted, 600, 8 px at least (the 20 px tile). */
.ui-provider__mono {
  color: var(--text-muted);
  font-size: max(8px, calc(var(--mark) * 0.36));
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  user-select: none;
}

.ui-provider__glyph {
  width: 64%;
  height: 64%;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ui-provider__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Navigation list (task 125) — the phone's «Ще»: groups under a caption, inset on --surface-2, rows of 52 px with an
   icon and, on a link, a chevron; the current row and its group's caption in the accent; --danger the red row. ─ */
.ui-navlist {
  display: grid;
  gap: var(--space-1);
}

.ui-navlist__label {
  margin: 0;
  padding: 0 var(--space-3);
  color: var(--text-faint);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ui-navlist[aria-current="true"] .ui-navlist__label {
  color: var(--accent-text);
}

.ui-navlist__group {
  display: grid;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-3);
  background: var(--surface-2);
}

.ui-navlist__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 52px;
  padding: var(--space-2) var(--space-3);
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: var(--text-lg);
  text-align: left;
  text-decoration: none;
}

/* A hairline between rows, from the text, as the phone's cells draw it. */
.ui-navlist__item + .ui-navlist__item::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: calc(var(--space-3) + 20px + var(--space-3));
  height: 1px;
  background: var(--border);
}

a.ui-navlist__item::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin: 0 var(--space-1) 0 auto;
  border-top: 2px solid var(--text-faint);
  border-right: 2px solid var(--text-faint);
  rotate: 45deg;
}

a.ui-navlist__item,
button.ui-navlist__item {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

a.ui-navlist__item:hover,
button.ui-navlist__item:hover,
a.ui-navlist__item:active,
button.ui-navlist__item:active {
  background: var(--surface-3);
}

.ui-navlist__item:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

.ui-navlist__item .ui-icon {
  color: var(--text-muted);
}

.ui-navlist__text {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
}

.ui-navlist__item[aria-current="page"] {
  color: var(--accent-text);
}

.ui-navlist__item[aria-current="page"] .ui-icon {
  color: inherit;
}

.ui-navlist__item--danger,
.ui-navlist__item--danger .ui-icon {
  color: var(--down);
}

.ui-navlist__item--danger .ui-navlist__text {
  flex: none;
}

/* ── Sheet (side panel) and modal: a <dialog>; the set edit panel (11-edit-panel.css) is the first of them ─ */
.ui-sheet,
.ui-modal {
  padding: 0;
  border: 0;
  background: var(--surface-1);
  color: var(--text);
  box-shadow: var(--shadow-2);
}

.ui-sheet::backdrop,
.ui-modal::backdrop {
  background: var(--overlay);
}

.ui-sheet {
  margin: 0 0 0 auto;
  width: min(480px, 100vw);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
}

.ui-modal {
  width: min(520px, calc(100vw - 32px));
  border-radius: var(--radius-3);
}

.ui-sheet__head,
.ui-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
  box-shadow: inset 0 -1px 0 var(--border);
}

.ui-sheet__title,
.ui-modal__title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 700;
}

.ui-sheet__body,
.ui-modal__body {
  padding: var(--space-4);
}

.ui-sheet__foot,
.ui-modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  box-shadow: inset 0 1px 0 var(--border);
}

/* /Design shows them in the page, not over it. */
.ui-sheet--inline,
.ui-modal--inline {
  position: static;
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 0;
  border-radius: var(--radius-3);
}

/* ── Toast ───────────────────────────────────────────────── */
.ui-toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  width: min(360px, calc(100vw - 32px));
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-3);
  background: var(--surface-2);
  box-shadow: var(--shadow-2), inset 3px 0 0 var(--toast-accent, var(--info));
  color: var(--text);
  font-size: var(--text-md);
}

.ui-toast__title {
  margin: 0 0 2px;
  font-weight: 700;
}

.ui-toast__text {
  margin: 0;
  color: var(--text-muted);
}

.ui-toast--up { --toast-accent: var(--up); }
.ui-toast--down { --toast-accent: var(--down); }
.ui-toast--warn { --toast-accent: var(--warn); }

/* The app's toasts (task 188, toast.js): a column at the window's bottom right from 901 px, over the bottom bar and the
   width of the screen on a phone; above the edit panel and the sheets, under nothing. The list lets clicks through
   where it has no toast. */
.ui-toasts {
  position: fixed;
  right: var(--space-5);
  bottom: var(--space-5);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
  pointer-events: none;
}

/* A real box, not display: contents — some engines drop the role and the live region of a box-less element; never
   display: none while empty, which takes the region out of the tree. */
.ui-toasts__list {
  display: flex;
  flex-direction: column;
  align-items: inherit;
  gap: var(--space-2);
}

/* /Admin/Design shows the list in its page. */
.ui-toasts--inline {
  position: static;
  align-items: flex-start;
}

/* A floating toast says its kind by its icon in the kind's colour, not by a rule down its side. */
.ui-toast--float {
  align-items: center;
  pointer-events: auto;
  padding-right: var(--space-1);
  box-shadow: var(--shadow-2);
}

.ui-toast__icon {
  color: var(--toast-accent, var(--info));
}

.ui-toast--float .ui-toast__text {
  flex: 1;
  min-width: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.ui-toast__close {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: var(--touch);
  height: var(--touch);
  margin: calc(var(--space-2) * -1) 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-2);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
}

.ui-toast__close:hover {
  background: var(--surface-3);
  color: var(--text);
}

.ui-toast__close:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

.ui-toast__close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
}

.ui-toast[data-state="in"] {
  animation: ui-toast-in var(--duration-2) var(--ease);
}

.ui-toast[data-state="out"] {
  animation: ui-toast-out var(--duration-2) var(--ease) forwards;
}

@keyframes ui-toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

@keyframes ui-toast-out {
  to { opacity: 0; transform: translateY(8px); }
}

@media (prefers-reduced-motion: reduce) {
  .ui-toast[data-state] {
    animation: none;
  }
}

@media (max-width: 900px) {
  .ui-toasts {
    right: max(var(--space-3), env(safe-area-inset-right, 0px));
    bottom: calc(var(--tabbar-space) + var(--space-3));
    left: max(var(--space-3), env(safe-area-inset-left, 0px));
    align-items: stretch;
  }

  .ui-toast--float {
    width: auto;
  }
}

/* Without script (task 188): the same message as a banner at the top of the page, in its flow, never timed away. */
.app-status {
  width: auto;
  max-width: 720px;
  margin: 0 0 var(--space-5);
  border: 1px solid color-mix(in srgb, var(--toast-accent, var(--info)) 45%, var(--border));
  background: color-mix(in srgb, var(--toast-accent, var(--info)) 8%, var(--surface-2));
  box-shadow: none;
}

.app-status .ui-toast__text {
  color: var(--text);
}

/* ── Empty state ─────────────────────────────────────────── */
.ui-empty {
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  padding: var(--space-8) var(--space-4);
  color: var(--text-muted);
  text-align: center;
}

.ui-empty__title {
  margin: 0;
  color: var(--text);
  font-size: var(--text-lg);
  font-weight: 700;
}

.ui-empty__text {
  margin: 0;
  max-width: 40ch;
  font-size: var(--text-md);
}

/* ── Skeleton ────────────────────────────────────────────── */
.ui-skeleton {
  display: block;
  height: 12px;
  border-radius: var(--radius-1);
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: ui-shimmer 1.4s ease-in-out infinite;
}

.ui-skeleton--text { width: 60%; }
.ui-skeleton--title { width: 40%; height: 18px; }
.ui-skeleton--block { height: 96px; border-radius: var(--radius-3); }

@keyframes ui-shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

/* ── Tooltip: the bubble is a role="tooltip" element the trigger names in aria-describedby ─ */
.ui-tooltip {
  position: relative;
  display: inline-flex;
}

.ui-tooltip__bubble {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  z-index: 30;
  width: max-content;
  max-width: 240px;
  padding: 6px var(--space-2);
  border-radius: var(--radius-2);
  background: var(--text);
  color: var(--surface-1);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 1.35;
  white-space: normal;
  translate: -50% 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-1) var(--ease), translate var(--duration-1) var(--ease);
}

.ui-tooltip:hover .ui-tooltip__bubble,
.ui-tooltip:focus-within .ui-tooltip__bubble,
.ui-tooltip--open .ui-tooltip__bubble {
  translate: -50% 0;
  opacity: 1;
}

/* ── Pagination ──────────────────────────────────────────── */
.ui-pagination {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ui-pagination__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--control-sm);
  height: var(--control-sm);
  padding: 0 var(--space-2);
  border-radius: var(--radius-1);
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
}

a.ui-pagination__item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.ui-pagination__item[aria-current="page"] {
  background: var(--accent);
  color: var(--accent-contrast);
}

.ui-pagination__item[aria-disabled="true"] {
  opacity: 0.4;
}

a.ui-pagination__item:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

/* ── Breadcrumbs ─────────────────────────────────────────── */
.ui-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.ui-breadcrumbs li + li::before {
  content: "/";
  margin-right: var(--space-1);
  color: var(--text-faint);
}

.ui-breadcrumbs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--control-sm);
  min-height: var(--control-sm);
  color: var(--text-muted);
  text-decoration: none;
}

.ui-breadcrumbs a:hover {
  color: var(--text);
}

.ui-breadcrumbs [aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

/* ── Search results (task 130) — the header search's list and the /Search page: groups under a caption with their count,
   lines of a 40 px picture (or an icon), a title and a grey line, the account's chips at the end; «Усі результати»
   after a group. In the header the lines are a listbox's options and the active one is aria-selected. ─ */
.ui-results {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-2);
}

.ui-results__group {
  display: grid;
  gap: 2px;
}

.ui-results__label {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin: 0;
  padding: var(--space-2) var(--space-2) var(--space-1);
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ui-results__count {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: 0;
}

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

.ui-results__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--touch);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-2);
  color: var(--text);
  text-decoration: none;
}

.ui-results__item:hover,
.ui-results__item[aria-selected="true"],
.ui-results__more:hover,
.ui-results__more[aria-selected="true"] {
  background: var(--surface-2);
  color: var(--text);
}

.ui-results__item[aria-selected="true"] {
  box-shadow: inset 2px 0 0 var(--accent);
}

.ui-results__item:focus-visible,
.ui-results__more:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

.ui-results__img,
.ui-results__icon {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-1);
}

/* The img is its own frame, so the token's 7 % would resolve against the whole row and clamp to 8 px of a 40 px box:
   the inset is the token's floor here. */
.ui-results__img {
  --photo-inset: 4px;
  padding: var(--photo-inset);
  object-fit: contain;
  background: var(--photo-bg);
}

.ui-results__icon {
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--text-muted);
}

.ui-results__text {
  display: grid;
  flex: 1;
  min-width: 0;
}

.ui-results__title,
.ui-results__meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-results__title {
  font-size: var(--text-md);
  font-weight: 600;
}

.ui-results__meta {
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.ui-results__more {
  display: flex;
  align-items: center;
  min-height: var(--touch); /* the rows' height: «Усі результати» was 36 px, under the phone's floor on /Search (task 186) */
  margin: 0;
  padding: 0 var(--space-2);
  border-radius: var(--radius-2);
  color: var(--accent-text);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
}

p.ui-results__more {
  color: var(--text-muted);
  font-weight: 400;
}

.ui-results__empty {
  margin: 0;
  padding: var(--space-5) var(--space-3);
  color: var(--text-muted);
  font-size: var(--text-md);
  text-align: center;
}

/* The keys under the list (↑↓, Enter, Esc); a pointer-only screen has none to press. */
.ui-results__hint {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: var(--text-xs);
}

@media (pointer: coarse) {
  .ui-results__hint {
    display: none;
  }
}

/* The /Search page: the groups as cards side by side, two from 901 px. */
.ui-results--page {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
  align-items: start;
  gap: var(--space-4);
  padding: 0;
}

.ui-results--page .ui-results__group {
  padding: var(--space-2);
  border-radius: var(--radius-3);
  background: var(--surface-1);
  box-shadow: var(--shadow-1);
}

/* A key, as the hint over a field or in a list's foot shows it. */
.ui-kbd {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 var(--space-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-1);
  background: var(--surface-1);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1;
}

/* ── Footer (tasks 132, 191) ─────────────────────────────────
   The app's foot (Pages/Shared/_Footer): two rows, no columns. Phone first — the name and «Приватність» on one row, © and
   the LEGO line under it, each link a --control-sm target (44 px under a finger); from 901 px the name and the sections
   on the first row, © and «Приватність» (+ «Адміністрування») on the second, the links' ends aligned. .ui-footer__desktop
   is what the phone leaves to the bottom bar and «Ще». The page's width is the shell's (.app-footer__inner, 01-base.css),
   not the component's. */
.ui-footer {
  flex: none;
  background: var(--surface-1);
  box-shadow: 0 -1px 0 var(--border);
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.45;
}

.ui-footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "name end"
    "legal legal";
  align-items: center;
  column-gap: var(--space-4);
  padding-block: var(--space-2) var(--space-4);
}

.ui-footer__name {
  grid-area: name;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  justify-self: start;
  min-height: var(--control-sm);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.ui-footer__mark {
  flex: none;
  fill: var(--accent);
}

.ui-footer__nav {
  grid-area: nav;
  min-width: 0;
}

.ui-footer__end {
  grid-area: end;
}

.ui-footer__legal {
  grid-area: legal;
  margin: 0;
  font-size: var(--text-xs);
  text-wrap: pretty;
}

.ui-footer__links {
  display: flex;
  flex-wrap: wrap;
  column-gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ui-footer__link {
  display: inline-flex;
  align-items: center;
  min-width: var(--control-sm);
  min-height: var(--control-sm);
  color: var(--text-muted);
  text-decoration: none;
}

.ui-footer__link:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ui-footer__link:focus-visible,
.ui-footer__name:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-1);
}

@media (max-width: 900px) {
  .ui-footer__desktop {
    display: none;
  }

  /* Signed out a phone has no bottom bar (whose space holds the home indicator's): the footer is the page's last edge. */
  body:not(:has(> .app-tabbar)) .ui-footer__inner {
    padding-bottom: calc(var(--space-4) + var(--safe-bottom));
  }
}

@media (min-width: 901px) {
  /* The links' column is as wide as its links, so the sections never wrap; © wraps in what is left (two lines at 901 px). */
  .ui-footer__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name nav"
      "legal end";
    column-gap: var(--space-6);
    row-gap: var(--space-1);
    padding-block: var(--space-3);
  }

  .ui-footer__nav,
  .ui-footer__end {
    justify-self: end;
  }

  /* «Приватність» on ©'s first line when it wraps (901–1 024 px), not halfway down its two: one baseline. */
  .ui-footer__legal,
  .ui-footer__end {
    align-self: first baseline;
  }

  .ui-footer__nav .ui-footer__links {
    justify-content: flex-end;
  }

  /* Signed out there are no sections: «Приватність» takes their place beside the name, © the row under them. */
  .ui-footer__inner:not(:has(.ui-footer__nav)) {
    grid-template-areas:
      "name end"
      "legal legal";
  }
}

/* ── Mobile patterns (task 105) ───────────────────────────────
   Phone first: each block below is the phone's, and a min-width query turns it into the desktop's. The breakpoints are
   the numbers of 00-tokens.css — ≤ 480 phone, 481 – 900 tablet, ≥ 901 desktop. */

/* Bottom tab bar: the phone's navigation, ≤ 900 px. Five sections and «Ще» (a button opening a bottom sheet; task 188
   added «Фігурки»). The current one is aria-current. No item carries a count since task 139: the alerts' is the header bell's. */
.ui-tabbar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  display: grid;
  /* Six since task 188: a column is its words' width and the rest of the row shared evenly — at 390 px equal columns
     (64 px) cut «Мої набори» (66 px), while «Ще» needs 19; never under the 44 px touch floor. */
  grid-auto-columns: minmax(var(--touch), auto);
  grid-auto-flow: column;
  height: var(--tabbar-space);
  padding: 0 max(var(--space-1), env(safe-area-inset-right, 0px)) var(--safe-bottom) max(var(--space-1), env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--surface-1) 94%, transparent);
  box-shadow: 0 -1px 0 var(--border);
  backdrop-filter: saturate(1.4) blur(14px);
}

.ui-tabbar__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  min-height: var(--touch);
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--duration-1) var(--ease), transform var(--duration-1) var(--ease);
}

.ui-tabbar__item:hover {
  color: var(--text);
}

.ui-tabbar__item:active {
  transform: scale(0.94);
}

.ui-tabbar__item[aria-current="page"] {
  color: var(--accent-text);
}

.ui-tabbar__item:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -4px;
  border-radius: var(--radius-2);
}

/* The bar's icons are _NavIcon's (.ui-icon, task 188 — the header's set), a size up. */
.ui-tabbar__item .ui-icon {
  width: 22px;
  height: 22px;
}

.ui-tabbar__item[aria-current="page"] .ui-icon {
  stroke-width: 2.1;
}

/* Its own line height: the item's 1 with overflow hidden cut the descenders of «Moje zestawy», «Życzenia», «Więcej»
   (task 194 — the Ukrainian labels have none, so it never showed). */
.ui-tabbar__label {
  max-width: 100%;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 901px) {
  .ui-tabbar {
    display: none;
  }
}

/* Bottom sheet: a [popover] or a <dialog> rising from the bottom edge on a phone, a centred panel from 901 px. The
   grip is decoration; Esc and a tap outside close a popover without script. */
.ui-sheet--bottom {
  position: fixed;
  inset: auto 0 0;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: calc(100dvh - var(--space-8));
  margin: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: var(--safe-bottom);
  border-radius: var(--radius-3) var(--radius-3) 0 0;
  translate: 0 0;
  transition: translate var(--duration-sheet) var(--ease-out), overlay var(--duration-sheet) allow-discrete, display var(--duration-sheet) allow-discrete;
}

.ui-sheet--bottom[popover]:not(:popover-open),
dialog.ui-sheet--bottom:not([open]) {
  translate: 0 100%;
}

@starting-style {
  .ui-sheet--bottom:popover-open,
  .ui-sheet--bottom[open] {
    translate: 0 100%;
  }
}

.ui-sheet--bottom::backdrop {
  background: var(--overlay);
}

.ui-sheet__grip {
  width: 36px;
  height: 4px;
  margin: var(--space-2) auto 0;
  border-radius: var(--radius-pill);
  background: var(--border-strong);
}

@media (min-width: 901px) {
  .ui-sheet--bottom {
    inset: 0;
    width: min(480px, calc(100vw - 32px));
    max-height: min(720px, calc(100dvh - 64px));
    margin: auto;
    padding-bottom: 0;
    border-radius: var(--radius-3);
  }

  .ui-sheet--bottom .ui-sheet__grip {
    display: none;
  }
}

/* Filters: the toggle «Фільтри (N)» and the sheet it opens on a phone; from 901 px the toggle and the sheet's head are
   gone and the sheet's body is laid out where the sheet stands, as if the wrapper were not there (display: contents
   beats the popover's own display: none — an author rule over the browser's). Filters apply at once, so the sheet
   has no «Застосувати». */
.ui-filters__toggle .ui-badge:empty {
  display: none;
}

.ui-filters .ui-sheet__body {
  display: grid;
  gap: var(--space-3);
}

@media (min-width: 901px) {
  .ui-filters__toggle {
    display: none;
  }

  .ui-filters.ui-sheet--bottom[popover] {
    position: static;
    display: contents;
    translate: none;
    transition: none;
  }

  .ui-filters > .ui-sheet__head,
  .ui-filters > .ui-sheet__grip {
    display: none;
  }

  .ui-filters > .ui-sheet__body {
    display: contents;
  }
}

/* A row of chips or tabs that scrolls sideways on its own, never the page. */
.ui-chiprow {
  display: flex;
  gap: var(--space-2);
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.ui-chiprow::-webkit-scrollbar {
  display: none;
}

.ui-chiprow > * {
  flex: none;
  scroll-snap-align: start;
}

/* A page's main action, held at the bottom of the screen on a phone (above the tab bar) — «Зберегти» on /Settings,
   /MySets/Edit and the phone's /Account (task 190); in the flow, where it was, from 901 px. */
.ui-sticky-action {
  position: sticky;
  bottom: var(--tabbar-space);
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-3) 0;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  box-shadow: 0 -1px 0 var(--border);
  backdrop-filter: blur(10px);
}

.ui-sticky-action > .ui-btn,
.ui-sticky-action > .btn {
  flex: 1 1 auto;
}

@media (min-width: 901px) {
  .ui-sticky-action {
    position: static;
    padding: 0;
    background: none;
    box-shadow: none;
    backdrop-filter: none;
  }

  .ui-sticky-action > .ui-btn,
  .ui-sticky-action > .btn {
    flex: none;
  }
}

/* A table whose rows become cards on a phone (≤ 480 px): the head is read to screen readers only, each cell shows its
   column's name from data-label, the .ui-table__primary cell takes the whole first line, the rest two columns. */
@media (max-width: 480px) {
  .ui-table--cards thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .ui-table--cards,
  .ui-table--cards tbody {
    display: block;
  }

  .ui-table--cards tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2) var(--space-3);
    padding: var(--space-3) var(--space-4);
    box-shadow: inset 0 -1px 0 var(--border);
  }

  .ui-table--cards tbody tr:last-child {
    box-shadow: none;
  }

  .ui-table--cards td,
  .ui-table--cards tbody td {
    display: block;
    min-width: 0;
    padding: 0;
    box-shadow: none;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .ui-table--cards tbody tr:hover td {
    background: none;
  }

  .ui-table--cards td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--text-muted);
    font-size: var(--text-xs);
    font-weight: 600;
  }

  .ui-table--cards .ui-table__primary {
    grid-column: 1 / -1;
    font-weight: 600;
  }

  .ui-table--cards .ui-table__wide {
    grid-column: 1 / -1;
  }

  .ui-table--cards td.ui-num {
    text-align: left;
  }
}

/* /Design shows the phone's patterns in the page, at any width. */
.ui-tabbar--inline {
  position: static;
  display: grid;
  height: auto;
  min-height: var(--tabbar-height);
  padding: 0 var(--space-1);
  border-radius: var(--radius-3);
}

.ui-sheet--bottom.ui-sheet--inline {
  position: static;
  translate: none;
  transition: none;
  overflow: visible;
}

.ui-sticky-action--inline {
  position: static;
}

/* ── Inbox (task 139) — /Notifications: the folders and kinds on the left (.ui-inbox-nav), the feed under day groups
   (.ui-inbox), a card an alert (.ui-inbox-card) with its delta (.ui-inbox-delta); the header bell's panel (.ui-bell).
   The kind's tone colours its icon, its name and the delta: good --up, warn --warn, bad --down, info --info — the
   colour says whether it is good news for the reader, the arrow which way the figure went (a price that fell is green). */
.ui-inbox-nav {
  display: grid;
  align-content: start;
  gap: var(--space-1);
}

.ui-inbox-nav__list {
  display: grid;
  gap: 2px;
}

.ui-inbox-nav__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-md);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-2);
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
}

.ui-inbox-nav__item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.ui-inbox-nav__item[aria-current="page"] {
  background: var(--surface-2);
  box-shadow: inset 3px 0 0 var(--accent);
  color: var(--text);
  font-weight: 600;
}

.ui-inbox-nav__item:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

.ui-inbox-nav__icon {
  flex: none;
  width: 1.25em;
  text-align: center;
}

.ui-inbox-nav__count {
  margin-left: auto;
  color: var(--text-faint);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

.ui-inbox-nav__item[aria-current="page"] .ui-inbox-nav__count {
  color: var(--text-muted);
}

.ui-inbox-nav__label {
  margin: var(--space-3) 0 0;
  padding: 0 var(--space-3);
  color: var(--text-faint);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ui-inbox-nav__links {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-3) 0;
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
}

.ui-inbox-nav__links a {
  color: var(--accent-text);
  text-decoration: none;
}

.ui-inbox-nav__links a:hover {
  text-decoration: underline;
}

/* The feed: the actions' row, then the groups on one surface. */
.ui-inbox {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}

.ui-inbox__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.ui-inbox__search {
  flex: 1 1 220px;
  max-width: 320px;
  margin: 0 0 0 auto;
}

.ui-inbox__search .ui-input {
  height: var(--control-sm);
}

/* The sheet's variant: the whole width, a finger's height. /Admin/Design shows it; since task 186 no page uses it — the
   phone inbox's search is the bar's, as on every phone page. */
.ui-inbox__search--sheet {
  max-width: none;
  margin: 0 0 var(--space-2);
}

.ui-inbox__search--sheet .ui-input {
  height: var(--touch);
}

.ui-inbox__back {
  margin: 0;
  font-size: var(--text-sm);
}

.ui-inbox__feed {
  min-width: 0;
}

.ui-inbox__group + .ui-inbox__group {
  margin-top: var(--space-4);
}

/* The day's heading sticks under the app's header while its cards scroll. */
.ui-inbox__day {
  position: sticky;
  top: var(--app-header);
  z-index: 2;
  margin: 0;
  padding: var(--space-2) var(--space-1);
  background: var(--bg);
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ui-inbox__list {
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-3);
  background: var(--surface-1);
  box-shadow: var(--shadow-1);
  list-style: none;
}

.ui-inbox__item + .ui-inbox__item {
  border-top: 1px solid var(--border);
}

.ui-inbox__more {
  display: flex;
  justify-content: center;
  padding: var(--space-4) 0;
}

/* The card: the picture with the kind's icon on its corner, the words, the delta and the actions on the right. The
   headline's link stretches over the whole card; the actions sit above it. */
.ui-inbox-card {
  position: relative;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  grid-template-areas: "photo body delta" "photo body more";
  align-items: start;
  column-gap: var(--space-4);
  row-gap: var(--space-2);
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-5);
  transition: background-color var(--duration-1) var(--ease);
}

.ui-inbox-card:hover {
  background: var(--surface-2);
}

.ui-inbox-card:focus-within {
  background: var(--surface-2);
  box-shadow: inset 2px 0 0 var(--focus-ring);
}

/* Unread: a dot in the left margin, a lighter fill, the headline bold. */
.ui-inbox-card.is-unread {
  background: color-mix(in srgb, var(--accent) 6%, var(--surface-1));
}

.ui-inbox-card.is-unread:hover,
.ui-inbox-card.is-unread:focus-within {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-2));
}

.ui-inbox-card.is-unread::before {
  content: "";
  position: absolute;
  top: calc(var(--space-3) + 32px);
  left: var(--space-2);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* A block, not a grid: the picture's 100 % of a grid's auto row resolves as auto, so a tall photo stood at its own
   height and ran out of its 56 px box (1 : 2 → 56 × 104, Chrome and WebKit) — the owner's Sauron's Helmet, task 152. */
.ui-inbox-card__photo {
  position: relative;
  grid-area: photo;
  display: block;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-2);
  background: var(--photo-bg);
}

.ui-inbox-card__photo img {
  display: block;
  width: 100%;
  height: 100%;
  padding: var(--photo-inset);
  object-fit: contain;
}

.ui-inbox-card__icon {
  position: absolute;
  right: -6px;
  bottom: -6px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 2px solid var(--surface-1);
  border-radius: 50%;
  background: var(--info-bg);
  font-size: 13px;
  line-height: 1;
}

.ui-inbox-card--good .ui-inbox-card__icon { background: var(--up-bg); }
.ui-inbox-card--warn .ui-inbox-card__icon { background: var(--warn-bg); }
.ui-inbox-card--bad .ui-inbox-card__icon { background: var(--down-bg); }

.ui-inbox-card__body {
  grid-area: body;
  min-width: 0;
}

.ui-inbox-card__kind {
  margin: 0 0 2px;
  color: var(--info);
  font-size: var(--text-xs);
  font-weight: 600;
}

.ui-inbox-card--good .ui-inbox-card__kind { color: var(--up); }
.ui-inbox-card--warn .ui-inbox-card__kind { color: var(--warn); }
.ui-inbox-card--bad .ui-inbox-card__kind { color: var(--down); }

.ui-inbox-card__title {
  margin: 0;
  font-size: var(--text-md);
  font-weight: 500;
  line-height: 1.35;
}

.is-unread .ui-inbox-card__title {
  font-weight: 700;
}

.ui-inbox-card__open {
  color: var(--text);
  text-decoration: none;
}

.ui-inbox-card__open::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
}

.ui-inbox-card__open:focus-visible {
  outline: none;
}

.ui-inbox-card__facts {
  margin: var(--space-1) 0 0;
  padding: 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  list-style: none;
}

.ui-inbox-card__facts [data-role="change"] {
  color: var(--text);
}

.ui-inbox-card__quote {
  margin: var(--space-1) 0 0;
  overflow: hidden;
  color: var(--text-faint);
  font-size: var(--text-xs);
  font-style: italic;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-inbox-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  margin: var(--space-2) 0 0;
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.ui-inbox-card__meta > :not(:first-child)::before {
  content: "·";
  margin-right: var(--space-2);
  color: var(--text-faint);
}

.ui-inbox-card__route {
  color: var(--text-faint);
}

.ui-inbox-card > .ui-inbox-delta {
  grid-area: delta;
  justify-self: end;
}

.ui-inbox-card__more {
  position: relative;
  z-index: 1;
  grid-area: more;
  justify-self: end;
}

/* The row's buttons float over the card's right side on hover or while the card holds the focus; they are out of the
   Tab order — «⋯» is the keyboard's way to the same actions, and the touch screen's. */
.ui-inbox-card__actions {
  position: absolute;
  right: calc(var(--space-4) + var(--control-md) + var(--space-1));
  bottom: var(--space-3);
  z-index: 1;
  display: flex;
  gap: var(--space-1);
  padding: 2px;
  border-radius: var(--radius-2);
  background: var(--surface-1);
  box-shadow: var(--shadow-1);
  visibility: hidden;
  opacity: 0;
  transition: opacity var(--duration-1) var(--ease), visibility var(--duration-1);
}

.ui-inbox-card:hover .ui-inbox-card__actions,
.ui-inbox-card:focus-within .ui-inbox-card__actions {
  visibility: visible;
  opacity: 1;
}

@media (hover: none) {
  .ui-inbox-card__actions {
    display: none;
  }
}

/* «⋯»'s menu on the desktop: under its button where anchors are supported, centred (the popover's default) where not. */
.ui-inbox-card__menu {
  min-width: 220px;
  padding: var(--space-1);
  border: 0;
  border-radius: var(--radius-3);
  background: var(--surface-1);
  box-shadow: var(--shadow-2);
  color: var(--text);
}

.ui-inbox-card__menu > div {
  display: grid;
  gap: 2px;
}

@supports (position-area: bottom) {
  .ui-inbox-card__menu {
    inset: auto;
    margin: var(--space-1) 0;
    position-area: bottom span-left;
    position-try-fallbacks: flip-block;
  }
}

/* Compact: one line a card — the picture small, the headline cut, no facts. */
.ui-inbox--compact .ui-inbox-card {
  grid-template-columns: 40px minmax(0, 1fr) auto auto;
  grid-template-areas: "photo body delta more";
  align-items: center;
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
}

.ui-inbox--compact .ui-inbox-card__photo {
  width: 40px;
  height: 40px;
}

.ui-inbox--compact .ui-inbox-card__icon {
  width: 20px;
  height: 20px;
  border-width: 1px;
  font-size: 10px;
}

.ui-inbox--compact .ui-inbox-card.is-unread::before {
  top: 50%;
  translate: 0 -50%;
}

.ui-inbox--compact .ui-inbox-card__kind,
.ui-inbox--compact .ui-inbox-card__facts,
.ui-inbox--compact .ui-inbox-card__quote {
  display: none;
}

.ui-inbox--compact .ui-inbox-card__title {
  overflow: hidden;
  font-size: var(--text-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-inbox--compact .ui-inbox-card__meta {
  margin-top: 2px;
}

.ui-inbox--compact .ui-inbox-card__actions {
  top: 50%;
  bottom: auto;
  translate: 0 -50%;
}

/* The phone: one column of cards, a tap opens; «⋯» — 44 px — opens the card's sheet of actions. The headline in three
   lines at most, the first fact only (the change), the delta under it. */
.ui-inbox--phone .ui-inbox-card {
  grid-template-columns: 56px minmax(0, 1fr) var(--touch);
  grid-template-areas: "photo body more" "photo delta more";
  column-gap: var(--space-3);
  row-gap: var(--space-1);
  padding: var(--space-3) var(--space-1) var(--space-3) var(--space-4);
}

.ui-inbox--phone .ui-inbox-card__photo {
  width: 56px;
  height: 56px;
}

.ui-inbox--phone .ui-inbox-card.is-unread::before {
  top: calc(var(--space-3) + 24px);
  left: 5px;
}

.ui-inbox--phone .ui-inbox-card__title {
  display: -webkit-box;
  overflow: hidden;
  font-size: var(--text-sm);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.ui-inbox--phone .ui-inbox-card__facts li:not(:first-child),
.ui-inbox--phone .ui-inbox-card__quote,
.ui-inbox--phone .ui-inbox-card__actions {
  display: none;
}

.ui-inbox--phone .ui-inbox-card > .ui-inbox-delta {
  justify-self: start;
}

.ui-inbox--phone .ui-inbox-card__more {
  align-self: start;
  width: var(--touch);
  height: var(--touch);
  margin-top: calc(var(--space-2) * -1);
}

.ui-inbox--phone .ui-inbox__list {
  border-radius: 0;
  box-shadow: none;
}

.ui-inbox--phone .ui-inbox__day {
  top: 0;
  padding-left: var(--space-4);
}

.ui-inbox__empty {
  margin: var(--space-4) 0;
}

/* The signed figure of a card: the arrow its direction, the colour its kind's tone. */
.ui-inbox-delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--info-bg);
  color: var(--info);
  font-size: var(--text-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ui-inbox-delta--down::before { content: "↓"; }
.ui-inbox-delta--up::before { content: "↑"; }
.ui-inbox-delta--good { background: var(--up-bg); color: var(--up); }
.ui-inbox-delta--warn { background: var(--warn-bg); color: var(--warn); }
.ui-inbox-delta--bad { background: var(--down-bg); color: var(--down); }
.ui-inbox-delta--flat { background: var(--surface-2); color: var(--text-muted); }
/* A bid against the account's ceiling (task 152): the room under it neutral, over it the warning; neither has an arrow. */
.ui-inbox-delta--room { background: var(--surface-2); color: var(--text-muted); }
.ui-inbox-delta--over { background: var(--warn-bg); color: var(--warn); }

/* The bell's panel: a popover under the bell from 901 px (notification-bell.js; a link without it). */
.ui-bell {
  position: fixed;
  inset: calc(var(--app-header) + var(--space-2)) max(68px, calc((100vw - 2200px) / 2 + 48px)) auto auto;
  width: 380px;
  max-height: calc(100dvh - var(--app-header) - var(--space-5));
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-3);
  background: var(--surface-1);
  box-shadow: var(--shadow-2);
  color: var(--text);
}

.ui-bell:popover-open,
.ui-bell--inline {
  display: flex;
  flex-direction: column;
}

@supports (position-area: bottom) {
  .ui-bell {
    inset: auto;
    margin: var(--space-2) 0 0;
    position-anchor: --app-bell;
    position-area: bottom span-left;
  }
}

.ui-bell--inline {
  position: static;
  max-height: none;
}

.ui-bell__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--border);
}

.ui-bell__title {
  margin: 0;
  font-size: var(--text-md);
  font-weight: 600;
}

.ui-bell__body {
  flex: 1;
  min-height: 96px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.ui-bell__body[aria-busy="true"] {
  background: linear-gradient(90deg, transparent, var(--surface-2), transparent) 0 0 / 200% 100%;
}

.ui-bell__list {
  margin: 0;
  padding: var(--space-1);
  list-style: none;
}

.ui-bell__item {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 8px;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  border-radius: var(--radius-2);
  color: var(--text);
  text-decoration: none;
}

.ui-bell__item:hover,
.ui-bell__item:focus-visible {
  background: var(--surface-2);
  outline: none;
}

.ui-bell__item:focus-visible:not([data-focus-quiet]) {
  box-shadow: inset 0 0 0 2px var(--focus-ring);
}

.ui-bell__item.is-unread::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.ui-bell__photo {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-1);
  background: var(--photo-bg);
}

.ui-bell__photo img {
  display: block;
  width: 100%;
  height: 100%;
  padding: var(--photo-inset);
  object-fit: contain;
}

/* A blocked provider's picture is its mark (task 163), on the card's own surface: the photo's white would frame the tile
   as a white square on the dark theme. 48 on a card, 32 compact and in the bell — the mark's steps. */
.ui-inbox-card__photo:has(> .ui-provider),
.ui-bell__photo:has(> .ui-provider) {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
}

.ui-inbox--compact .ui-inbox-card__photo > .ui-provider {
  --mark: var(--mark-32);
}

.ui-bell__text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ui-bell__headline {
  display: -webkit-box;
  overflow: hidden;
  font-size: var(--text-sm);
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.is-unread .ui-bell__headline {
  font-weight: 700;
}

.ui-bell__meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.ui-bell__meta .ui-inbox-delta {
  padding: 0 var(--space-1);
  font-size: var(--text-xs);
}

.ui-bell__empty {
  margin: 0;
  padding: var(--space-6) var(--space-4);
  color: var(--text-muted);
  font-size: var(--text-sm);
  text-align: center;
}

.ui-bell__all {
  display: block;
  padding: var(--space-3);
  border-top: 1px solid var(--border);
  color: var(--accent-text);
  font-size: var(--text-sm);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}

.ui-bell__all:hover {
  background: var(--surface-2);
}

/* ── Motion ──────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .ui-btn,
  .ui-btn:active,
  .ui-switch input,
  .ui-switch input::before,
  .ui-tooltip__bubble,
  .ui-tabbar__item,
  .ui-tabbar__item:active,
  .ui-sheet--bottom {
    transition: none;
    transform: none;
  }

  .ui-skeleton,
  .ui-btn[aria-busy="true"]::after {
    animation-duration: 3s;
  }
}

/* «👁 Відстежувати» (task 144, Pages/Shared/Components/_AuctionWatch): a form around one ghost button. The open eye is
   «not watched»; aria-pressed="true" fills it in the accent — the state is the attribute, not a class, so the script and
   the server set one thing. Icon-only by default (44 px, its words in aria-label); --labelled adds «Відстежувати» /
   «Відстежується». */
.ui-watch {
  display: inline-flex;
  margin: 0;
}

.ui-watch__btn[aria-pressed="true"] {
  --btn-fg: var(--accent-text);
}

.ui-watch__btn .ui-watch__pupil {
  fill: none;
}

.ui-watch__btn[aria-pressed="true"] .ui-watch__lid {
  fill: color-mix(in srgb, var(--accent) 22%, transparent);
}

.ui-watch__btn[aria-pressed="true"] .ui-watch__pupil {
  fill: currentColor;
}

.ui-watch--labelled .ui-watch__btn {
  gap: var(--space-2);
}

/* «♡» on a catalogue figure's tile (task 179, Pages/Shared/Components/_FigureTile / _FigureTileMobile): a submit button
   over the photo's top right corner, a sibling of the tile's link (a button inside a link is not allowed). The hit area
   is the control's height — 36 px with a mouse, 44 under a finger —, the drawn disc 28 px inside it, on the surface so
   it reads on any photo. aria-pressed="true" fills the heart in the accent, as «👁» is filled (.ui-watch): the state is
   the attribute, which the server and wish-toggle.js both set. */
.ui-wish {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  width: var(--control-md);
  height: var(--control-md);
  padding: 0;
  border: 0;
  border-radius: var(--radius-3);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  /* Two quick presses are two toggles, never a double-tap zoom. */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.ui-wish::before {
  content: "";
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-1);
  box-shadow: var(--shadow-1);
  transition: transform var(--duration-1) var(--ease);
}

.ui-wish:hover {
  color: var(--text);
}

.ui-wish:active::before {
  transform: scale(0.92);
}

.ui-wish:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -4px;
}

.ui-wish:disabled {
  cursor: progress;
}

.ui-wish__heart {
  position: relative;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linejoin: round;
}

.ui-wish[aria-pressed="true"] {
  color: var(--accent-text);
}

.ui-wish[aria-pressed="true"] .ui-wish__heart {
  fill: currentColor;
}

@media (prefers-reduced-motion: reduce) {
  .ui-wish::before {
    transition: none;
  }
}
