/* =====================================================================
   Easy Shop · компоненты (пара к js/ui.js и js/charts.js) — «Мягкий сланец».
   Только токены из tokens.css. Никаких размеров и цветов «с потолка».
   Состояния: [aria-*], [data-tone], .is-*; модификаторы: .блок--вариант.
   Тона чипов / точек / плиток: wait · work · ok · bad · muted · info
   (warn = wait, accent = work).
   ===================================================================== */

/* ---------- кнопка ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-8);
  height: var(--ctl-h);
  padding: 0 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--fs-13);
  font-weight: var(--fw-btn);
  line-height: 1;
  white-space: nowrap;
  flex: none;
  transition: background var(--t-1), border-color var(--t-1), filter var(--t-1), transform var(--t-1), color var(--t-1);
}
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); transform: translateY(-1px); }
.btn:active { transform: scale(.98); }
.btn__lead { display: inline-flex; margin-left: -2px; }
.btn--primary { background: var(--accent-grad); border-color: transparent; color: var(--on-accent); box-shadow: var(--sh-accent); }
.btn--primary:hover { background: var(--accent-grad); border-color: transparent; filter: brightness(1.1); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--neutral-soft); border-color: transparent; color: var(--text); transform: none; }
.btn--danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.btn--danger:hover { background: var(--danger-soft); border-color: var(--danger-line); }
.btn--danger-solid { background: var(--danger-solid); border-color: transparent; color: var(--on-danger); }
.btn--danger-solid:hover { background: var(--danger-solid); border-color: transparent; filter: brightness(1.1); }
.btn--sm { height: var(--ctl-h-sm); padding: 0 11px; gap: var(--s-6); border-radius: var(--r-sm); font-size: var(--fs-12); }
.btn--lg { height: var(--ctl-h-lg); padding: 0 var(--s-20); font-size: var(--fs-14); }
.btn--block { display: flex; width: 100%; }
.btn--icon { width: var(--ctl-h); padding: 0; }
.btn--icon.btn--sm { width: var(--ctl-h-sm); }
.btn--icon .btn__lead { margin-left: 0; }
.btn.is-loading { cursor: progress; }
.btn.is-loading .btn__label { opacity: .75; }
.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  color: var(--text-3);
  background: var(--surface-2);
  border-color: var(--border);
  box-shadow: none;
  filter: none;
  transform: none;
}
.btn .kbd { margin-right: -4px; }

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  color: var(--text-2);
  flex: none;
  transition: background var(--t-1), color var(--t-1), transform var(--t-1), filter var(--t-1);
}
.icon-btn:hover { background: var(--neutral-soft); color: var(--text); }
.icon-btn:active { transform: scale(.93); }
.icon-btn[aria-pressed="true"],
.icon-btn[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent-text); }
.icon-btn--sm { width: 28px; height: 28px; border-radius: var(--r-sm); }
.icon-btn--lg { width: 44px; height: 44px; }
.icon-btn--solid { background: var(--surface-2); border: 1px solid var(--border); }
.icon-btn--solid:hover { background: var(--surface-3); border-color: var(--border-strong); }
/* круглая кнопка отправки */
.icon-btn--primary {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-grad);
  color: var(--on-accent);
  box-shadow: var(--sh-accent);
}
.icon-btn--primary:hover { background: var(--accent-grad); color: var(--on-accent); filter: brightness(1.1); transform: translateY(-1px) scale(1.05); }
.icon-btn--primary:active { transform: scale(.93); }
.icon-btn:disabled { cursor: not-allowed; color: var(--text-3); background: transparent; box-shadow: none; filter: none; transform: none; }
.icon-btn--primary:disabled { background: var(--surface-3); color: var(--text-3); }
.icon-btn[aria-disabled="true"],
.icon-btn[aria-disabled="true"]:hover { cursor: not-allowed; color: var(--text-3); background: transparent; box-shadow: none; filter: none; transform: none; }
.icon-btn--primary[aria-disabled="true"],
.icon-btn--primary[aria-disabled="true"]:hover { background: var(--surface-3); color: var(--text-3); }
.icon-btn.is-done { color: var(--ok); }
.icon-btn__badge {
  position: absolute;
  top: 2px;
  right: 1px;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  display: grid;
  place-items: center;
  background: var(--danger-solid);
  color: var(--on-danger);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--badge-ring, var(--bg));
}
.icon-btn__badge:empty { min-width: 9px; width: 9px; height: 9px; padding: 0; top: 7px; right: 7px; }

.spinner { animation: spin .8s linear infinite; fill: none; stroke: currentColor; stroke-width: 3; flex: none; }
.spinner__track { opacity: .25; }
.spinner__arc { stroke-linecap: round; }

/* ---------- поля ---------- */
.field { display: flex; flex-direction: column; gap: var(--s-6); min-width: 0; }
.field--inline { flex-direction: row; align-items: center; gap: var(--s-12); }
.field__label { font-size: var(--fs-12); font-weight: var(--fw-label); color: var(--text-2); }
.field__hint { font-size: var(--fs-12); color: var(--text-3); }
.field__error { font-size: var(--fs-12); color: var(--danger); }

