/* Компоненты.
 *
 * Один вид сущности — один компонент. Если строка списка задач и строка
 * списка передач выглядят по-разному, это разные компоненты; если одинаково —
 * компонент один, а различие описано модификатором.
 *
 * Тон (`data-tone`) — единственный способ покрасить состояние. Компонент
 * никогда не знает, «красный он или зелёный»: он знает роль цвета и берёт
 * значение из токена по имени тона.
 */

/* ── Тон ──────────────────────────────────────────────────────────────── */

[data-tone="overdue"]  { --tone: var(--tone-overdue);  --tone-bg: var(--tone-overdue-bg);  --tone-pure: var(--tone-overdue-pure); }
[data-tone="today"]    { --tone: var(--tone-today);    --tone-bg: var(--tone-today-bg);    --tone-pure: var(--tone-today-pure); }
[data-tone="tomorrow"] { --tone: var(--tone-tomorrow); --tone-bg: var(--tone-tomorrow-bg); --tone-pure: var(--tone-tomorrow-pure); }
[data-tone="pending"]  { --tone: var(--tone-pending);  --tone-bg: var(--tone-pending-bg);  --tone-pure: var(--tone-pending-pure); }
[data-tone="waiting"]  { --tone: var(--tone-waiting);  --tone-bg: var(--tone-waiting-bg);  --tone-pure: var(--tone-waiting-pure); }
[data-tone="done"]     { --tone: var(--tone-done);     --tone-bg: var(--tone-done-bg);     --tone-pure: var(--tone-done-pure); }
[data-tone="neutral"],
[data-tone="empty"]    { --tone: var(--tone-neutral);  --tone-bg: var(--tone-neutral-bg);  --tone-pure: var(--tone-neutral-pure); }
[data-tone="good"]     { --tone: var(--tone-done);     --tone-bg: var(--tone-done-bg);     --tone-pure: var(--tone-done-pure); }
[data-tone="warn"]     { --tone: var(--tone-today);    --tone-bg: var(--tone-today-bg);    --tone-pure: var(--tone-today-pure); }
[data-tone="danger"]   { --tone: var(--tone-overdue);  --tone-bg: var(--tone-overdue-bg);  --tone-pure: var(--tone-overdue-pure); }

/* ── Блоки и заголовки разделов ───────────────────────────────────────── */

.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
/* Светлая кромка по верху — единственное, что отличает «лежит сверху» от
   «вырезано в фоне». Один пиксель, но без него карточки плоские. */
.card::before,
.rows::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  border-radius: inherit;
  background: var(--sheen);
  pointer-events: none;
}
.card--flat { box-shadow: none; }
.card--pad { padding: var(--space-4); }

.stack { display: grid; gap: var(--space-4); }
.stack--tight { gap: var(--space-2); }

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

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 0 var(--space-1);
}

.section__title {
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.section__action {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  padding: var(--space-1) 0;
}

.muted { color: var(--ink-3); }
.text-sm { font-size: var(--text-sm); }
.pre-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ── Строка списка ────────────────────────────────────────────────────── */

.rows {
  position: relative;
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.row {
  position: relative;
  display: grid;
  gap: var(--space-1);
  width: 100%;
  min-height: var(--tap);
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-4);
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.row:last-child { border-bottom: 0; }
.row { transition: background var(--fast) var(--ease); }
/* Отклик на касание: подложка плюс едва заметное «вдавливание». Без него
   на телефоне непонятно, попал ли палец по строке. */
.row:active { background: var(--surface-2); }
@media (hover: hover) {
  .row:hover { background: var(--surface-2); }
}
.row--static { cursor: default; }
.row--static:active { background: var(--surface); }

/* Полоса тона слева — это не украшение: по ней список читается одним
   движением глаза, без чтения подписей. */
.row--toned { padding-left: calc(var(--space-4) + 3px); }
.row--toned::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--tone-pure, transparent);
}
.row[data-tone="neutral"]::before,
.row[data-tone="done"]::before { opacity: 0.45; }

.row__top {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.row__title {
  flex: 1;
  min-width: 0;
  font-size: var(--text-md);
  font-weight: 550;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.row__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-2);
  color: var(--ink-3);
  font-size: var(--text-xs);
}
.row__meta > * { flex: none; }
.row__meta b { color: var(--ink-2); font-weight: 600; }

.row__chevron { flex: none; color: var(--ink-3); }

.row__sep {
  width: 3px;
  height: 3px;
  border-radius: var(--radius-pill);
  background: var(--line-strong);
}

/* ── Маркеры состояния ────────────────────────────────────────────────── */

.dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--tone-pure, var(--ink-3));
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--tone-bg, var(--surface-3));
  color: var(--tone, var(--ink-2));
  font-size: var(--text-xs);
  font-weight: 650;
  white-space: nowrap;
}
.pill--strong { background: var(--tone-pure); color: #fff; }

/* Состояние в строке списка — слово нужного тона, а не заливка: в длинном
   списке двадцать залитых плашек подряд читаются как шум, а полоса слева
   уже несёт цвет. */
.state {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--tone, var(--ink-2));
  font-size: var(--text-xs);
  font-weight: 650;
  white-space: nowrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--tag-bg, var(--surface-3));
  color: var(--tag-fg, var(--ink-2));
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
}
.tags { display: flex; flex-wrap: wrap; gap: var(--space-1); }

/* Ярлык-переключатель: тот же ярлык, но его можно нажать. Оборачивать ярлык
   в чип нельзя — получаются две рамки и два фона вокруг одного слова. */
.tag-toggle {
  min-height: 34px;
  padding: 0 var(--space-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-2);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.tag-toggle.is-on {
  border-color: transparent;
  background: var(--tag-bg, var(--accent-soft));
  color: var(--tag-fg, var(--accent));
}

.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.avatar--lg { width: 36px; height: 36px; font-size: var(--text-xs); }

.people { display: flex; align-items: center; gap: var(--space-1); min-width: 0; }
.people__stack { display: flex; }
.people__stack .avatar + .avatar { margin-left: -8px; border: 2px solid var(--surface); }
.people__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
  font-size: var(--text-xs);
}

/* ── Числа ────────────────────────────────────────────────────────────── */

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}
.stats--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* На узком экране четыре плитки в ряд превращаются в четыре обрезанные
   подписи, поэтому ряд ломается на две пары. */
@media (max-width: 520px) { .stats--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 521px) { .stat__value { font-size: var(--text-2xl); } }

.stat {
  display: grid;
  gap: 2px;
  padding: 10px var(--space-3) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: transform var(--fast) var(--ease), background var(--fast) var(--ease);
}
.stat:disabled { cursor: default; }
.stat:not(:disabled):active { background: var(--surface-2); transform: scale(0.98); }
.stat.is-on { border-color: var(--tone-pure, var(--accent)); background: var(--tone-bg, var(--accent-soft)); }

.stat__value {
  font-size: var(--text-xl);
  font-weight: 680;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--tone, var(--ink));
  font-variant-numeric: tabular-nums;
}
.stat__label {
  color: var(--ink-3);
  font-size: var(--text-xs);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Полоса показывает долю, а не длину: растянутая на весь монитор, она
   перестаёт читаться как оценка и превращается в линию-разделитель. */
.meter {
  max-width: 420px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  overflow: hidden;
}
.meter > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--tone-pure, var(--accent));
}

/* ── Кнопки ───────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--tap);
  padding: 0 var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: var(--ink-on-accent);
  font-size: var(--text-md);
  font-weight: 620;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.12), inset 0 1px rgba(255, 255, 255, 0.22);
  transition: transform var(--fast) var(--ease), filter var(--fast) var(--ease);
}
.btn:active { background: var(--accent-press); transform: scale(0.985); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn--block { width: 100%; }
.btn--ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); box-shadow: var(--shadow-card); }
.btn--ghost:active { background: var(--surface-2); }
.btn--quiet { background: transparent; color: var(--accent); box-shadow: none; }
.btn--quiet:active { background: var(--accent-soft); }
.btn--danger { background: var(--tone-overdue-pure); color: #fff; }
.btn--danger:active { background: var(--tone-overdue); }
.btn--sm { min-height: 34px; padding: 0 var(--space-3); font-size: var(--text-sm); border-radius: var(--radius-sm); }

.btn-row { display: flex; gap: var(--space-2); flex-wrap: wrap; }

/* ── Чипы-фильтры ─────────────────────────────────────────────────────── */

