/* Hallmark · shape: app screen · scope: app · genre: modern-minimal · theme: custom (taste-skill accent-ladder, seed 1824622618) · signature: смена конвейера 09–21 с отметками найденных · modes: light+dark · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H5 E4 S4 R5 V4 · weakest: P, a control panel argues little; led with the conveyor's working day instead of a stat row */

/* ---------- Tokens ----------
   Фон, поверхность, текст и подсказки берутся из Telegram.ThemeParams
   (telegram-web-app.js сам выставляет --tg-theme-*). Свой у продукта только
   малиновый акцент: полная сила на мелких метках, бледные оттенки на площадях. */
:root {
  --font: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;

  --ground: var(--tg-theme-secondary-bg-color, #f6f2f3);
  --surface: var(--tg-theme-section-bg-color, var(--tg-theme-bg-color, #ffffff));
  --text: var(--tg-theme-text-color, #16121a);
  --muted: var(--tg-theme-hint-color, #6a6170);
  --link: var(--tg-theme-link-color, #a32a5c);
  --negative: var(--tg-theme-destructive-text-color, #c4242a);
  --border: color-mix(in srgb, var(--text) 9%, var(--surface));
  --rule: color-mix(in srgb, var(--text) 6%, var(--surface));
  --raised: color-mix(in srgb, var(--text) 5%, var(--surface));
  --control: color-mix(in srgb, var(--text) 22%, var(--surface));

  --accent: #b8336a;
  --on-accent: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 10%, var(--surface));
  --accent-track: color-mix(in srgb, var(--accent) 22%, var(--surface));
  --accent-ink: #6b1d3e;

  --positive: #247b50;
  --pill-positive-bg: color-mix(in srgb, var(--positive) 14%, var(--surface));
  --pill-positive-ink: #14532d;
  --pill-negative-bg: color-mix(in srgb, var(--negative) 12%, var(--surface));
  --pill-negative-ink: #831c1e;
  --pill-neutral-bg: var(--raised);
  --pill-neutral-ink: color-mix(in srgb, var(--text) 78%, var(--surface));

  --tint-1: #f6dfe8; --tint-2: #dfe9f4; --tint-3: #e3efe2; --tint-4: #f3eadb; --tint-5: #e9e3f1; --tint-6: #dcefee;
  --tint-ink: #2a2230;

  --scrim: rgba(18, 12, 20, 0.86);
  --on-scrim: #ffffff;
  --shadow-float: 0 8px 24px rgba(18, 12, 20, 0.18);

  --radius-card: 14px;
  --radius-control: 10px;
  --pad: 16px;
  --gap: 12px;
  --fs-title: 24px;
  --fs-figure: 32px;
  --fs-section: 17px;
  --fs-body: 15px;
  --fs-small: 13px;
  --fs-meta: 12px;
  --tabbar-h: 60px;
  --bar-h: 52px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-micro: 120ms;
  --dur-short: 220ms;
}

:root[data-theme="dark"] {
  --ground: var(--tg-theme-secondary-bg-color, #0f0d10);
  --surface: var(--tg-theme-section-bg-color, var(--tg-theme-bg-color, #1b181c));
  --text: var(--tg-theme-text-color, #f3eef2);
  --muted: var(--tg-theme-hint-color, #a59ca8);
  --link: var(--tg-theme-link-color, #f08ab3);
  --negative: var(--tg-theme-destructive-text-color, #ff6b6b);
  --accent: #c93a76;
  --accent-soft: color-mix(in srgb, var(--accent) 16%, var(--surface));
  --accent-track: color-mix(in srgb, var(--accent) 30%, var(--surface));
  --accent-ink: #ffc2db;
  --positive: #4fbf86;
  --pill-positive-ink: #b8f0d0;
  --pill-negative-ink: #ffc9c9;
  --tint-1: #4a2636; --tint-2: #233446; --tint-3: #263b2a; --tint-4: #43372a; --tint-5: #35304a; --tint-6: #213d3c;
  --tint-ink: #f3eef2;
  --scrim: rgba(250, 246, 249, 0.94);
  --on-scrim: #16121a;
  --shadow-float: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
::selection { background: var(--accent-track); color: var(--text); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--link); text-underline-offset: 3px; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.noscript { padding: 24px var(--pad); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 24px);
}
.app.has-main { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 96px); }
.app.no-tabs { padding-bottom: calc(env(safe-area-inset-bottom) + 96px); }

/* ---------- Bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  height: var(--bar-h);
  padding: 0 var(--pad);
  background: var(--ground);
}
.bar-back {
  display: grid; place-items: center;
  width: 44px; height: 44px; margin-left: -12px;
  border: 0; background: none; border-radius: var(--radius-control);
}
.bar-back svg { width: 22px; height: 22px; fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bar-back:active { background: var(--raised); }
.mark { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 600; font-size: var(--fs-section); letter-spacing: -0.01em; }
.mark-glyph { width: 28px; height: 28px; }
.mark-tile { fill: var(--accent); }
.mark-pin { fill: var(--on-accent); }
.mark-cursor { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; }
.bar-scope { margin-left: auto; color: var(--muted); font-size: var(--fs-small); }

/* ---------- Screen frame ---------- */
.screens { padding: 4px var(--pad) 0; }
.screen { display: flex; flex-direction: column; gap: 20px; }
.head { display: flex; flex-direction: column; gap: 4px; padding-top: 4px; }
.head h1 { margin: 0; font-size: var(--fs-title); line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; overflow-wrap: break-word; min-width: 0; }
.head p { margin: 0; color: var(--muted); font-size: var(--fs-body); }
.head .finding { color: var(--text); }

.panel { background: var(--surface); color: var(--text); border-radius: var(--radius-card); padding: var(--pad); }
.panel-flush { padding: 0; overflow: hidden; }
.group { display: flex; flex-direction: column; gap: 8px; }
.group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 4px; }
.group-head h2 { margin: 0; font-size: var(--fs-section); font-weight: 600; letter-spacing: -0.01em; }
.group-note { margin: 0; padding: 0 4px; color: var(--muted); font-size: var(--fs-small); }
.text-btn {
  min-height: 44px; margin: -12px -8px; padding: 0 8px;
  border: 0; background: none; color: var(--link); font-size: var(--fs-small); font-weight: 500;
  border-radius: var(--radius-control);
}
.text-btn:active { background: var(--raised); }
.text-btn:disabled { background: none; color: var(--control); cursor: not-allowed; }

/* ---------- Pult: switch row ---------- */
.run { display: flex; flex-direction: column; gap: 16px; }
.run-row { display: flex; align-items: center; gap: 16px; }
.run-state { flex: 1; min-width: 0; }
.run-state strong { display: block; font-size: var(--fs-section); font-weight: 600; }
.run-state span { display: block; color: var(--muted); font-size: var(--fs-small); margin-top: 2px; }

.switch {
  position: relative; flex: none;
  width: 56px; height: 34px; padding: 0;
  border: 0; border-radius: 17px;
  background: var(--control);
  transition: background-color var(--dur-short) var(--ease-out);
}
.switch[aria-checked="true"] { background: var(--accent); }
.switch-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 28px; height: 28px; border-radius: 14px;
  background: var(--on-accent);
  transform-origin: center;
}
.switch:active .switch-thumb { transform: scale(0.94); }

/* signature: the conveyor's working day */
.shift { display: flex; flex-direction: column; gap: 8px; }
.shift-track { position: relative; height: 44px; border-radius: var(--radius-control); background: var(--raised); overflow: hidden; }
.shift-done { position: absolute; inset: 0 auto 0 0; background: var(--accent-soft); transform-origin: left center; }
.shift-now { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--accent); }
.shift-hit { position: absolute; top: 12px; width: 8px; height: 20px; margin-left: -4px; border-radius: 3px; background: var(--accent); }
.shift-hours { display: flex; justify-content: space-between; color: var(--muted); font-size: var(--fs-meta); font-variant-numeric: tabular-nums; }
.shift-legend { margin: 0; color: var(--muted); font-size: var(--fs-small); }
.shift.is-off .shift-hit, .shift.is-off .shift-now { background: var(--control); }
.shift.is-off .shift-done { background: var(--raised); }

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 16px;
  border: 1px solid var(--border); border-radius: 20px;
  background: var(--surface); color: var(--text);
  font-size: var(--fs-small); font-weight: 500;
  transition: background-color var(--dur-micro) linear, border-color var(--dur-micro) linear, color var(--dur-micro) linear;
}
.chip svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-track); color: var(--accent-ink); }
.chip[aria-pressed="false"] svg.chip-check { display: none; }
.chip-add { color: var(--link); border-style: dashed; }
.chip:active { transform: scale(0.96); }
.add-form { display: flex; gap: 8px; }
.add-form input {
  flex: 1; min-width: 0; height: 44px; padding: 0 16px;
  border: 1px solid var(--control); border-radius: var(--radius-control);
  background: var(--surface);
}
.add-form input::placeholder { color: var(--muted); }
.add-form input:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.add-form button { height: 44px; padding: 0 16px; border: 0; border-radius: var(--radius-control); background: var(--text); color: var(--surface); font-weight: 600; }
.field-hint { margin: 0; color: var(--muted); font-size: var(--fs-meta); }

/* ---------- Segmented tabs ---------- */
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--raised); overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button {
  flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-height: 36px; padding: 0 8px;
  border: 0; border-radius: 9px; background: none;
  color: var(--muted); font-size: var(--fs-small); font-weight: 500; white-space: nowrap;
}
.seg button[aria-selected="true"] { background: var(--surface); color: var(--text); }
.seg .count { font-variant-numeric: tabular-nums; color: var(--muted); }

/* ---------- Client list ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li + li .row { border-top: 1px solid var(--rule); }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 68px; padding: 12px var(--pad);
  border: 0; background: none; text-align: left;
  color: var(--text); text-decoration: none;
  transition: background-color var(--dur-micro) linear;
}
.row-when { flex: none; color: var(--muted); font-size: var(--fs-small); font-variant-numeric: tabular-nums; }
.row:active { background: var(--raised); }
.mono {
  flex: none; display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 20px;
  color: var(--tint-ink); font-weight: 600; font-size: var(--fs-body);
}
.t1 { background: var(--tint-1); } .t2 { background: var(--tint-2); } .t3 { background: var(--tint-3); }
.t4 { background: var(--tint-4); } .t5 { background: var(--tint-5); } .t6 { background: var(--tint-6); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.row-line { display: flex; align-items: baseline; gap: 8px; }
.row-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { flex: 1; min-width: 0; color: var(--muted); font-size: var(--fs-small); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rating { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; font-size: var(--fs-small); font-weight: 600; }
.rating svg { width: 13px; height: 13px; fill: var(--accent); }
.chev { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.pill { flex: none; display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px; font-size: var(--fs-meta); font-weight: 600; white-space: nowrap; }
.pill-wait { background: var(--accent-soft); color: var(--accent-ink); }
.pill-sent { background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); }
.pill-replied, .pill-deal { background: var(--pill-positive-bg); color: var(--pill-positive-ink); }
.pill-refused { background: var(--pill-negative-bg); color: var(--pill-negative-ink); }
.pill-skipped { background: var(--pill-neutral-bg); color: var(--muted); }

.empty { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 24px var(--pad); }
.empty p { margin: 0; color: var(--muted); }
.empty strong { display: block; color: var(--text); font-weight: 600; margin-bottom: 2px; }

.skeleton { display: flex; flex-direction: column; }
.skeleton i { position: relative; display: block; height: 68px; border-top: 1px solid var(--rule); }
.skeleton i::before, .skeleton i::after { content: ""; position: absolute; left: var(--pad); height: 12px; border-radius: 6px; background: var(--raised); }
.skeleton i::before { top: 18px; width: 40%; }
.skeleton i::after { top: 40px; width: 25%; height: 10px; }
.skeleton i:first-child { border-top: 0; }

/* ---------- Client detail ---------- */
.facts { display: flex; flex-direction: column; }
.fact { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; padding: 8px var(--pad); }
.fact + .fact { border-top: 1px solid var(--rule); }
.fact dt { color: var(--muted); font-size: var(--fs-small); }
.fact dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.fact a { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-weight: 500; text-decoration: none; }
.fact a svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.site {
  display: flex; align-items: center; gap: 16px; width: 100%;
  padding: 16px var(--pad); border: 0; border-radius: var(--radius-card);
  background: var(--accent-soft); color: var(--accent-ink); text-align: left;
}
.site:active { background: var(--accent-track); }
.site-thumb { flex: none; width: 52px; height: 64px; border-radius: 8px; background: var(--surface); padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.site-thumb i { display: block; height: 4px; border-radius: 2px; background: var(--accent-track); }
.site-thumb i:first-child { height: 18px; background: var(--accent); }
.site-thumb i:nth-child(3) { width: 60%; }
.site-text { flex: 1; min-width: 0; }
.site-text strong { display: block; font-weight: 600; }
.site-text span { display: block; font-size: var(--fs-small); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site svg.ext { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.message textarea {
  display: block; width: 100%; min-height: 220px; padding: 16px var(--pad);
  border: 0; border-radius: var(--radius-card); resize: vertical;
  background: var(--surface); line-height: 1.5; font-size: var(--fs-small);
}
.message textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.status-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.status-grid button {
  min-height: 44px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-control);
  background: var(--surface); font-size: var(--fs-small); font-weight: 500; text-align: left;
  display: flex; align-items: center; gap: 8px;
}
.status-grid button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.status-grid button:last-child:nth-child(odd) { grid-column: 1 / -1; }
.status-grid svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.status-grid button[aria-pressed="false"] svg { visibility: hidden; }

/* ---------- Stats ---------- */
.figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.figure { padding: 16px var(--pad); display: flex; flex-direction: column; gap: 2px; }
.figure:nth-child(even) { border-left: 1px solid var(--rule); }
.figure:nth-child(n+3) { border-top: 1px solid var(--rule); }
.figure b { font-size: var(--fs-figure); line-height: 1.1; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.figure span { color: var(--muted); font-size: var(--fs-small); }

.funnel { display: flex; flex-direction: column; gap: 16px; }
.funnel-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: baseline; }
.funnel-row .name { font-weight: 500; }
.funnel-row .val { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.funnel-row .val small { color: var(--muted); font-weight: 400; font-size: var(--fs-small); margin-left: 8px; }
.funnel-bar { grid-column: 1 / -1; height: 10px; border-radius: 5px; background: var(--raised); overflow: hidden; }
.funnel-bar i { display: block; height: 100%; border-radius: 5px; background: var(--accent); transform-origin: left center; }

.chart svg { width: 100%; height: 172px; overflow: visible; }
.chart .bar-rect { fill: var(--accent-track); }
.chart .bar-rect.is-today { fill: var(--accent); }
.chart .grid-line { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 3 4; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .val-label { fill: var(--text); font-size: 11px; font-weight: 600; font-family: var(--font); }

.split { display: flex; flex-direction: column; }
.split-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px 28px; align-items: center; gap: 12px; min-height: 44px; padding: 0 var(--pad); }
.split-row + .split-row { border-top: 1px solid var(--rule); }
.split-row .track { height: 6px; border-radius: 3px; background: var(--raised); overflow: hidden; }
.split-row .track i { display: block; height: 100%; background: var(--text); opacity: 0.55; border-radius: 3px; transform-origin: left center; }
.split-row .n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- Plan ---------- */
.usage { display: flex; flex-direction: column; gap: 12px; }
.usage-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.usage-top b { font-size: var(--fs-figure); font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.usage-top b small { font-size: var(--fs-body); color: var(--muted); font-weight: 400; letter-spacing: 0; }
.usage-top span { color: var(--muted); font-size: var(--fs-small); text-align: right; }
.meter { height: 10px; border-radius: 5px; background: var(--accent-track); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 5px; transform-origin: left center; }

.plans { display: flex; flex-direction: column; gap: 12px; }
.plan {
  display: flex; flex-direction: column; gap: 12px; width: 100%;
  padding: var(--pad); border: 2px solid transparent; border-radius: var(--radius-card);
  background: var(--surface); text-align: left;
  transition: border-color var(--dur-micro) linear, background-color var(--dur-micro) linear;
}
.plan[aria-checked="true"] { border-color: var(--accent); }
.plan.is-current { background: var(--accent-soft); }
.plan-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.plan-name { font-size: var(--fs-section); font-weight: 600; }
.plan-price { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-variant-numeric: tabular-nums; }
.plan-price svg { width: 16px; height: 16px; fill: var(--accent); }
.plan-price small { color: var(--muted); font-weight: 400; font-size: var(--fs-small); }
.plan ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: var(--fs-small); }
.plan ul li { display: flex; gap: 8px; align-items: center; }
.plan ul svg { flex: none; width: 14px; height: 14px; fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.plan-flag { font-size: var(--fs-meta); font-weight: 600; color: var(--accent-ink); }
.fine { margin: 0; padding: 0 4px; color: var(--muted); font-size: var(--fs-meta); line-height: 1.5; }

/* ---------- Tab bar ---------- */
.tabs {
  position: fixed; z-index: 6; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 560px; margin: 0 auto;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--rule);
}
.app.no-tabs .tabs { display: none; }
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 500;
  transition: color var(--dur-micro) linear;
}
.tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tab[aria-current="page"] { color: var(--text); }
.tab[aria-current="page"] svg { stroke: var(--accent); stroke-width: 2; }
.tab:active svg { transform: scale(0.9); }
.tab-icon { position: relative; }
.badge {
  position: absolute; top: -4px; left: 15px;
  min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: var(--accent); color: var(--on-accent);
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums;
  overflow: hidden;
}
.badge:empty { display: none; }

/* ---------- Local MainButton stand-in ---------- */
.shim-main {
  position: fixed; z-index: 7; left: 0; right: 0;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  max-width: 560px; margin: 0 auto; padding: 12px var(--pad);
  background: var(--ground);
}
.app.no-tabs .shim-main { bottom: env(safe-area-inset-bottom); }
.shim-main button {
  width: 100%; height: 50px; border: 0; border-radius: 12px;
  background: var(--accent); color: var(--on-accent);
  font-size: var(--fs-body); font-weight: 600;
}
.shim-main button:active { transform: scale(0.985); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; z-index: 8; left: 50%; top: calc(var(--bar-h) + 8px);
  max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 12px;
  background: var(--scrim); color: var(--on-scrim); box-shadow: var(--shadow-float); /* taste-skill-ignore: тост парит над экраном */
  font-size: var(--fs-small); font-weight: 500;
  opacity: 0; pointer-events: none; transform: translate(-50%, -8px);
  transition: opacity var(--dur-short) var(--ease-out), transform var(--dur-short) var(--ease-out);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Counter (react-bits Counter, vanilla) ---------- */
.roll { display: inline-flex; overflow: hidden; height: 1.1em; line-height: 1.1em; vertical-align: bottom; }
.roll-digit { display: inline-flex; flex-direction: column; }
.roll-digit span { height: 1.1em; }

@media (hover: hover) {
  .row:hover, .chip:hover { background-color: var(--raised); }
  .chip[aria-pressed="true"]:hover { background-color: var(--accent-track); }
  .tab:hover { color: var(--text); }
  .text-btn:hover { text-decoration: underline; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
  .chip:active, .tab:active svg, .shim-main button:active { transform: none; }
}

/* stats hero figure */
.hero-fig { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 2px; row-gap: 4px; }
.hero-fig b { font-size: 44px; line-height: 1; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--accent); }
.hero-fig b.unit { font-size: 28px; margin-right: 12px; }
.hero-fig span { flex: 1 1 160px; color: var(--text); font-size: var(--fs-body); }

/* ---------- Доступ: приглашение и участники ---------- */
.invite { display: flex; flex-direction: column; gap: 8px; background: var(--accent-soft); color: var(--accent-ink); }
.invite strong { font-size: var(--fs-section); font-weight: 600; }
.invite-link { padding: 12px; border-radius: var(--radius-control); background: var(--surface); color: var(--text); font-size: var(--fs-small); overflow-wrap: anywhere; user-select: all; }
.invite-note { font-size: var(--fs-small); }
.invite-actions { display: flex; gap: 8px; margin-top: 4px; }
.btn-ink, .btn-soft { flex: 1; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--radius-control); font-weight: 600; font-size: var(--fs-small); }
.btn-ink { background: var(--text); color: var(--surface); }
.btn-soft { background: var(--surface); color: var(--text); }
.btn-ink:active, .btn-soft:active { transform: scale(0.98); }
.text-btn.danger { color: var(--negative); }
.plain { margin: 0; }