.input,
.textarea {
  display: flex;
  align-items: center;
  gap: var(--s-8);
  min-width: 0;
  border-radius: var(--r-md);
  background: var(--field);
  border: 1px solid var(--border);
  color: var(--text);
  transition: border-color var(--t-1), box-shadow var(--t-1);
}
.input { height: calc(var(--ctl-h) + 2px); padding: 0 var(--s-12); }
.input:hover,
.textarea:hover { border-color: var(--border-strong); }
.input:focus-within,
.textarea:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.is-invalid,
.field.is-invalid .input,
.field.is-invalid .textarea { border-color: var(--danger-line); }
.input--sm { height: var(--ctl-h-sm); padding: 0 var(--s-10); border-radius: var(--r-sm); }
.input--lg { height: var(--ctl-h-lg); padding: 0 14px; }
.input__el {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  outline: none;
  color: var(--text);
  font-size: var(--fs-14);
}
.input--sm .input__el { font-size: var(--fs-13); }
.input__el::placeholder,
.textarea__el::placeholder { color: var(--text-3); opacity: 1; }
.input__el::-webkit-search-cancel-button { -webkit-appearance: none; }
.input__el:disabled { color: var(--text-3); cursor: not-allowed; }
.input__el:-webkit-autofill { -webkit-text-fill-color: var(--text); transition: background-color 9999s; }
.input__icon { color: var(--text-3); }
.input__suffix { color: var(--text-3); font-size: var(--fs-13); white-space: nowrap; }
.input__clear {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: var(--text-3);
  flex: none;
}
.input__clear:hover { background: var(--neutral-soft); color: var(--text); }
.textarea { align-items: stretch; }
.textarea__el {
  flex: 1;
  min-width: 0;
  min-height: calc(var(--ctl-h) + 2px);
  padding: 9px var(--s-12);
  border: 0;
  background: transparent;
  outline: none;
  resize: none;
  color: var(--text);
  font-size: var(--fs-14);
  line-height: 20px;
}

.select { position: relative; display: inline-flex; min-width: 0; }
.select__el {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: calc(var(--ctl-h) + 2px);
  padding: 0 34px 0 var(--s-12);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--field);
  color: var(--text);
  font-size: var(--fs-13);
  cursor: pointer;
  transition: border-color var(--t-1), box-shadow var(--t-1);
}
.select__el:hover { border-color: var(--border-strong); }
.select__el:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.select--sm .select__el { height: var(--ctl-h-sm); border-radius: var(--r-sm); padding-left: var(--s-10); }
.select__chev { position: absolute; top: 50%; right: 10px; margin-top: -8px; color: var(--text-3); pointer-events: none; }

/* переключатель */
.switch-row {
  display: inline-flex;
  align-items: center;
  gap: var(--s-10);
  min-height: 24px;
  border-radius: var(--r-sm);
  text-align: left;
}
.switch-row--bare { border-radius: var(--r-pill); }
.switch {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--border-strong);
  flex: none;
  transition: background var(--t-1);
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-2);
  transition: transform var(--t-1) var(--ease), background var(--t-1);
}
[aria-checked="true"] > .switch { background: var(--accent-grad); box-shadow: none; }
[aria-checked="true"] > .switch::after { transform: translateX(14px); background: var(--on-accent); }
.switch-row__text { display: flex; flex-direction: column; min-width: 0; }
.switch-row__label { font-size: var(--fs-13); font-weight: var(--fw-label); }
.switch-row__desc { font-size: var(--fs-12); color: var(--text-3); }
.switch-row[aria-disabled="true"] { cursor: not-allowed; opacity: .55; }
.switch-row.is-busy { cursor: progress; opacity: .7; }

/* флажок */
.check { position: relative; display: inline-flex; align-items: center; gap: var(--s-8); cursor: pointer; font-size: var(--fs-13); }
.check__el { position: absolute; width: 18px; height: 18px; margin: 0; opacity: 0; cursor: pointer; }
.check__box {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: var(--r-xs);
  background: var(--field);
  box-shadow: inset 0 0 0 1px var(--border-strong);
  color: transparent;
  flex: none;
  transition: background var(--t-1), color var(--t-1);
}
.check__el:checked + .check__box,
.check__el:indeterminate + .check__box { background: var(--accent-grad); box-shadow: none; color: var(--on-accent); }
.check__el:focus-visible + .check__box { outline: 2px solid var(--ring); outline-offset: 2px; }
.check__el:disabled ~ * { opacity: .55; cursor: not-allowed; }

/* сегменты */
.seg {
  display: inline-flex;
  gap: var(--s-2);
  padding: 3px;
  border-radius: var(--r-md);
  background: var(--field);
  border: 1px solid var(--border);
  max-width: 100%;
}
.seg__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-6);
  height: calc(var(--ctl-h) - 6px);
  padding: 0 var(--s-12);
  border-radius: 11px;
  color: var(--text-3);
  font-size: var(--fs-12);
  font-weight: var(--fw-btn);
  white-space: nowrap;
  transition: background var(--t-1), color var(--t-1), transform var(--t-1);
}
.seg__btn:hover { color: var(--text); }
.seg__btn > .mark { flex: none; margin-left: -2px; box-shadow: none; }   /* lead: метка площадки */
.seg__btn:active { transform: scale(.97); }
.seg__btn[aria-checked="true"] { background: var(--surface-3); color: var(--text); box-shadow: var(--sh-1); }
.seg__n { color: var(--text-3); font-size: var(--fs-11); }
.seg--full { display: flex; }
.seg--full .seg__btn { flex: 1; }
.seg--sm .seg__btn { height: calc(var(--ctl-h-sm) - 6px); padding: 0 var(--s-10); border-radius: var(--r-xs); }
.seg--sm { border-radius: var(--r-sm); }

/* вкладки */
.tabs { display: flex; gap: var(--s-16); min-width: 0; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--s-6);
  height: 40px;
  color: var(--text-3);
  font-size: var(--fs-13);
  font-weight: var(--fw-btn);
  white-space: nowrap;
  flex: none;
  transition: color var(--t-1);
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); }
.tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
}
.tab:focus-visible { outline-offset: -2px; }
.tab__n {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--neutral-soft);
  color: var(--text-2);
  font-size: var(--fs-11);
  font-weight: 700;
  line-height: 1;
}
.tab__n--hot { background: var(--danger-soft); color: var(--danger); }