.chips {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
  padding: var(--space-1) var(--space-4);
  margin: 0 calc(var(--space-4) * -1);
  scroll-padding: var(--space-4);
  /* Ряд длиннее экрана: у правого края он растворяется, и видно, что там
     ещё что-то есть. Обрыв по границе выглядел бы как конец списка. */
  mask-image: linear-gradient(90deg, transparent 0, #000 var(--space-4),
              #000 calc(100% - var(--space-6)), transparent 100%);
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  flex: none;
  min-height: 34px;
  padding: 0 var(--space-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-2);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.chip {
  box-shadow: var(--shadow-card);
  transition: transform var(--fast) var(--ease), background var(--fast) var(--ease),
              border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.chip:active { background: var(--surface-2); transform: scale(0.96); }
.chip.is-on {
  border-color: transparent;
  background: var(--tone-bg, var(--accent-soft));
  color: var(--tone, var(--accent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone-pure, var(--accent)) 24%, transparent);
}
.chip__count {
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.chip.is-on .chip__count { color: inherit; opacity: 0.75; }

/* ── Поля ─────────────────────────────────────────────────────────────── */

.field { display: grid; gap: var(--space-1); }
.field__label {
  color: var(--ink-2);
  font-size: var(--text-sm);
  font-weight: 600;
}
.field__hint { color: var(--ink-3); font-size: var(--text-xs); }
.field__error { color: var(--tone-overdue); font-size: var(--text-xs); font-weight: 600; }

.input,
.select,
.textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 10px var(--space-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  /* 16px — граница, ниже которой iOS увеличивает страницу при фокусе. */
  font: 400 16px/1.4 var(--font);
  appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { min-height: 92px; resize: vertical; }

.select {
  padding-right: var(--space-6);
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-3);
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input {
  flex: 1;
  min-width: 0;
  min-height: var(--tap);
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 400 16px/1.4 var(--font);
}
.search input:focus { outline: none; }
.search button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  color: var(--ink-2);
  cursor: pointer;
}

.check {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--tap);
  padding: 0 var(--space-4);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  font-size: var(--text-md);
}
.check:last-child { border-bottom: 0; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.check span { flex: 1; min-width: 0; }

.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
  padding: 2px;
  border-radius: var(--radius);
  background: var(--surface-3);
}
.segmented button {
  min-height: 34px;
  padding: 0 var(--space-2);
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.segmented button.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-row); }

/* ── Пары «подпись → значение» ────────────────────────────────────────── */

.kv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border-radius: var(--radius-lg);
  background: var(--line);
  overflow: hidden;
  border: 1px solid var(--line);
}
.kv > div {
  display: grid;
  gap: 2px;
  padding: var(--space-3);
  background: var(--surface);
}
.kv dt, .kv__label { color: var(--ink-3); font-size: var(--text-xs); font-weight: 600; }
.kv dd, .kv__value { margin: 0; font-size: var(--text-md); font-weight: 550; }

/* ── Лист-шторка ──────────────────────────────────────────────────────── */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--overlay);
  animation: fade var(--fast) var(--ease);
}

.sheet {
  position: fixed;
  z-index: 61;
  inset: auto 0 0 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: 88dvh;
  padding-bottom: var(--safe-bottom);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--surface);
  box-shadow: var(--shadow-sheet);
  animation: rise var(--slow) var(--ease);
}

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