/* ---------- чипы, значки, точки ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-6);
  height: 22px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  background: var(--chip-bg, var(--neutral-soft));
  color: var(--chip-fg, var(--text-2));
  font-size: var(--fs-11);
  font-weight: var(--fw-btn);
  line-height: 1;
  white-space: nowrap;
  flex: none;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.chip--plain::before { display: none; }
.chip[data-tone="wait"],
.chip[data-tone="warn"] { --chip-bg: var(--warn-soft); --chip-fg: var(--warn); }
.chip[data-tone="work"],
.chip[data-tone="accent"] { --chip-bg: var(--accent-soft); --chip-fg: var(--accent-text); }
.chip[data-tone="ok"] { --chip-bg: var(--ok-soft); --chip-fg: var(--ok); }
.chip[data-tone="bad"] { --chip-bg: var(--danger-soft); --chip-fg: var(--danger); }
.chip[data-tone="info"] { --chip-bg: var(--info-soft); --chip-fg: var(--info); }
.chip[data-live]::before { animation: blink 1.6s ease-in-out infinite; }
.chip__n { font-weight: 700; color: var(--text); }
.chip--btn {
  height: 28px;
  padding: 0 11px;
  font-size: var(--fs-12);
  cursor: pointer;
  transition: box-shadow var(--t-1), transform var(--t-1);
}
.chip--btn:hover { box-shadow: inset 0 0 0 1px currentColor; }
.chip--btn:active { transform: scale(.97); }
.chip--btn[aria-pressed="true"] { box-shadow: inset 0 0 0 1.5px currentColor; }

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--neutral-soft);
  color: var(--text-2);
  font-size: var(--fs-11);
  font-weight: 700;
  line-height: 1;
  flex: none;
}
.badge[data-tone="bad"] { background: var(--danger-solid); color: var(--on-danger); }
.badge[data-tone="hot"] { background: var(--danger-soft); color: var(--danger); }
.badge[data-tone="accent"] { background: var(--accent-grad); color: var(--on-accent); }
.badge[data-tone="ok"] { background: var(--ok-soft); color: var(--ok); }
.badge[data-tone="wait"],
.badge[data-tone="warn"] { background: var(--warn-soft); color: var(--warn); }

.dot { position: relative; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--text-3)); flex: none; }
.dot[data-tone="ok"] { --dot: var(--ok); }
.dot[data-tone="warn"],
.dot[data-tone="wait"] { --dot: var(--warn); }
.dot[data-tone="bad"] { --dot: var(--danger); }
.dot[data-tone="info"] { --dot: var(--info); }
.dot[data-tone="accent"],
.dot[data-tone="work"] { --dot: var(--accent); }
.dot[data-tone="off"],
.dot[data-tone="muted"] { --dot: var(--border-strong); }
.dot--pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: inherit;
  animation: ping 2.4s ease-out infinite;
}
@keyframes ping { 0% { transform: scale(1); opacity: .55; } 70%, 100% { transform: scale(2.8); opacity: 0; } }

.delta {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  height: 22px;
  padding: 0 var(--s-8) 0 var(--s-6);
  border-radius: var(--r-pill);
  font-size: var(--fs-12);
  font-weight: var(--fw-head);
  line-height: 1;
  white-space: nowrap;
  flex: none;
}
.delta--good { background: var(--ok-soft); color: var(--ok); }
.delta--bad { background: var(--danger-soft); color: var(--danger); }
.delta--flat { padding: 0 var(--s-8); background: var(--neutral-soft); color: var(--text-2); }

/* плитка-иконка: мягкий цветной квадрат под значок */
.tile {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: var(--tile-bg, var(--neutral-soft));
  color: var(--tile-fg, var(--text-2));
  flex: none;
}
.tile[data-tone="wait"],
.tile[data-tone="warn"] { --tile-bg: var(--warn-soft); --tile-fg: var(--warn); }
.tile[data-tone="work"],
.tile[data-tone="accent"] { --tile-bg: var(--accent-soft); --tile-fg: var(--accent-text); }
.tile[data-tone="ok"] { --tile-bg: var(--ok-soft); --tile-fg: var(--ok); }
.tile[data-tone="bad"] { --tile-bg: var(--danger-soft); --tile-fg: var(--danger); }
.tile[data-tone="info"] { --tile-bg: var(--info-soft); --tile-fg: var(--info); }
.tile--sm { width: 28px; height: 28px; border-radius: var(--r-xs); }
.tile--lg { width: 44px; height: 44px; border-radius: var(--r-md); }
.tile--xl { width: 64px; height: 64px; border-radius: var(--r-xl); }

/* аватарка: картинка поверх цветной буквы */
.avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--av, var(--av-6));
  color: var(--on-mark);
  font-size: var(--fs-13);
  font-weight: var(--fw-head);
  line-height: 1;
  flex: none;
  user-select: none;
}
.avatar[data-tone="1"] { --av: var(--av-1); }
.avatar[data-tone="2"] { --av: var(--av-2); }
.avatar[data-tone="3"] { --av: var(--av-3); }
.avatar[data-tone="4"] { --av: var(--av-4); }
.avatar[data-tone="5"] { --av: var(--av-5); }
.avatar[data-tone="6"] { --av: var(--av-6); }
.avatar[data-size="20"] { width: 20px; height: 20px; font-size: 10px; }
.avatar[data-size="24"] { width: 24px; height: 24px; font-size: var(--fs-11); }
.avatar[data-size="28"] { width: 28px; height: 28px; font-size: var(--fs-12); }
.avatar[data-size="36"] { width: 36px; height: 36px; font-size: var(--fs-14); }
.avatar[data-size="40"] { width: 40px; height: 40px; font-size: var(--fs-16); }
.avatar[data-size="64"] { width: 64px; height: 64px; font-size: var(--fs-24); }
.avatar[data-size="96"] { width: 96px; height: 96px; font-size: var(--fs-28); }
.avatar__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* монограмма площадки */
.mark {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--border-strong);
  color: var(--on-mark);
  font-size: var(--fs-11);
  font-weight: 800;
  line-height: 1;
  flex: none;
  user-select: none;
}
.mark--po { background: var(--po); }
.mark--gg { background: var(--gg); }
.mark--xs { width: 16px; height: 16px; border-radius: 50%; font-size: 9px; }
.mark--sm { width: 18px; height: 18px; border-radius: 50%; font-size: 9.5px; }
.mark--lg { width: 32px; height: 32px; border-radius: var(--r-sm); font-size: var(--fs-14); }
/* фирменный значок: форма и цвет — из самого SVG, тонкая обводка, чтобы белый Playerok не терялся на светлом фоне */
.mark--img { background: none; border-radius: 23%; overflow: hidden; box-shadow: 0 0 0 1px var(--border); }
.mark__img { display: block; width: 100%; height: 100%; }

/* ---------- карточка ---------- */
.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.card__head {
  display: flex;
  align-items: center;
  gap: var(--s-8);
  min-height: 46px;
  padding: var(--s-16) var(--card-pad) 0;
  flex: none;
}
.card__icon { color: var(--text-3); }
.card__title { font-size: var(--fs-14); font-weight: var(--fw-head); letter-spacing: -.005em; white-space: nowrap; }
.card__meta { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-12); color: var(--text-3); }
.card__count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 var(--s-6);
  border-radius: var(--r-pill);
  background: var(--neutral-soft);
  color: var(--text-2);
  font-size: var(--fs-11);
  font-weight: 700;
  line-height: 1;
}
.card__count--hot { background: var(--danger-soft); color: var(--danger); }
.card__actions { display: flex; align-items: center; gap: var(--s-8); margin-left: auto; }
.card__link { display: inline-flex; align-items: center; gap: var(--s-2); }
.card__body { flex: 1; min-width: 0; padding: var(--card-pad); }
.card__head + .card__body { padding-top: var(--s-12); }
.card__body--flush,
.card__head + .card__body--flush { padding: 0; }
.card__head + .card__body--flush { padding-top: var(--s-6); }