.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--line);
}
.sheet__title { font-size: var(--text-lg); font-weight: 650; }
.sheet__body { overflow: auto; padding: var(--space-4); -webkit-overflow-scrolling: touch; }
.sheet__body--flush { padding: 0; }
.sheet__foot {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.sheet__foot .btn { flex: 1; }

@keyframes rise { from { transform: translateY(14%); opacity: 0.4; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

@media (min-width: 900px) {
  .sheet {
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: min(560px, calc(100vw - 64px));
    max-height: 80dvh;
    border-radius: var(--radius-lg);
    animation: pop var(--slow) var(--ease);
  }
  .sheet__grip { display: none; }
  @keyframes pop { from { transform: translate(-50%, -46%); opacity: 0; } to { transform: translate(-50%, -50%); opacity: 1; } }
}

/* ── Сообщения ────────────────────────────────────────────────────────── */

.banner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-left: 3px solid var(--tone-pure, var(--line-strong));
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-2);
  font-size: var(--text-sm);
}
.banner b { color: var(--ink); font-weight: 650; }
.banner .icon { flex: none; color: var(--tone, var(--ink-3)); }
.banner__body { flex: 1; min-width: 0; display: grid; gap: 2px; }

.toasts {
  position: fixed;
  z-index: 80;
  inset: auto var(--space-4) calc(var(--tabbar-h) + var(--safe-bottom) + var(--space-3)) var(--space-4);
  display: grid;
  gap: var(--space-2);
  pointer-events: none;
}
@media (min-width: 900px) {
  .toasts { inset: auto var(--space-5) var(--space-5) auto; width: min(380px, calc(100vw - 40px)); }
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--ground);
  font-size: var(--text-sm);
  font-weight: 550;
  box-shadow: var(--shadow-pop);
  animation: rise var(--slow) var(--ease);
  pointer-events: auto;
}
.toast[data-tone] { background: var(--tone-pure); color: #fff; }

/* ── Пусто и загрузка ─────────────────────────────────────────────────── */

.empty {
  display: grid;
  gap: var(--space-2);
  justify-items: center;
  padding: var(--space-7) var(--space-4);
  text-align: center;
  color: var(--ink-3);
}
.empty .icon { width: 34px; height: 34px; color: var(--line-strong); }
.empty__title { color: var(--ink); font-size: var(--text-md); font-weight: 600; }
.empty p { max-width: 34ch; font-size: var(--text-sm); }

.skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 37%, var(--surface-3) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

.skeleton-rows { display: grid; gap: 1px; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.skeleton-rows > div { display: grid; gap: var(--space-2); padding: var(--space-3) var(--space-4); background: var(--surface); }
.skeleton-rows .skeleton:first-child { height: 15px; width: 78%; }
.skeleton-rows .skeleton:last-child { height: 11px; width: 46%; }

/* ── Прочее ───────────────────────────────────────────────────────────── */

.divider { height: 1px; background: var(--line); }

.link-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: var(--tap);
  padding: var(--space-3) var(--space-4);
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.link-row:last-child { border-bottom: 0; }
.link-row:active { background: var(--surface-2); }
.link-row__body { flex: 1; min-width: 0; display: grid; gap: 1px; }
.link-row__body b { font-weight: 600; font-size: var(--text-md); }
.link-row__body span { color: var(--ink-3); font-size: var(--text-xs); }
.link-row > .icon:first-child { color: var(--ink-3); flex: none; }

/* ── Главное число экрана ─────────────────────────────────────────────── */

/* Экран обзора отвечает на один вопрос, и ответ должен читаться с вытянутой
   руки. Поэтому не четыре равные плитки, а одно число в полный рост —
   остальные цифры вокруг него уже мелкие и служебные.
   Подложка тонирована состоянием: просрочки красные, «всё чисто» зелёное.
   Слово рядом обязательно — цвет здесь ускоряет чтение, а не заменяет его. */
.hero {
  position: relative;
  display: grid;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-4) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 100% at 100% 0, var(--tone-bg, var(--surface-2)), transparent 62%),
    var(--surface);
  box-shadow: var(--shadow-raised);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: var(--sheen);
}

.hero__label {
  color: var(--ink-3);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero__value {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  color: var(--tone, var(--ink));
  font-size: var(--text-display);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.hero__unit {
  color: var(--ink-3);
  font-size: var(--text-md);
  font-weight: 600;
  letter-spacing: 0;
}

.hero__note { color: var(--ink-2); font-size: var(--text-sm); }
.hero__note b { color: var(--ink); font-weight: 650; }

.hero__actions { display: flex; gap: var(--space-2); margin-top: var(--space-1); }

/* ── Полоса состава ───────────────────────────────────────────────────── */

/* Из чего сложилось число: доли состояний одной полосой. Между сегментами
   зазор цветом фона — иначе два соседних тона сливаются в один и полоса
   врёт о составе. */
.bar-stack {
  display: flex;
  gap: 2px;
  height: 10px;
  margin-top: var(--space-1);
}
.bar-stack > i {
  min-width: 3px;
  border-radius: var(--radius-pill);
  background: var(--tone-pure);
}

.bar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  margin-top: var(--space-2);
}
.bar-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: var(--text-xs);
  font-weight: 550;
  cursor: pointer;
}
.bar-legend__item b {
  color: var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ── Строка-показатель внутри карточки ────────────────────────────────── */

/* Компактная тройка «всего / в работе / выполнено» под главным числом:
   это фон для него, а не соперник, поэтому без рамок и теней. */
.figures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border-radius: var(--radius);
  background: var(--line);
  border: 1px solid var(--line);
  overflow: hidden;
}
.figures > button,
.figures > div {
  display: grid;
  gap: 1px;
  padding: var(--space-3) var(--space-2);
  border: 0;
  background: var(--surface);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.figures > button:active { background: var(--surface-2); }
.figures b {
  font-size: var(--text-xl);
  font-weight: 680;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--tone, var(--ink));
}
.figures span {
  color: var(--ink-3);
  font-size: var(--text-xs);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Появление списка ─────────────────────────────────────────────────── */

/* Строки проявляются по очереди — четыре кадра на весь список, дальше без
   задержки: иначе длинный реестр «собирается» дольше, чем читается. */
.rows--staged > * {
  animation: row-in var(--slow) var(--ease-spring) backwards;
}
.rows--staged > *:nth-child(1) { animation-delay: 0ms; }
.rows--staged > *:nth-child(2) { animation-delay: 35ms; }
.rows--staged > *:nth-child(3) { animation-delay: 70ms; }
.rows--staged > *:nth-child(4) { animation-delay: 105ms; }

@keyframes row-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