/* список строк внутри карточки (строки со скруглённой подсветкой) */
.list { display: flex; flex-direction: column; gap: var(--s-2); padding: 0 var(--s-8) var(--s-8); min-width: 0; }
.lrow {
  display: flex;
  align-items: center;
  gap: var(--s-12);
  width: 100%;
  min-height: var(--row-h);
  padding: var(--s-8) var(--s-12);
  border-radius: var(--r-sm);
  font-size: var(--fs-13);
  text-align: left;
}
.lrow--link { cursor: pointer; transition: background var(--t-1); }
.lrow--link:hover,
.lrow[aria-current="true"] { background: var(--surface-hover); }
.lrow:focus-visible { outline-offset: -2px; }
.lrow__lead { display: inline-flex; flex: none; }
.lrow__main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.lrow__title { font-weight: var(--fw-btn); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow__sub { font-size: var(--fs-12); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow__meta { font-size: var(--fs-12); color: var(--text-3); white-space: nowrap; flex: none; }
.lrow__trail { display: inline-flex; align-items: center; gap: var(--s-8); flex: none; }

/* ---------- таблица ---------- */
.tbl-wrap { min-width: 0; }
.tbl-wrap.is-loading { opacity: .55; pointer-events: none; transition: opacity var(--t-2); }
.tbl { width: 100%; font-size: var(--fs-13); }
.tbl th {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  height: 38px;
  padding: 0 var(--s-12);
  background: var(--surface-1);
  box-shadow: inset 0 -1px 0 var(--border);
  font-size: var(--fs-11);
  font-weight: var(--fw-head);
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-3);
  text-align: left;
  white-space: nowrap;
}
.tbl td {
  height: var(--row-h);
  padding: var(--s-8) var(--s-12);
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
  transition: background var(--t-1);
}
.tbl th:first-child,
.tbl td:first-child { padding-left: var(--card-pad); }
.tbl th:last-child,
.tbl td:last-child { padding-right: var(--card-pad); }
.tbl .is-right { text-align: right; }
.tbl .is-center { text-align: center; }
.tbl td.is-right { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl td.is-primary { font-weight: var(--fw-btn); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--surface-hover); }
.tbl--click tbody tr { cursor: pointer; }
.tbl tbody tr:focus-visible { outline-offset: -2px; }
.tbl tfoot td { height: calc(var(--row-h) + 2px); border-top: 1px solid var(--border); border-bottom: 0; background: var(--surface-2); font-weight: var(--fw-num); }
.tbl tfoot td:first-child { border-radius: 0 0 0 var(--r-lg); }
.tbl tfoot td:last-child { border-radius: 0 0 var(--r-lg) 0; }
.tbl--compact th { height: 32px; }
.tbl--compact td { height: 36px; padding-top: var(--s-4); padding-bottom: var(--s-4); }
.tbl.is-empty thead { display: none; }
.tbl__sort { display: inline-flex; align-items: center; gap: var(--s-4); color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; border-radius: var(--r-xs); }
.tbl__sort:hover { color: var(--text); }
.tbl__sort-ic { opacity: 0; transition: opacity var(--t-1), transform var(--t-1); }
.tbl__sort:hover .tbl__sort-ic { opacity: .6; }
th[aria-sort] .tbl__sort { color: var(--text); }
th[aria-sort] .tbl__sort-ic { opacity: 1; }
th[aria-sort="ascending"] .tbl__sort-ic { transform: rotate(180deg); }
.tbl th.is-right .tbl__sort { flex-direction: row-reverse; }
/* таблица вплотную к верху карточки: шапка повторяет скругление, иначе её фон торчит за углы */
.card__body--flush:first-child > .tbl-wrap:first-child .tbl thead th:first-child { border-top-left-radius: var(--r-lg); }
.card__body--flush:first-child > .tbl-wrap:first-child .tbl thead th:last-child { border-top-right-radius: var(--r-lg); }
.tbl__more { display: flex; justify-content: center; padding: var(--s-8); border-top: 1px solid var(--border); }
.tbl__empty { padding: var(--s-16) var(--card-pad); }

/* ---------- ключ—значение, шаги, шкала ---------- */
.kv {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--s-10) var(--s-12);
  align-items: center;
  font-size: var(--fs-13);
}
.kv dt { color: var(--text-3); }
.kv dd { display: flex; align-items: center; justify-content: flex-end; gap: var(--s-6); min-width: 0; min-height: 20px; text-align: right; font-weight: var(--fw-label); }
.kv__value { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.kv dd .icon-btn { margin: -4px -4px -4px 0; }
.kv dd.is-ok { color: var(--ok); }
.kv dd.is-bad { color: var(--danger); }
.kv dd.is-warn { color: var(--warn); }
.kv dd.is-muted { color: var(--text-3); font-weight: var(--fw-text); }
.kv--dense { gap: var(--s-6) var(--s-12); }

.steps { display: flex; flex-direction: column; }
.step {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  column-gap: var(--s-12);
  align-items: start;
  padding-bottom: 13px;
  font-size: var(--fs-13);
  line-height: 22px;
}
.step:last-child { padding-bottom: 0; }
.step::before { content: ""; position: absolute; left: 10px; top: 24px; bottom: 2px; width: 2px; border-radius: 1px; background: var(--border); }
.step:last-child::before { display: none; }
.step__node {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--border-strong);
  color: transparent;
}
.step__main { display: flex; flex-direction: column; min-width: 0; }
.step__label { color: var(--text-3); }
.step__note { font-size: var(--fs-12); line-height: 1.4; color: var(--text-3); }
.step__time { font-size: var(--fs-12); color: var(--text-3); }
.step[data-state="done"] .step__node { background: var(--ok-soft); box-shadow: none; color: var(--ok); }
.step[data-state="done"]::before { background: var(--ok-line); }
.step[data-state="done"] .step__label { color: var(--text); }
.step[data-state="current"] .step__node { box-shadow: inset 0 0 0 2px var(--warn), 0 0 0 4px var(--warn-soft); }
.step[data-state="current"] .step__node::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); animation: blink 1.6s ease-in-out infinite; }
.step[data-state="current"] .step__label { color: var(--text); font-weight: var(--fw-btn); }
.step[data-state="current"] .step__time { color: var(--warn); font-weight: var(--fw-btn); }
.step[data-state="fail"] .step__node { background: var(--danger-soft); box-shadow: none; color: var(--danger); }
.step[data-state="fail"] .step__label { color: var(--danger); font-weight: var(--fw-btn); }

.meter { display: inline-flex; align-items: center; gap: var(--s-8); min-width: 0; }
.meter__track { position: relative; flex: 1; min-width: 48px; height: 6px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.meter__fill { position: absolute; top: 0; bottom: 0; left: 0; border-radius: var(--r-pill); background: var(--meter, var(--accent)); transition: width var(--t-3) var(--ease); }
.meter[data-tone="ok"] { --meter: var(--ok); }
.meter[data-tone="warn"],
.meter[data-tone="wait"] { --meter: var(--warn); }
.meter[data-tone="bad"] { --meter: var(--danger); }
.meter[data-tone="muted"] { --meter: var(--seg-2); }
.meter__value { font-size: var(--fs-12); color: var(--text-2); white-space: nowrap; }

/* ---------- подсказка ---------- */
.tip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--z-tip);
  max-width: 280px;
  padding: 5px 9px;
  border-radius: var(--r-sm);
  background: var(--tip-bg);
  color: var(--tip-fg);
  font-size: var(--fs-12);
  font-weight: 500;
  line-height: 1.35;
  pointer-events: none;
  box-shadow: var(--sh-2);
  opacity: 0;
  transition: opacity var(--t-1);
}
.tip.is-open { opacity: 1; }

/* ---------- поповер и меню ---------- */
.pop {
  position: fixed;
  top: 0;
  left: 0;
  min-width: 220px;
  max-width: min(380px, calc(100vw - 16px));
  max-height: calc(100dvh - 16px);
  overflow-y: auto;
  padding: var(--s-12);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  box-shadow: var(--sh-2);
  opacity: 0;
  transform: translateY(-4px) scale(.98);
  transition: opacity var(--t-1), transform var(--t-1) var(--ease);
}
.pop[data-side="top"] { transform: translateY(4px) scale(.98); }
.pop.is-open { opacity: 1; transform: none; }
.pop:focus { outline: none; }
.pop--menu { padding: var(--s-8); }
.pop__title { padding: var(--s-8) var(--s-12) var(--s-4); }
.pop__sep { height: 1px; margin: var(--s-6) var(--s-8); background: var(--border); }
.menu { display: flex; flex-direction: column; gap: 1px; }
.mitem {
  display: flex;
  align-items: center;
  gap: var(--s-12);
  width: 100%;
  min-height: 38px;
  padding: var(--s-8) var(--s-12);
  border-radius: var(--r-sm);
  font-size: var(--fs-13);
  text-align: left;
  transition: background var(--t-1);
}
button.mitem:hover,
button.mitem:focus-visible { background: var(--neutral-soft); outline: none; }
.mitem > .ic:first-child { color: var(--text-3); }
.mitem__body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.mitem__label { font-weight: var(--fw-label); }
.mitem__desc { font-size: var(--fs-12); line-height: 1.35; color: var(--text-3); }
.mitem__hint { font-size: var(--fs-12); color: var(--text-3); white-space: nowrap; }
.mitem__check { color: var(--accent-text); visibility: hidden; }
.mitem[aria-checked="true"] { background: var(--accent-soft); }
.mitem[aria-checked="true"] .mitem__label { color: var(--accent-text); }
.mitem[aria-checked="true"] .mitem__check { visibility: visible; }
.mitem[aria-checked="true"] > .ic:first-child { color: var(--accent-text); }
.mitem--danger { color: var(--danger); }
.mitem--danger > .ic:first-child { color: var(--danger); }
.mitem[aria-disabled="true"] { cursor: not-allowed; color: var(--text-3); }
.mitem[aria-disabled="true"]:hover { background: transparent; }
.mitem[aria-disabled="true"] .mitem__label { color: var(--text-3); }

/* ---------- затемнение, окно, панель ---------- */
.scrim { position: fixed; inset: 0; background: var(--scrim); opacity: 0; transition: opacity var(--t-2); }
.scrim.is-open { opacity: 1; }

.dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  display: flex;
  flex-direction: column;
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  background: var(--surface-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-3);
  opacity: 0;
  transform: translate(-50%, calc(-50% + 10px)) scale(.97);
  transition: opacity var(--t-2), transform var(--t-2) var(--ease);
}
.dialog.is-open { opacity: 1; transform: translate(-50%, -50%); }
.dialog:focus { outline: none; }
.dialog--sm { width: min(450px, calc(100vw - 32px)); }
.dialog--lg { width: min(760px, calc(100vw - 32px)); }
.dialog__head { display: flex; align-items: center; gap: var(--s-12); padding: var(--s-16) var(--s-16) var(--s-4) var(--s-24); flex: none; }
.dialog__title { flex: 1; min-width: 0; font-size: var(--fs-16); font-weight: var(--fw-num); letter-spacing: -.01em; }
.dialog__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: var(--d-bg, var(--accent-soft));
  color: var(--d-fg, var(--accent-text));
  flex: none;
}
.dialog[data-tone="danger"] { --d-bg: var(--danger-soft); --d-fg: var(--danger); }
.dialog[data-tone="ok"] { --d-bg: var(--ok-soft); --d-fg: var(--ok); }
.dialog[data-tone="warn"] { --d-bg: var(--warn-soft); --d-fg: var(--warn); }
.dialog__body { display: flex; flex-direction: column; gap: var(--s-12); min-height: 0; overflow-y: auto; padding: var(--s-12) var(--s-24) var(--s-16); }
.dialog__text { color: var(--text-2); line-height: 1.5; }
.dialog__facts {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px var(--s-16);
  padding: var(--s-12) var(--s-16);
  border-radius: var(--r-md);
  background: var(--surface-2);
  font-size: var(--fs-13);
}
.dialog__facts dt { color: var(--text-2); }
.dialog__facts dd { text-align: right; font-weight: var(--fw-btn); }
.dialog__foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: var(--s-8); padding: var(--s-4) var(--s-24) var(--s-24); flex: none; }
.dialog--confirm .dialog__body { gap: var(--s-8); padding-top: var(--s-24); }
.dialog--confirm .dialog__title { flex: none; margin-top: var(--s-8); font-size: var(--fs-20); }
.dialog--confirm .dialog__facts { margin-top: var(--s-8); }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(var(--drawer-w, 400px), 100vw);
  background: var(--surface-1);
  border-left: 1px solid var(--border);
  box-shadow: var(--sh-3);
  opacity: 0;
  transform: translateX(32px);
  transition: opacity var(--t-2), transform var(--t-2) var(--ease);
}
.drawer.is-open { opacity: 1; transform: none; }
.drawer:focus { outline: none; }
.drawer__head { display: flex; align-items: center; gap: var(--s-12); min-height: var(--topbar-h); padding: var(--s-8) var(--s-12) var(--s-8) var(--s-20); border-bottom: 1px solid var(--border); flex: none; }
.drawer__icon { display: grid; place-items: center; color: var(--text-2); }
.drawer__titles { flex: 1; min-width: 0; }
.drawer__title { font-size: var(--fs-16); font-weight: var(--fw-num); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer__sub { font-size: var(--fs-12); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer__actions { display: flex; align-items: center; gap: var(--s-2); flex: none; }
.drawer__body { flex: 1; min-height: 0; overflow-y: auto; }
.drawer__foot { padding: var(--s-12) var(--s-20); border-top: 1px solid var(--border); flex: none; }

/* ---------- тосты ---------- */
.toasts {
  position: fixed;
  left: 50%;
  bottom: var(--s-24);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-8);
  width: max-content;
  max-width: calc(100vw - 24px);
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--s-12);
  max-width: min(520px, 100%);
  padding: var(--s-10) 14px var(--s-10) var(--s-12);
  border-radius: var(--r-md);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  box-shadow: var(--sh-2);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(12px) scale(.96);
  transition: opacity var(--t-2), transform var(--t-2) var(--ease);
}
.toast.is-open { opacity: 1; transform: none; }
.toast__icon { color: var(--toast-fg, var(--text-2)); }
.toast[data-tone="ok"] { --toast-fg: var(--ok); }
.toast[data-tone="warn"] { --toast-fg: var(--warn); }
.toast[data-tone="bad"] { --toast-fg: var(--danger); }
.toast[data-tone="info"] { --toast-fg: var(--accent-text); }
.toast__body { flex: 1; min-width: 0; font-size: var(--fs-13); line-height: 1.4; }
.toast__title { font-weight: var(--fw-label); overflow-wrap: anywhere; }
.toast__text { color: var(--text-2); overflow-wrap: anywhere; }
.toast__action { color: var(--accent-text); font-size: var(--fs-13); font-weight: var(--fw-head); border-radius: var(--r-xs); white-space: nowrap; }
.toast__action:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- скелетон, пусто, ошибка ---------- */
.sk {
  display: block;
  height: 12px;
  border-radius: var(--r-xs);
  background: linear-gradient(90deg, var(--skeleton-a) 25%, var(--skeleton-b) 50%, var(--skeleton-a) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  flex: none;
}
.sk--circle { border-radius: 50%; }
.sk-text { display: flex; flex-direction: column; gap: var(--s-10); }
.sk-rows { display: flex; flex-direction: column; padding: 0 var(--s-8) var(--s-8); }
.sk-row { display: flex; align-items: center; gap: var(--s-12); min-height: var(--row-h); padding: var(--s-8) var(--s-12); }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-6);
  padding: var(--s-40) var(--s-24);
  text-align: center;
}
.empty__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: var(--s-8);
  border-radius: var(--r-lg);
  background: var(--neutral-soft);
  color: var(--text-3);
}
.empty--accent .empty__icon { background: var(--accent-soft); color: var(--accent-text); }
.empty__title { font-size: var(--fs-16); font-weight: var(--fw-head); }
.empty__text { max-width: 360px; font-size: var(--fs-13); color: var(--text-2); overflow-wrap: anywhere; }
.empty .btn { margin-top: var(--s-10); }
.empty--compact { padding: var(--s-20) var(--s-16); }
.empty--compact .empty__icon { width: 40px; height: 40px; border-radius: var(--r-md); }
.empty--compact .empty__title { font-size: var(--fs-14); }
.empty--error .empty__icon { background: var(--danger-soft); color: var(--danger); }
.empty--page { min-height: 100%; }
.empty-line { padding: var(--s-4) 0; font-size: var(--fs-13); color: var(--text-3); }

/* ---------- период и зона файлов ---------- */
.drange__chev { color: var(--text-3); margin-right: -4px; }
.drange-pop { min-width: 250px; }
.drange__custom { display: flex; flex-direction: column; gap: var(--s-8); margin-top: var(--s-6); padding: var(--s-12) var(--s-8) var(--s-6); border-top: 1px solid var(--border); }
.drange__inputs { display: flex; align-items: center; gap: var(--s-6); }
.drange__inputs .input { flex: 1; }

.drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-4);
  min-height: 140px;
  padding: var(--s-20);
  border-radius: var(--r-lg);
  border: 1.5px dashed var(--border-strong);
  background: var(--field);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--t-1), background var(--t-1);
}
.drop:hover,
.drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.drop.is-invalid { border-color: var(--danger-line); }
.drop__icon { color: var(--text-3); margin-bottom: var(--s-4); }
.drop__title { font-size: var(--fs-13); font-weight: var(--fw-btn); }
.drop__hint { font-size: var(--fs-12); color: var(--text-3); }
.drop__error { font-size: var(--fs-12); color: var(--danger); }
.drop__preview { width: 96px; height: 96px; margin-bottom: var(--s-8); border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 1px var(--border-strong); }
.drop__preview img { width: 100%; height: 100%; object-fit: cover; }
.drop.has-preview .drop__icon { display: none; }

/* ---------- мелочи ---------- */
mark.hl { background: var(--accent-soft); color: inherit; border-radius: var(--r-2xs); }
.svg-inline { display: inline-block; }
.svg-inline svg { display: block; width: 100%; height: 100%; }

/* ---------- графики (js/charts.js) ---------- */
.chart { position: relative; min-width: 0; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart__legend:not(:empty) { margin-bottom: var(--s-8); }
.chart__plot { position: relative; touch-action: pan-y; border-radius: var(--r-sm); }
.chart__plot:focus-visible { outline-offset: 4px; }
.chart-grid { stroke: var(--viz-grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart-grid--zero { stroke: var(--border-strong); }
.chart-ax { fill: var(--text-3); font: 400 11px var(--font-sans); font-variant-numeric: tabular-nums; }
.chart-bar--1 { fill: var(--viz-1); }
.chart-bar--2 { fill: var(--viz-2); }
.chart-line { fill: none; stroke: var(--viz-3); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-line--halo { stroke: var(--surface-1); stroke-width: 5; }
.chart-area { fill: var(--viz-area); }
.chart-dot { fill: var(--viz-3); stroke: var(--surface-1); stroke-width: 2; }
.chart-band { fill: var(--viz-hover); }
.chart-tip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: var(--z-sticky);
  min-width: 176px;
  padding: var(--s-10) var(--s-12);
  border-radius: var(--r-md);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  box-shadow: var(--sh-2);
  font-size: var(--fs-12);
  pointer-events: none;
}
.chart-tip__title { margin-bottom: var(--s-6); font-size: var(--fs-13); font-weight: var(--fw-head); }
.chart-tip__row { display: flex; align-items: center; gap: 7px; height: 20px; color: var(--text-2); }
.chart-tip__row b { margin-left: auto; padding-left: var(--s-16); font-weight: var(--fw-btn); color: var(--text); }
.chart-key { display: inline-block; width: 10px; height: 10px; border-radius: var(--r-2xs); flex: none; }
.chart-key--1 { background: var(--viz-1); }
.chart-key--2 { background: var(--viz-2); }
.chart-key--line { width: 16px; height: 2px; border-radius: 1px; background: var(--viz-3); }
.chart-legend { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-4) var(--s-16); font-size: var(--fs-12); color: var(--text-2); }
.chart-legend li { display: inline-flex; align-items: center; gap: var(--s-6); white-space: nowrap; }

.spark { display: block; overflow: visible; flex: none; }
.spark__line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spark__area { fill: var(--viz-area); }
.spark__dot { fill: var(--accent); stroke: var(--surface-1); stroke-width: 2; }
.spark__bar { fill: var(--viz-1); }
.spark__bar--off { fill: var(--surface-3); }
.spark__base { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 3; }

.heat { display: grid; grid-template-columns: auto repeat(24, minmax(0, 1fr)); gap: 3px; align-items: center; font-size: var(--fs-11); color: var(--text-3); }
.heat__cell { aspect-ratio: 1; min-height: 12px; border-radius: var(--r-2xs); background: var(--surface-2); }
.heat__cell[data-level="1"] { background: color-mix(in srgb, var(--viz-1) 22%, var(--surface-2)); }
.heat__cell[data-level="2"] { background: color-mix(in srgb, var(--viz-1) 45%, var(--surface-2)); }
.heat__cell[data-level="3"] { background: color-mix(in srgb, var(--viz-1) 70%, var(--surface-2)); }
.heat__cell[data-level="4"] { background: var(--viz-1); }
.heat__row { padding-right: var(--s-6); white-space: nowrap; }
.heat__col { text-align: center; }

.hbars { display: flex; flex-direction: column; gap: var(--s-10); }
.hbar { display: grid; grid-template-columns: minmax(96px, 30%) minmax(0, 1fr) auto; align-items: center; gap: var(--s-12); font-size: var(--fs-13); }
.hbar__label { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar__track { height: 8px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.hbar__fill { display: block; height: 100%; width: var(--w, 0%); min-width: 2px; border-radius: var(--r-pill); background: var(--viz-1); }
.hbar[data-tone="muted"] .hbar__fill { background: var(--viz-2); }
.hbar[data-tone="bad"] .hbar__fill { background: var(--danger); }
.hbar[data-tone="ok"] .hbar__fill { background: var(--ok); }
.hbar__value { font-weight: var(--fw-btn); white-space: nowrap; }
.hbar__hint { margin-left: var(--s-6); font-weight: var(--fw-text); color: var(--text-3); }

.smeter { display: flex; flex-direction: column; gap: var(--s-8); min-width: 0; }
.smeter__bar { display: flex; gap: 2px; height: 6px; }
.smeter__seg { flex: var(--f, 1) 1 0%; min-width: 4px; border-radius: var(--r-2xs); background: var(--seg, var(--surface-3)); }
.smeter__seg[data-i="0"],
.smeter__key[data-i="0"] { --seg: var(--accent); }
.smeter__seg[data-i="1"],
.smeter__key[data-i="1"] { --seg: var(--seg-2); }
.smeter__seg[data-i="2"],
.smeter__key[data-i="2"] { --seg: var(--seg-3); }
.smeter__legend { display: flex; flex-wrap: wrap; gap: var(--s-4) var(--s-16); font-size: var(--fs-12); color: var(--text-2); }
.smeter__item { display: inline-flex; align-items: center; gap: var(--s-6); white-space: nowrap; }
.smeter__key { width: 8px; height: 8px; border-radius: 2px; background: var(--seg, var(--surface-3)); }
.smeter__item b { font-weight: var(--fw-btn); color: var(--text); }

/* ---------- под телефон ---------- */
@media (max-width: 760px) {
  .hide-sm { display: none !important; }

  /* таблица → стопка строк-карточек */
  .tbl,
  .tbl tbody,
  .tbl tfoot,
  .tbl tr,
  .tbl td { display: block; }
  .tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tbl tr { padding: var(--s-10) var(--s-16); border-bottom: 1px solid var(--border); }
  .tbl tbody tr:last-child { border-bottom: 0; }
  .tbl td,
  .tbl td:first-child,
  .tbl td:last-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-12);
    height: auto;
    min-height: 24px;
    padding: var(--s-2) 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    text-align: right;
  }
  .tbl td::before { content: attr(data-label); color: var(--text-3); font-weight: var(--fw-text); text-align: left; flex: none; }
  .tbl td.is-primary { justify-content: flex-start; font-size: var(--fs-14); text-align: left; }
  .tbl td.is-primary::before { display: none; }
  .tbl tbody tr:hover td { background: transparent; }
  .tbl tfoot tr { background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
  .tbl tfoot td { border-top: 0; }
  .tbl tfoot td:first-child::before { display: none; }

  /* панели и окна становятся листами на весь экран / снизу */
  .drawer { width: 100vw; border-left: 0; transform: translateY(24px); }
  .drawer__head { padding-left: var(--s-16); }
  .dialog {
    top: auto;
    bottom: 0;
    left: 0;
    width: 100vw;
    max-height: 92dvh;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    border-width: 1px 0 0;
    transform: translateY(24px);
  }
  .dialog.is-open { transform: none; }
  .dialog--sm,
  .dialog--lg { width: 100vw; }
  .dialog__foot { padding-bottom: calc(var(--s-20) + env(safe-area-inset-bottom, 0px)); }
  .dialog__foot .btn { flex: 1; }
  .toasts { bottom: calc(var(--tabbar-h) + var(--s-12) + env(safe-area-inset-bottom, 0px)); }
  .hbar { grid-template-columns: minmax(0, 1fr) auto; }
  .hbar__track { grid-column: 1 / -1; order: 3; }
}
