/* ============================================================
   Florstat — premium dark analytics terminal
   Display: Clash Display · Body: General Sans · Data: JetBrains Mono
   ============================================================ */
:root {
  /* shape & motion — общие для всех оформлений */
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 24px;
  --ease: cubic-bezier(.2,.7,.3,1);

  /* ============================================================
     ОФОРМЛЕНИЕ ПО УМОЛЧАНИЮ — светлое (палитра MarginFlow: teal/ink)
     Нежно-зелёный акцент на белом фоне.
     ============================================================ */
  --bg: #f6f8f7;            /* ink-50 */
  --bg-2: #eef2f1;
  --surface: #ffffff;       /* paper */
  --surface-2: #f6f8f7;
  --surface-hi: #eef2f1;
  --line: #e3e8e7;
  --line-strong: #d8dedd;   /* ink-200 */

  --ink: #15201f;           /* ink-900 */
  --ink-soft: #2d3b39;
  --muted: #5a6968;         /* ink-500 */
  --faint: #8a9896;

  --accent: #0a7d79;        /* teal-700 */
  --accent-bright: #1a8f8b; /* teal-600 */
  --accent-deep: #066360;
  --cyan: #2f9c97;          /* mint-teal — вторичный «зелёный» акцент */
  --cyan-deep: #16807b;

  --up: #2f9e57;            /* leaf — читаемый зелёный на белом */
  --down: #d6455f;          /* rose */
  --down-text: #c2374f;
  --mid-base: #e8a93c;      /* amber — для подложек */
  --mid: #b9760a;           /* amber — для текста (читаемый на белом) */
  --veil: #15201f;          /* оверлеи hover на светлом = лёгкий ink-тон */

  --gold: linear-gradient(140deg, #ffe48a, #f5a623);
  --silver: linear-gradient(140deg, #e8ecf5, #9aa3b8);
  --bronze: linear-gradient(140deg, #ffb877, #d77b32);
  --grad: linear-gradient(135deg, #0a7d79, #43a8a4);
  --grad-cyan: linear-gradient(135deg, #1a8f8b, #0a7d79);

  --shadow: 0 6px 16px -8px rgba(15,36,35,.18), 0 2px 6px rgba(15,36,35,.05);
  --shadow-sm: 0 1px 2px rgba(15,36,35,.06), 0 1px 1px rgba(15,36,35,.04);

  --header-bg: rgba(255,255,255,.72);
  --glass-1: #ffffff;
  --glass-2: #f6f8f7;
  --input-bg: #ffffff;
  --input-bg-2: #ffffff;
  --sunken: #f1f5f4;
  --foot-bg: #f6f8f7;

  /* производные оттенки (одинаковая формула в обоих оформлениях) */
  --up-soft: color-mix(in srgb, var(--up) 14%, transparent);
  --down-soft: color-mix(in srgb, var(--down) 14%, transparent);
  --accent-glow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent),
                 0 8px 30px -6px color-mix(in srgb, var(--accent) 55%, transparent);
}

/* ============================================================
   ТЁМНОЕ ОФОРМЛЕНИЕ — прежний premium dark terminal Florstat.
   Значения 1-в-1 с исходными, вид не меняется.
   ============================================================ */
html.theme-dark {
  --bg: #0a0b10;
  --bg-2: #0e0f16;
  --surface: #14151e;
  --surface-2: #181a24;
  --surface-hi: #1d1f2b;
  --line: rgba(255,255,255,.07);
  --line-strong: rgba(255,255,255,.12);

  --ink: #f3f4f8;
  --ink-soft: #c2c4d0;
  --muted: #7b7e93;
  --faint: #565a70;

  --accent: #ff4d8d;
  --accent-bright: #ff6fa3;
  --accent-deep: #d61f63;
  --cyan: #46e0d4;
  --cyan-deep: #1aa9c9;

  --up: #3ddc84;
  --down: #ff5d6c;
  --down-text: #ff8e98;
  --mid-base: #ffb057;
  --mid: #ffb057;
  --veil: #ffffff;

  --grad: linear-gradient(135deg, #ff4d8d 0%, #ff8f6b 55%, #ffb86b 100%);
  --grad-cyan: linear-gradient(135deg, #46e0d4, #1aa9c9);

  --shadow: 0 2px 6px rgba(0,0,0,.35), 0 22px 50px -18px rgba(0,0,0,.65);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);

  --header-bg: rgba(12,13,19,.62);
  --glass-1: rgba(28,30,42,.85);
  --glass-2: rgba(18,19,27,.92);
  --input-bg: rgba(10,11,16,.6);
  --input-bg-2: rgba(10,11,16,.85);
  --sunken: rgba(10,11,16,.5);
  --foot-bg: rgba(10,11,16,.3);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'General Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  position: relative;
  overflow-x: clip;
}
html { overflow-x: clip; }
/* media-элементы не переполняют контейнер на узких экранах (страховка к responsive Chart.js) */
img, canvas, svg, video { max-width: 100%; }
a { color: var(--accent-bright); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent); }
::selection { background: color-mix(in srgb, var(--accent) 32%, transparent); color: var(--ink); }

/* ===== Atmospheric background ===== */
.bg-field { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(120% 80% at 100% -10%, color-mix(in srgb, var(--cyan) 5%, transparent), transparent 55%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 40%); }
.aura { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; }
.aura-1 { width: 620px; height: 620px; top: -260px; left: -120px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 42%, transparent), transparent 65%);
  animation: drift1 22s var(--ease) infinite alternate; }
.aura-2 { width: 520px; height: 520px; top: -160px; right: -160px;
  background: radial-gradient(circle, color-mix(in srgb, var(--cyan) 28%, transparent), transparent 65%);
  animation: drift2 26s var(--ease) infinite alternate; }
.grid-veil { position: absolute; inset: 0;
  background-image:
    linear-gradient(color-mix(in srgb, var(--veil) 2.2%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--veil) 2.2%, transparent) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 30%, transparent 80%); }
@keyframes drift1 { to { transform: translate(80px, 60px) scale(1.12); } }
@keyframes drift2 { to { transform: translate(-70px, 40px) scale(1.08); } }

/* ===== Header ===== */
header.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 1rem;
  padding: .85rem 1.6rem;
  background: var(--header-bg);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--line);
}
.logo { font-family: 'Clash Display', sans-serif; font-weight: 600; font-size: 1.18rem;
  letter-spacing: -.01em; margin-right: auto; display: inline-flex; align-items: center; gap: .6rem;
  color: var(--ink); }
.logo:hover { color: var(--ink); }
.logo .mark { width: 30px; height: 30px; border-radius: 9px; background: var(--grad);
  display: grid; place-items: center; color: #fff; font-size: 16px;
  box-shadow: 0 6px 18px -4px color-mix(in srgb, var(--accent) 70%, transparent); }
.logo .name-dim { color: var(--muted); font-weight: 500; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--up);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--up) 60%, transparent); animation: pulse 2.4s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 color-mix(in srgb, var(--up) 50%, transparent);} 70%{box-shadow:0 0 0 7px color-mix(in srgb, var(--up) 0%, transparent);} 100%{box-shadow:0 0 0 0 color-mix(in srgb, var(--up) 0%, transparent);} }
.userchip { display: inline-flex; align-items: center; gap: .55rem; color: var(--ink-soft); font-size: .88rem; }
.userchip .avatar { width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 25%, transparent), color-mix(in srgb, var(--cyan) 18%, transparent));
  border: 1px solid var(--line-strong);
  color: var(--accent-bright); display: grid; place-items: center; font-weight: 700; font-size: .82rem; }
.userchip-mail { color: var(--muted); }
.btn-link { color: var(--muted); font-size: .85rem; font-weight: 500; }
.btn-link:hover { color: var(--accent); }
.logout-form { display: inline; margin: 0; }
button.btn-link { background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }

main { max-width: 1360px; margin: 2.2rem auto 4rem; padding: 0 1.5rem;
  animation: rise .6s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ============================================================
   AUTH
   ============================================================ */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.auth-card { position: relative; width: 100%; max-width: 410px;
  background: linear-gradient(180deg, var(--glass-1), var(--glass-2));
  border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  padding: 2.4rem 2.1rem 2rem; box-shadow: var(--shadow);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  animation: pop .55s var(--ease) both; overflow: hidden; }
.auth-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 60%, transparent), transparent 40%, color-mix(in srgb, var(--cyan) 40%, transparent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: .7; pointer-events: none; }
@keyframes pop { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
.auth-card.auth-card-wide { max-width: 468px; }
.auth-card .brand { display: flex; flex-direction: column; align-items: center; gap: .6rem; margin-bottom: 1.6rem; }

/* регистрация: тип бизнеса (сегментированный выбор) — все чипы одной высоты */
.reg-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; align-items: stretch; }
.reg-type { position: relative; cursor: pointer; display: flex; }
.reg-type input { position: absolute; opacity: 0; pointer-events: none; }
.reg-type span { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 56px; font-size: .85rem; font-weight: 600; line-height: 1.2;
  padding: .5rem .4rem; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--sunken); color: var(--ink-soft); transition: border-color .15s, background .15s, color .15s; }
.reg-type:hover span { border-color: var(--line-strong); color: var(--ink); }
.reg-type input:checked + span { border-color: var(--accent); color: #fff;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--accent) 8%, transparent)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
.reg-type input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }

/* регистрация: подписка на Telegram-канал */
.reg-tg { display: flex; align-items: center; gap: .7rem; margin: 1.3rem 0 .6rem;
  padding: .8rem .9rem; border-radius: var(--radius-sm);
  background: linear-gradient(100deg, color-mix(in srgb, var(--cyan) 10%, transparent), color-mix(in srgb, var(--cyan-deep) 5%, transparent));
  border: 1px solid color-mix(in srgb, var(--cyan) 28%, transparent); color: var(--ink); transition: border-color .15s, transform .12s; }
.reg-tg:hover { border-color: var(--cyan); color: var(--ink); transform: translateY(-1px); }
.reg-tg-ic { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px;
  background: var(--grad-cyan); color: #04222a; font-size: 1rem; }
.reg-tg-txt { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.reg-tg-txt strong { font-size: .9rem; font-weight: 700; }
.reg-tg-txt span { font-size: .76rem; color: var(--muted); }
.reg-tg-go { font-size: .82rem; font-weight: 700; color: var(--cyan); flex: none; }
.reg-tg-check { display: flex; align-items: center; gap: .5rem; font-size: .84rem; color: var(--ink-soft);
  cursor: pointer; margin-bottom: 1rem; }
.reg-tg-check input { width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.reg-opt { color: var(--faint); }
.auth-card .brand .mark { width: 56px; height: 56px; border-radius: 17px; background: var(--grad);
  display: grid; place-items: center; color: #fff; font-size: 28px;
  box-shadow: 0 12px 34px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
.auth-card h1 { font-family: 'Clash Display', sans-serif; font-size: 1.65rem; font-weight: 600;
  margin: .3rem 0 0; letter-spacing: -.02em; }
.auth-card .tagline { color: var(--muted); font-size: .9rem; text-align: center; margin: 0; max-width: 24ch; }
.field { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; }
.field label { font-size: .76rem; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; }
input, select { font: inherit; padding: .72rem .9rem; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); background: var(--input-bg); color: var(--ink);
  transition: border-color .15s, box-shadow .15s, background .15s; width: 100%; }
input::placeholder { color: var(--faint); }
input:focus, select:focus { outline: none; border-color: var(--accent);
  background: var(--input-bg-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.btn { font-family: 'General Sans', sans-serif; font-weight: 700; font-size: .98rem;
  padding: .8rem 1rem; border: 0; border-radius: var(--radius-sm); margin-top: .4rem;
  background: var(--grad); color: #fff; cursor: pointer; width: 100%; letter-spacing: .01em;
  box-shadow: 0 10px 26px -8px color-mix(in srgb, var(--accent) 70%, transparent); transition: transform .1s var(--ease), box-shadow .2s, filter .2s; }
.btn:hover { box-shadow: 0 14px 34px -8px color-mix(in srgb, var(--accent) 85%, transparent); filter: brightness(1.05); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.auth-alt { text-align: center; color: var(--muted); font-size: .9rem; margin: 1.3rem 0 0; }
.alert { background: var(--down-soft); color: var(--down-text); border: 1px solid color-mix(in srgb, var(--down) 30%, transparent);
  padding: .6rem .85rem; border-radius: var(--radius-sm); font-size: .86rem; margin-bottom: 1rem; }
.notice-ok { background: var(--up-soft); color: var(--up); border: 1px solid color-mix(in srgb, var(--up) 30%, transparent);
  padding: .6rem .85rem; border-radius: var(--radius-sm); font-size: .86rem; margin-bottom: 1rem; }
.notice-text { color: var(--ink-soft); font-size: .95rem; line-height: 1.55; margin: 0 0 1.4rem; }
.btn-ghost { display: inline-block; width: 100%; font: inherit; font-weight: 600; font-size: .9rem;
  padding: .65rem 1rem; margin-bottom: 1rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface-hi); color: var(--ink-soft); cursor: pointer; text-align: center;
  transition: border-color .15s, color .15s; }
.btn-ghost:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent-bright); }
.btn-danger { font: inherit; font-weight: 700; font-size: .95rem; padding: .75rem 1.1rem; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--down) 40%, transparent); border-radius: var(--radius-sm);
  background: var(--down-soft); color: var(--down-text); transition: background .15s, border-color .15s; }
.btn-danger:hover { background: color-mix(in srgb, var(--down) 22%, transparent); border-color: var(--down); }
.resend-form { margin-bottom: 1rem; }
/* Telegram-подтверждение */
.tg-btn { background: linear-gradient(135deg, #2aabee, #229ed9); border: 0; }
.tg-btn:hover { filter: brightness(1.07); }
.tg-wait { margin: 1rem 0 1.1rem; text-align: center; }
.tg-wait .hint-line { padding: 0; }
.auth-or { display: flex; align-items: center; gap: .8rem; color: var(--faint); font-size: .8rem;
  text-transform: uppercase; letter-spacing: .08em; margin: .2rem 0 .9rem; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ===== Личный кабинет ===== */
.acc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
.acc-card { background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.5rem; box-shadow: var(--shadow-sm); }
.acc-card h3 { font-family: 'Clash Display', sans-serif; font-size: 1.1rem; font-weight: 600; margin: 0 0 1rem; }
/* шапка карточки профиля: заголовок + кнопка «Редактировать» в одну строку */
.acc-card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.acc-card-head h3 { margin: 0; }
.acc-form-actions { display: flex; gap: .6rem; margin-top: .2rem; }
.acc-form-actions .btn, .acc-form-actions .btn-ghost { width: auto; flex: 1; margin-top: 0; }
.acc-card.acc-danger { border-color: color-mix(in srgb, var(--down) 28%, transparent); }
.acc-row { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.acc-row:last-child { border-bottom: 0; }
.acc-key { color: var(--muted); font-size: .88rem; }
.acc-val { color: var(--ink); font-weight: 600; font-size: .9rem; word-break: break-all; text-align: right; }
.acc-ok { color: var(--up); font-weight: 700; }
.acc-warn { color: var(--mid); font-weight: 700; }
.acc-hint { color: var(--muted); font-size: .84rem; line-height: 1.5; margin: 0 0 1rem; }
.acc-form .field { margin-bottom: .85rem; }
.acc-form .btn { margin-top: .2rem; }
.myshop-list{display:flex;flex-direction:column;gap:.1rem;margin-bottom:.4rem}
.myshop-item{display:flex;align-items:center;justify-content:space-between;
  padding:.55rem 0;border-bottom:1px solid var(--line)}
.myshop-item:last-child{border-bottom:none}
.myshop-name{font-weight:600}
.myshop-unbind{margin:0}
.btn-sm{width:auto;padding:.3rem .7rem;font-size:.8rem;margin-bottom:0}
.myshop-open{display:block;width:100%;text-align:center;margin:.7rem 0 .2rem}

/* ============================================================
   PAGE HEAD + TOOLBAR
   ============================================================ */
.page-head { display: flex; align-items: flex-end; gap: 1.2rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.eyebrow { font-family: 'JetBrains Mono', monospace; font-size: .7rem; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase; color: var(--cyan); margin-bottom: .5rem;
  display: flex; align-items: center; gap: .5rem; }
.eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--cyan); opacity: .6; }
.page-head h1 { font-family: 'Clash Display', sans-serif; font-size: 2.1rem; font-weight: 600;
  margin: 0; letter-spacing: -.025em; line-height: 1.05; }
.page-head h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text;
  background-clip: text; color: transparent; }
.page-head .sub { color: var(--muted); font-size: .92rem; margin-top: .4rem; max-width: 60ch; }
.toolbar { display: flex; gap: 1.4rem; margin-left: auto; align-items: flex-end; }
.toolbar .ctl { display: flex; flex-direction: column; gap: .45rem; }
.toolbar label { font-size: .68rem; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em; }

/* segmented control (period) */
.segment { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); }
.segment button { font: inherit; font-weight: 600; font-size: .85rem; border: 0; cursor: pointer;
  padding: .42rem .85rem; border-radius: 9px; background: transparent; color: var(--muted);
  transition: color .15s, background .2s; font-variant-numeric: tabular-nums; }
.segment button:hover { color: var(--ink); }
.segment button.active { color: #fff; background: var(--grad);
  box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 70%, transparent); }

/* city combobox (searchable, with update-frequency badges) */
.citysel { position: relative; }
.citysel-btn { display: inline-flex; align-items: center; gap: .5rem; min-width: 175px;
  padding: .5rem .75rem .5rem .9rem; font: inherit; font-weight: 600; font-size: .88rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.citysel-btn:hover { background: var(--surface-hi); }
.citysel-current { flex: 1; text-align: left; white-space: nowrap; }
.citysel-caret { width: 15px; height: 15px; color: var(--muted); flex: none; transition: transform .2s var(--ease); }
.citysel.open .citysel-caret { transform: rotate(180deg); }
.citysel.open .citysel-btn { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }

.citysel-panel { position: absolute; left: 0; top: calc(100% + .5rem); z-index: 50; width: 290px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: .55rem; display: none; }
.citysel.open .citysel-panel { display: block; animation: pop .2s var(--ease) both; }

.citysel-search { display: flex; align-items: center; gap: .5rem; padding: 0 .65rem; margin-bottom: .5rem;
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s; }
.citysel-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent); }
.citysel-search svg { width: 15px; height: 15px; color: var(--muted); flex: none; }
.citysel-search input { flex: 1; border: 0; background: transparent; padding: .56rem 0; font-size: .86rem; color: var(--ink); }
.citysel-search input:focus { outline: none; box-shadow: none; }

.citysel-list { max-height: 322px; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 1px; scrollbar-width: thin; }
.citysel-list::-webkit-scrollbar { width: 8px; }
.citysel-list::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; }
.citysel-opt { display: flex; align-items: center; gap: .5rem; padding: .35rem .5rem .35rem .65rem;
  border-radius: 9px; color: var(--ink-soft); font-weight: 500; font-size: .88rem;
  transition: background .12s, color .12s; }
.citysel-opt:hover, .citysel-opt.kbd { background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--ink); }
.citysel-opt.on { background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent-bright); }
.citysel-name { flex: 1; min-width: 0; padding: .15rem 0; color: inherit; cursor: pointer;
  text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.citysel-name:hover { color: inherit; }
.citysel-empty { padding: .9rem; text-align: center; color: var(--muted); font-size: .85rem; }
.citysel-legend { margin-top: .5rem; padding-top: .5rem; border-top: 1px solid var(--line);
  color: var(--faint); font-size: .72rem; line-height: 1.7; }
.citysel-hint { color: var(--faint); font-size: .68rem; }

/* update-frequency badges */
.freq { flex: none; font-size: .64rem; font-weight: 700; padding: .16rem .44rem; border-radius: 6px;
  font-variant-numeric: tabular-nums; border: 1px solid transparent; white-space: nowrap; }
.freq-hot { color: var(--cyan); background: color-mix(in srgb, var(--cyan) 12%, transparent); border-color: color-mix(in srgb, var(--cyan) 30%, transparent); }
.freq-day { color: var(--muted); background: var(--surface-hi); border-color: var(--line); }
/* кликабельный бейдж-переключатель частоты */
button.freq { font-family: inherit; line-height: 1.2; }
.freq-toggle { cursor: pointer; transition: filter .12s, transform .08s; }
.freq-toggle:hover { filter: brightness(1.3); }
.freq-toggle:active { transform: scale(.94); }

/* ===== Add city ===== */
.add-city { position: relative; }
.add-city-btn { list-style: none; cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; font-size: .88rem;
  padding: .5rem .9rem; border: 1px solid color-mix(in srgb, var(--cyan) 35%, transparent); border-radius: var(--radius-sm);
  background: linear-gradient(135deg, color-mix(in srgb, var(--cyan) 12%, transparent), color-mix(in srgb, var(--cyan-deep) 6%, transparent)); color: var(--cyan);
  transition: border-color .15s, background .15s, transform .08s; }
.add-city-btn::-webkit-details-marker { display: none; }
.add-city-btn:hover { border-color: var(--cyan); background: color-mix(in srgb, var(--cyan) 16%, transparent); }
.add-city[open] .add-city-btn { transform: translateY(1px); }
.add-city-btn .plus { font-size: 1rem; line-height: 1; }
.add-city-panel { position: absolute; right: 0; top: calc(100% + .55rem); z-index: 40; width: 360px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: .9rem; animation: pop .25s var(--ease) both; }
.acp-row { display: flex; gap: .5rem; align-items: center; }
.acp-row input[type=search], .acp-row input[type=text], .acp-row input[type=url] { flex: 1; min-width: 0; }
.acp-row select { width: auto; flex: none; padding: .5rem .6rem; font-size: .82rem; }
.acp-hint { color: var(--muted); font-size: .8rem; line-height: 1.5; margin-bottom: .6rem; }
.acp-add-btn { flex: none; font: inherit; font-weight: 600; font-size: .82rem; cursor: pointer;
  padding: .5rem .85rem; border-radius: 10px; border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--cyan) 16%, transparent); color: var(--cyan); transition: border-color .12s, background .12s; }
.acp-add-btn:hover { border-color: var(--cyan); background: color-mix(in srgb, var(--cyan) 24%, transparent); }
.add-shop-error { margin-top: .6rem; padding: .55rem .65rem; border-radius: 9px; font-size: .82rem; line-height: 1.45;
  background: var(--down-soft); color: var(--down); border: 1px solid color-mix(in srgb, var(--down) 35%, transparent); }
.htmx-indicator { opacity: 0; color: var(--muted); transition: opacity .15s; }
.htmx-request .htmx-indicator, .htmx-indicator.htmx-request { opacity: 1; }
.hint-line { color: var(--muted); font-size: .85rem; padding: .7rem .2rem; line-height: 1.5; }
.mini-btn { font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer;
  padding: .3rem .65rem; border-radius: 8px; border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent-bright); margin-left: .4rem; }
.mini-btn:hover { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.city-suggest { list-style: none; margin: .6rem 0 0; padding: 0; max-height: 320px; overflow-y: auto; }
.city-suggest li { margin: 0; }
.city-opt { width: 100%; text-align: left; cursor: pointer; font: inherit;
  display: flex; align-items: center; gap: .6rem; padding: .55rem .6rem; border: 0;
  background: transparent; color: var(--ink); border-radius: 10px; transition: background .12s; }
.city-opt:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.city-opt-name { font-weight: 600; }
.city-opt-meta { font-family: 'JetBrains Mono', monospace; font-size: .68rem; color: var(--faint);
  text-transform: uppercase; letter-spacing: .04em; }
.city-opt-add { margin-left: auto; color: var(--accent-bright); font-weight: 600; font-size: .8rem; opacity: 0; transition: opacity .12s; }
.city-opt:hover .city-opt-add { opacity: 1; }
.acp-current { margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--line); }
/* список отслеживаемых городов — внутренний скролл, чтобы не крутить всю страницу */
.acp-cities { max-height: min(340px, 40vh); overflow-y: auto; overscroll-behavior: contain; margin-top: .25rem;
  padding-right: .15rem; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.acp-cities::-webkit-scrollbar { width: 8px; }
.acp-cities::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; }
.acp-cities::-webkit-scrollbar-track { background: transparent; }
.acp-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); font-weight: 600; margin-bottom: .45rem; }
.acp-city { display: flex; align-items: center; gap: .5rem; padding: .35rem .5rem; border-radius: 9px; }
.acp-city:hover { background: color-mix(in srgb, var(--veil) 3%, transparent); }
.acp-city-name { flex: 1; font-size: .9rem; }
.acp-del { width: 24px; height: 24px; border-radius: 7px; border: 1px solid var(--line-strong);
  background: transparent; color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1;
  display: grid; place-items: center; transition: background .12s, color .12s, border-color .12s; }
.acp-del:hover { background: var(--down-soft); color: var(--down); border-color: color-mix(in srgb, var(--down) 40%, transparent); }

/* ===== Collect job status ===== */
#collect-status:empty { display: none; }
.collect-job { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: .85rem 1.1rem; margin-bottom: 1.4rem; font-size: .92rem;
  box-shadow: var(--shadow-sm); animation: rise .4s var(--ease) both; }
.collect-job.done { border-color: color-mix(in srgb, var(--up) 40%, transparent); }
.collect-job.err, .collect-job.error { border-color: color-mix(in srgb, var(--down) 40%, transparent); }
.cj-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.cj-dot.run { background: var(--cyan); animation: pulse 1.6s infinite; }
.cj-dot.ok { background: var(--up); }
.cj-dot.err { background: var(--down); }
.cj-count { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .85rem; }
.cj-bar { flex: 1; min-width: 120px; height: 8px; border-radius: 999px; background: var(--surface-hi);
  overflow: hidden; }
.cj-bar i { display: block; height: 100%; background: var(--grad-cyan); border-radius: 999px;
  transition: width .4s var(--ease); }

/* ============================================================
   KPI CARDS
   ============================================================ */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; margin-bottom: 1.6rem; }
.kpi { position: relative; background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem 1.25rem;
  box-shadow: var(--shadow-sm); overflow: hidden; transition: transform .25s var(--ease), border-color .25s; }
.kpi::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent); }
.kpi:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.kpi .k-label { color: var(--muted); font-size: .74rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .07em; display: flex; align-items: center; gap: .45rem; }
.kpi .k-icon { width: 17px; height: 17px; color: var(--accent); opacity: .85; flex: none; }
.kpi.accent .k-icon { color: var(--accent-bright); opacity: 1; }
.kpi .k-value { font-family: 'Clash Display', sans-serif; font-size: 2.05rem; font-weight: 600;
  letter-spacing: -.03em; margin-top: .55rem; line-height: 1; }
.kpi .k-sub { color: var(--faint); font-size: .8rem; margin-top: .55rem; }
.kpi.accent { border-color: color-mix(in srgb, var(--accent) 28%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, transparent), var(--surface) 70%); }
.kpi.accent::after { content: ""; position: absolute; right: -40px; bottom: -40px; width: 150px; height: 150px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%); filter: blur(8px); }
.kpi.accent .k-value { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kpi .num { font-variant-numeric: tabular-nums; }
.delta { display: inline-flex; align-items: center; gap: .2rem; font-weight: 700;
  font-size: .78rem; padding: .12rem .4rem; border-radius: 6px; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--up); background: var(--up-soft); }
.delta.down { color: var(--down); background: var(--down-soft); }
.k-leader { display: flex; align-items: center; gap: .55rem; margin-top: .55rem; }
.k-leader .crown { width: 28px; height: 28px; border-radius: 8px; background: var(--gold);
  display: grid; place-items: center; color: #5c4500; flex: none;
  box-shadow: 0 4px 14px -4px rgba(245,166,35,.6); }
.k-leader .crown svg { width: 16px; height: 16px; }
.k-leader .l-name { font-family: 'Clash Display', sans-serif; font-size: 1.05rem; font-weight: 600;
  letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============================================================
   TABLE
   ============================================================ */
.table-card { background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.table-scroll { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.table-scroll::-webkit-scrollbar { height: 8px; }
.table-scroll::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; min-width: 840px; }
thead th { background: color-mix(in srgb, var(--veil) 1.5%, transparent);
  text-align: left; font-size: .68rem; color: var(--muted); font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; padding: .85rem .95rem;
  border-bottom: 1px solid var(--line-strong); }
tbody td { padding: .72rem .95rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.num { font-variant-numeric: tabular-nums; }
.lastday { color: var(--up); font-weight: 700; font-variant-numeric: tabular-nums; }
td .muted { color: var(--faint); }
/* таблица конкурентов плотнее по горизонтали (добавилась колонка «Выручка») — чтобы все
   колонки, включая кнопку скрытия ✕, помещались без горизонтальной прокрутки */
#shoptable th, #shoptable td { padding-left: .64rem; padding-right: .64rem; }
#shoptable th:first-child, #shoptable td:first-child { padding-left: .85rem; }

/* сортируемые заголовки */
thead th.sortable { cursor: pointer; user-select: none; white-space: nowrap;
  transition: color .15s, background .15s; }
thead th.sortable:hover { color: var(--ink-soft); background: color-mix(in srgb, var(--veil) 3%, transparent); }
thead th.sortable .sort-ind { display: inline-block; width: 0; overflow: hidden;
  margin-left: .3rem; opacity: 0; transition: opacity .15s; font-size: .8em; }
thead th.sortable.sorted { color: var(--cyan); }
thead th.sortable.sorted .sort-ind { width: auto; opacity: 1; }
thead th.sortable.sorted[data-dir="asc"] .sort-ind::after { content: "▲"; }
thead th.sortable.sorted[data-dir="desc"] .sort-ind::after { content: "▼"; }

/* ===== Панель фильтров ===== */
.filterbar { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap;
  margin-bottom: 1rem; }
.fb-search { display: flex; align-items: center; gap: .5rem; flex: 1; min-width: 220px; max-width: 360px;
  padding: .1rem .85rem; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); transition: border-color .15s, box-shadow .15s; }
.fb-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
.fb-search svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.fb-search input { border: 0; background: transparent; padding: .55rem 0; flex: 1; }
.fb-search input:focus { outline: none; box-shadow: none; }
.fb-ctl { display: inline-flex; align-items: center; gap: .5rem; font-size: .8rem;
  color: var(--muted); font-weight: 600; }
.fb-ctl select { padding: .5rem .7rem; }
.fb-sort { display: none; }   /* сортировка только на телефоне (на десктопе сортируют заголовки) */

/* ── Кастомный дропдаун сортировки (мобильный, в стиле сайта) ── */
.sortmenu { position: relative; }
.fb-sort-cap { font-size: .8rem; color: var(--muted); font-weight: 600; flex: none; }
.sortmenu-btn { display: inline-flex; align-items: center; gap: .5rem; width: 100%;
  padding: .62rem .85rem; font: inherit; font-weight: 600; font-size: 15px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s; }
.sortmenu-btn:hover { background: var(--surface-hi); }
.sortmenu-current { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sortmenu-caret { width: 16px; height: 16px; color: var(--muted); flex: none; transition: transform .2s var(--ease); }
.sortmenu.open .sortmenu-caret { transform: rotate(180deg); }
.sortmenu.open .sortmenu-btn { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }

.sortmenu-panel { position: absolute; left: 0; right: 0; top: calc(100% + .5rem); z-index: 40;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: .4rem; display: none; max-height: min(62vh, 440px); overflow-y: auto;
  overscroll-behavior: contain; scrollbar-width: thin; }
.sortmenu.open .sortmenu-panel { display: block; animation: pop .18s var(--ease) both; }
.sortmenu-opt { display: flex; align-items: center; gap: .55rem; width: 100%; text-align: left;
  font: inherit; font-size: 15px; font-weight: 600; color: var(--ink-soft); line-height: 1.25;
  padding: .72rem .7rem; border: 0; background: transparent; border-radius: 11px; cursor: pointer;
  transition: background .12s, color .12s; }
.sortmenu-opt:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--ink); }
.sortmenu-opt.on { background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent-bright); }
.sortmenu-check { width: 16px; height: 16px; flex: none; opacity: 0; color: var(--accent-bright); }
.sortmenu-opt.on .sortmenu-check { opacity: 1; }
.sortmenu-opt-label { flex: 1; }
.sortmenu-hint { color: var(--faint); font-weight: 500; font-size: .8em; flex: none; }
/* дропдаун округов: паттерн sortmenu, но заметнее (юзер: «сделать больше, а то не видно»).
   Пункты — <a>-ссылки навигации; счётчик магазинов справа акцентом. */
.okrugmenu { min-width: 168px; }
.okrugmenu .sortmenu-btn { font-size: .92rem; padding: .55rem .8rem; }
.okrugmenu .sortmenu-panel { min-width: 236px; max-height: min(64vh, 480px); overflow-y: auto; }
.okrugmenu .sortmenu-opt { font-size: .95rem; padding: .6rem .85rem; text-decoration: none; color: var(--ink-soft); }
.okrugmenu .sortmenu-opt:hover { color: var(--ink); }
.okrugmenu .sortmenu-opt.on { color: var(--accent-bright); }
.okrugmenu .okrug-cnt { color: var(--accent); font-weight: 800; font-size: .85em; font-variant-numeric: tabular-nums; }
.fb-check { display: inline-flex; align-items: center; gap: .45rem; font-size: .85rem;
  color: var(--ink-soft); font-weight: 600; cursor: pointer; }
.fb-check input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.fb-star { color: #ffc94d; font-size: .95rem; line-height: 1; }
.fb-count { margin-left: auto; color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
.filter-empty { padding: 1.4rem 1rem; text-align: center; color: var(--muted); font-size: .9rem; }
.filter-empty b { color: #ffc94d; }

.rankbadge { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: .82rem;
  background: var(--surface-hi); color: var(--ink-soft); border: 1px solid var(--line); }
.rankbadge.r1 { background: var(--gold); color: #5c4500; border: 0; box-shadow: 0 0 16px -2px rgba(245,166,35,.6); }
.rankbadge.r2 { background: var(--silver); color: #2a2f3a; border: 0; box-shadow: 0 0 14px -3px rgba(154,163,184,.5); }
.rankbadge.r3 { background: var(--bronze); color: #3d1f00; border: 0; box-shadow: 0 0 14px -3px rgba(215,123,50,.5); }
.rankcell { white-space: nowrap; }
.rankwrap { display: inline-flex; align-items: center; gap: 7px; }
/* слева — фикс-слот для стрелки движения ранга, чтобы бейджи ранга выравнивались в колонку */
.rankdelta-slot { display: inline-flex; justify-content: flex-end; min-width: 30px; }
/* быстрые чипы «Мои магазины» над таблицей */
.myshops-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.myshops-cap { font-size: .72rem; color: var(--ink-soft); text-transform: uppercase;
  letter-spacing: .05em; margin-right: 2px; }
.myshop-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px;
  border-radius: 999px; cursor: pointer; font: inherit; font-weight: 600; font-size: .82rem;
  color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, transparent); transition: background .15s, transform .1s; }
.myshop-chip:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.myshop-chip:active { transform: translateY(1px); }
.myshop-chip-rank { font-family: 'JetBrains Mono', monospace; font-size: .72rem; opacity: .85; }
@keyframes rowflash { 0% { background: color-mix(in srgb, var(--accent) 30%, transparent); }
  100% { background: transparent; } }
.srow.flash > td { animation: rowflash 1.7s ease-out; }
.rankdelta { display: inline-flex; align-items: center; gap: 1px; line-height: 1;
  font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: .66rem;
  letter-spacing: -.02em; padding: 3px 6px; border-radius: 7px; }
.rankdelta.up { color: var(--up); background: var(--up-soft); }
.rankdelta.down { color: var(--down-text); background: var(--down-soft); }

.shopname { font-weight: 600; color: var(--ink); }
.shopname:hover { color: var(--accent-bright); }
.badge { font-family: 'JetBrains Mono', monospace; font-size: .62rem; font-weight: 700;
  background: linear-gradient(135deg, color-mix(in srgb, var(--cyan) 18%, transparent), color-mix(in srgb, var(--cyan-deep) 12%, transparent));
  color: var(--cyan); border: 1px solid color-mix(in srgb, var(--cyan) 30%, transparent);
  padding: .14rem .42rem; border-radius: 6px; vertical-align: middle; margin-left: .45rem;
  text-transform: uppercase; letter-spacing: .04em; }
.srow.mine{background:color-mix(in srgb, var(--accent) 7%, transparent);
  box-shadow:inset 3px 0 0 var(--accent)}
.mine-badge{display:inline-block;margin-left:.4rem;padding:.05rem .4rem;border-radius:6px;
  font-size:.7rem;font-weight:600;color:var(--accent);
  background:color-mix(in srgb, var(--accent) 14%, transparent)}

.sales { display: inline-flex; align-items: center; gap: .5rem; }
.sales-num { display: inline-flex; align-items: center; gap: .28rem; font-weight: 700;
  font-variant-numeric: tabular-nums; min-width: 64px; }
.sales-num .arrow { color: var(--up); font-size: .7rem; }
.spark { color: var(--accent); display: block; filter: drop-shadow(0 0 3px color-mix(in srgb, var(--accent) 50%, transparent)); }
.spark-empty { color: var(--faint); font-size: 1.1rem; }

/* Оценка выручки (≈): средний чек × продажи за период — прокси, НЕ точная величина */
.revcell { white-space: nowrap; }
.revenue { display: inline-block; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); }
.rev-sub { display: block; font-size: .68rem; font-weight: 500; color: var(--muted);
  font-variant-numeric: tabular-nums; margin-top: .1rem; }
.rev-sub.city { color: var(--faint); font-style: italic; }
.t-period { font-weight: 600; color: var(--faint); font-size: .68rem; }
.t-foot { margin-top: .35rem; font-size: .72rem; font-weight: 500; color: var(--muted);
  font-variant-numeric: tabular-nums; }
/* информер у заголовка «Выручка ≈» + плавающий тултип-дисклеймер (нативный title
   клипается в .table-scroll: overflow-y:hidden), потому рисуем свой через JS в body */
.th-info { font-size: .72rem; font-weight: 700; opacity: .5; margin-left: .15rem; }
thead th.sortable:hover .th-info { opacity: .85; }
.floattip { position: fixed; z-index: 200; max-width: 250px; padding: .55rem .7rem;
  background: var(--surface-hi); color: var(--ink-soft); border: 1px solid var(--line-strong);
  border-radius: 10px; box-shadow: 0 12px 32px -10px rgba(0, 0, 0, .4); font-size: .78rem;
  line-height: 1.45; font-weight: 500; pointer-events: none; opacity: 0;
  transform: translateY(3px); transition: opacity .12s ease, transform .12s ease; }
.floattip.show { opacity: 1; transform: translateY(0); }

.pill { display: inline-flex; align-items: center; gap: .25rem; padding: .18rem .55rem;
  border-radius: 999px; font-weight: 700; font-size: .82rem; font-variant-numeric: tabular-nums;
  border: 1px solid transparent; }
.pill::before { content: "★"; font-size: .7rem; opacity: .8; }
.pill.hi { background: var(--up-soft); color: var(--up); border-color: color-mix(in srgb, var(--up) 25%, transparent); }
.pill.mid { background: color-mix(in srgb, var(--mid-base) 14%, transparent); color: var(--mid); border-color: color-mix(in srgb, var(--mid-base) 25%, transparent); }
.pill.lo { background: var(--down-soft); color: var(--down); border-color: color-mix(in srgb, var(--down) 25%, transparent); }
.pill:not(.hi):not(.mid):not(.lo) { background: var(--surface-hi); color: var(--muted); }
.pill:not(.hi):not(.mid):not(.lo)::before { content: ""; }

.star { cursor: pointer; font-size: 1.2rem; color: var(--faint); user-select: none; text-align: center;
  transition: color .15s, transform .15s var(--ease); display: inline-block; }
.star:hover { transform: scale(1.25); color: var(--mid); }
.star.on { color: #ffc94d; text-shadow: 0 0 12px rgba(255,201,77,.7); animation: star-pop .35s var(--ease); }
@keyframes star-pop { 0%{transform:scale(.6);} 60%{transform:scale(1.3);} 100%{transform:scale(1);} }

.tablefoot { display: flex; justify-content: space-between; align-items: center;
  padding: .95rem 1.1rem; color: var(--muted); font-size: .85rem;
  border-top: 1px solid var(--line); background: var(--foot-bg); }
.export { display: inline-flex; align-items: center; gap: .45rem; font-weight: 600;
  color: var(--ink-soft); padding: .4rem .8rem; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); transition: border-color .15s, color .15s, background .15s; }
.export:hover { color: var(--accent-bright); border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.empty { padding: 3rem; text-align: center; color: var(--muted); }
.empty code { font-family: 'JetBrains Mono', monospace; background: var(--surface-hi);
  padding: .15rem .45rem; border-radius: 6px; color: var(--cyan); font-size: .85em; }
.tablefoot .tf-left { display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* скрыть магазин (персонально) */
td.rowact { text-align: center; padding-left: 0; padding-right: .5rem; }
.rowhide { width: 24px; height: 24px; border-radius: 7px; border: 1px solid transparent; background: transparent;
  color: var(--faint); cursor: pointer; font-size: .82rem; line-height: 1; display: inline-grid; place-items: center;
  opacity: 0; transition: opacity .12s, color .12s, background .12s, border-color .12s; }
tbody tr:hover .rowhide, .rowhide:focus-visible { opacity: 1; }
.rowhide:hover { color: var(--down); background: var(--down-soft); border-color: color-mix(in srgb, var(--down) 40%, transparent); }

/* менеджер скрытых (возврат) */
.hidden-mgr { position: relative; display: inline-block; }
.hidden-mgr > summary { list-style: none; cursor: pointer; color: var(--muted); font-weight: 600;
  padding: .25rem .6rem; border: 1px solid var(--line-strong); border-radius: 999px; transition: color .15s, border-color .15s; }
.hidden-mgr > summary::-webkit-details-marker { display: none; }
.hidden-mgr > summary:hover { color: var(--accent-bright); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.hidden-panel { position: absolute; bottom: calc(100% + .55rem); left: 0; z-index: 45; width: 280px;
  max-height: 320px; overflow-y: auto; overscroll-behavior: contain; padding: .55rem;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow);
  animation: pop .18s var(--ease) both; }
.hidden-head { font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
  font-weight: 600; padding: .15rem .35rem .45rem; }
.hidden-empty { padding: .7rem .35rem; color: var(--muted); font-size: .85rem; text-align: center; }
.hidden-item { display: flex; align-items: center; gap: .5rem; padding: .35rem .45rem; border-radius: 9px; }
.hidden-item:hover { background: color-mix(in srgb, var(--veil) 3%, transparent); }
.hidden-name { flex: 1; font-size: .86rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hidden-restore { flex: none; font: inherit; font-size: .76rem; font-weight: 600; cursor: pointer;
  color: var(--cyan); background: color-mix(in srgb, var(--cyan) 10%, transparent); border: 1px solid color-mix(in srgb, var(--cyan) 30%, transparent);
  padding: .2rem .55rem; border-radius: 7px; transition: background .12s, border-color .12s; }
.hidden-restore:hover { background: color-mix(in srgb, var(--cyan) 20%, transparent); border-color: var(--cyan); }

/* ============================================================
   SHOP CARD
   ============================================================ */
.back { color: var(--muted); font-size: .9rem; font-weight: 500; display: inline-flex; gap: .35rem; }
.back:hover { color: var(--accent-bright); }
.shop-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin: 1rem 0 .25rem; }
.shop-head h1 { font-family: 'Clash Display', sans-serif; font-size: 2.2rem; font-weight: 600;
  margin: 0; letter-spacing: -.025em; }
.shop-meta { color: var(--muted); font-size: .9rem; margin: 0 0 1.6rem; }
.shop-meta .alias { font-family: 'JetBrains Mono', monospace; font-size: .85em; color: var(--cyan); }
a.shop-meta .alias, .shop-meta a.alias { text-decoration: none; }
.shop-meta a.alias:hover { color: var(--accent-bright); text-decoration: underline; }
/* кнопка «Открыть на Flowwow» в шапке карточки конкурента */
.btn-flowwow { display: inline-flex; align-items: center; gap: .4rem; margin-left: auto;
  font-family: 'General Sans', sans-serif; font-weight: 600; font-size: .9rem;
  padding: .5rem .9rem; border-radius: var(--radius); cursor: pointer; white-space: nowrap;
  color: var(--accent-bright); text-decoration: none;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  transition: all .18s var(--ease); }
.btn-flowwow svg { opacity: .85; }
.btn-flowwow:hover { background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent); transform: translateY(-1px);
  box-shadow: 0 10px 24px -12px var(--accent-glow); }
.btn-flowwow:active { transform: translateY(0); }
@media (max-width: 560px) { .btn-flowwow { margin-left: 0; } }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; margin-bottom: 1.5rem; }
.tile { position: relative; background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-sm); transition: transform .25s var(--ease), border-color .25s; }
.tile:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.tile .t-label { color: var(--muted); font-size: .72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .07em; }
.tile .t-value { font-family: 'Clash Display', sans-serif; font-size: 1.9rem; font-weight: 600;
  margin-top: .4rem; letter-spacing: -.03em; line-height: 1; }
.chart-card { background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.4rem 1.5rem; margin-bottom: 1.3rem; }
.chart-card h3 { font-family: 'Clash Display', sans-serif; margin: 0 0 .25rem; font-size: 1.15rem; font-weight: 600; }
.chart-card .c-sub { color: var(--muted); font-size: .84rem; margin: 0 0 1.1rem; }
.chart-box { position: relative; height: 300px; width: 100%; }
.note { color: var(--muted); font-size: .86rem; background: color-mix(in srgb, var(--cyan) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--cyan) 20%, transparent); padding: .7rem .95rem; border-radius: var(--radius-sm); }

/* ===== Reviews ===== */
.reviews-head { margin-bottom: 1rem; display: flex; justify-content: space-between;
  align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.reviews-controls { display: flex; gap: .5rem; flex-wrap: wrap; }
.rev-ctl select { font-size: .82rem; padding: .45rem 2rem .45rem .8rem; min-width: 0; }
.rev-norate { font-size: .75rem; color: var(--faint); font-style: italic; }
.reviews-head h3 { font-family: 'Clash Display', sans-serif; font-size: 1.15rem; font-weight: 600; margin: 0; }
.reviews-head .rev-total { color: var(--muted); font-weight: 500; }
.reviews-head .c-sub { color: var(--faint); font-size: .8rem; }
.review { display: flex; gap: .85rem; padding: 1rem 0; border-top: 1px solid var(--line); }
.review:first-of-type { border-top: 0; }
.rev-ava { width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 25%, transparent), color-mix(in srgb, var(--cyan) 18%, transparent));
  border: 1px solid var(--line-strong); color: var(--accent-bright);
  display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.rev-body { flex: 1; min-width: 0; }
.rev-top { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.rev-author { font-weight: 600; }
.rev-stars { font-size: .8rem; font-weight: 700; color: #ffc94d; font-variant-numeric: tabular-nums; }
.rev-date { color: var(--faint); font-size: .8rem; margin-left: auto; }
.rev-text { color: var(--ink-soft); font-size: .92rem; margin-top: .35rem; line-height: 1.5; }
.rev-photos { display: flex; gap: .5rem; margin-top: .6rem; flex-wrap: wrap; }
.rev-photos img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px;
  border: 1px solid var(--line); cursor: zoom-in; transition: transform .12s, border-color .12s; }
.rev-photos img:hover { transform: scale(1.05); border-color: var(--accent); }

/* ===== Lightbox ===== */
#lightbox { position: fixed; inset: 0; z-index: 100; display: none; place-items: center;
  background: rgba(6,7,11,.88); backdrop-filter: blur(6px); cursor: zoom-out; padding: 4vmin; }
#lightbox.on { display: grid; animation: pop .2s var(--ease) both; }
#lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 14px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.8); border: 1px solid var(--line-strong); }
.rev-answer { margin-top: .55rem; padding: .55rem .8rem; border-radius: 10px;
  background: color-mix(in srgb, var(--cyan) 6%, transparent); border: 1px solid color-mix(in srgb, var(--cyan) 18%, transparent);
  color: var(--ink-soft); font-size: .86rem; }
.rev-answer b { color: var(--cyan); font-weight: 600; }
.load-more { display: block; width: 100%; margin-top: 1rem; font: inherit; font-weight: 600;
  padding: .65rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface-hi); color: var(--ink-soft); cursor: pointer; transition: border-color .15s, color .15s; }
.load-more:hover { border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--accent-bright); }

/* staggered reveal helper */
.stagger > * { animation: rise .55s var(--ease) both; }
.stagger > *:nth-child(1){animation-delay:.04s} .stagger > *:nth-child(2){animation-delay:.1s}
.stagger > *:nth-child(3){animation-delay:.16s} .stagger > *:nth-child(4){animation-delay:.22s}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .kpis, .tiles { grid-template-columns: repeat(2, 1fr); }
  .page-head { flex-direction: column; align-items: stretch; }
  .toolbar { margin-left: 0; flex-wrap: wrap; }
  .userchip-mail { display: none; }
}
@media (max-width: 560px) {
  .kpis, .tiles { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 1.7rem; }
  main { margin-top: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}

/* ─── Букеты-лидеры города ──────────────────────────────────────────── */
.leaders { margin: 8px 0 26px; }
.lead-loading { color: var(--muted); padding: 18px 4px; font-size: 14px; }
.lead-head { display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin: 4px 2px 14px; }
.lead-title { display: flex; align-items: center; gap: 10px; }
.lead-ic { width: 22px; height: 22px; color: var(--accent-bright); }
.lead-title h2 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; margin: 0; }
.lead-title em { color: var(--accent-bright); font-style: normal; }
.lead-sort { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; }
.lead-sortbtn { border: 0; background: transparent; color: var(--ink-soft);
  font: inherit; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 9px;
  cursor: pointer; transition: background .15s, color .15s; }
.lead-sortbtn:hover { color: var(--ink); }
.lead-sortbtn.on { background: var(--grad); color: #fff; box-shadow: var(--shadow-sm); }

.shop-switch { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.shop-pill { font: inherit; font-size: 13px; font-weight: 600; padding: 7px 14px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-soft); text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s; }
.shop-pill:hover { color: var(--ink); border-color: var(--accent); }
.shop-pill.on { color: var(--accent); border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent); }

.lead-grid { display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); }
.lead-card { display: block; color: inherit; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); overflow: hidden; transition: transform .18s var(--ease), box-shadow .18s, border-color .18s; }
.lead-card:hover { transform: translateY(-3px); box-shadow: var(--shadow);
  border-color: var(--accent); color: inherit; }
.lead-open { display: block; text-align: center; font-size: 12px; font-weight: 700;
  color: var(--accent-bright); padding: 0 12px; max-height: 0; overflow: hidden;
  transition: max-height .2s var(--ease), padding .2s var(--ease); }
.lead-card:hover .lead-open { max-height: 40px; padding: 0 12px 11px; }
.lead-thumb { position: relative; aspect-ratio: 4 / 3; background-size: cover;
  background-position: center; background-color: var(--surface-2); }
.prodthumb { display: inline-block; width: 34px; height: 34px; border-radius: 8px;
  background: var(--surface-2); background-size: cover; background-position: center;
  vertical-align: middle; margin-right: .55rem; flex: 0 0 auto; }
.prodlink { display: inline-flex; align-items: center; color: inherit; text-decoration: none; }
.prodlink:hover { color: var(--accent); }
.lead-rank { position: absolute; left: 8px; top: 8px; padding: 3px 9px;
  background: rgba(8,9,14,.78); backdrop-filter: blur(4px); color: #fff;
  font-size: 12px; font-weight: 800; border-radius: 8px; letter-spacing: .01em; }
.lead-disc { position: absolute; right: 8px; top: 8px; padding: 3px 8px;
  background: var(--accent-deep); color: #fff; font-size: 11px; font-weight: 800; border-radius: 8px; }
.lead-body { padding: 11px 12px 13px; }
.lead-name { font-size: 13.5px; font-weight: 650; line-height: 1.3; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 35px; }
.lead-shop { font-size: 12px; color: var(--muted); margin-top: 3px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.lead-meta { display: flex; align-items: baseline; gap: 9px; margin-top: 8px; }
.lead-price { font-size: 15px; font-weight: 800; color: var(--ink); }
.lead-rate { font-size: 12px; font-weight: 700; color: #f5c451; }
.lead-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; min-height: 22px; }
.lchip { font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 7px; line-height: 1; }
.lchip.up { background: var(--up-soft); color: var(--up); }
.lchip.down { background: var(--down-soft); color: var(--down); }
.lchip.fav { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-bright); }
.lchip.muted { background: var(--surface-hi); color: var(--muted); }
.lchip.ready { background: color-mix(in srgb, var(--cyan) 16%, transparent); color: var(--cyan); }
.lchip.redeem { background: color-mix(in srgb, var(--up) 16%, transparent); color: var(--up); }
.lead-empty { color: var(--muted); font-size: 14px; line-height: 1.5; padding: 22px 4px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); text-align: center; }

/* ─── Галерея фото покупателей (из отзывов) ──────────────────────────── */
.rev-gallery-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.rev-gallery-head h3 { margin: 0; }
.rev-gallery-sub { color: var(--muted); font-size: 12.5px; }
.rev-gallery { display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
.rev-shot { position: relative; aspect-ratio: 1 / 1; border-radius: var(--radius-sm);
  background-size: cover; background-position: center; overflow: hidden;
  border: 1px solid var(--line); display: block; transition: transform .18s var(--ease), box-shadow .18s; }
.rev-shot:hover { transform: translateY(-2px); box-shadow: 0 10px 26px -10px rgba(0,0,0,.4); }
.rev-shot-rate { position: absolute; top: 6px; left: 6px; font-size: 11px; font-weight: 700;
  color: #fff; background: rgba(0,0,0,.55); padding: 2px 6px; border-radius: 7px; }
.rev-shot-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 6px;
  font-size: 11px; line-height: 1.25; color: #fff; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; background: linear-gradient(transparent, rgba(0,0,0,.72)); }
.rev-shot-when { position: absolute; right: 6px; top: 6px; font-size: .7rem; padding: 1px 6px;
  border-radius: 6px; background: rgba(0,0,0,.55); color: #fff; }
.rev-group + .rev-group { margin-top: 14px; }
.rev-group-title { font-size: .82rem; font-weight: 600; color: var(--muted); margin: 0 0 8px;
  text-transform: none; }
@media (prefers-reduced-motion: reduce) { .rev-shot:hover { transform: none; } }

/* ─── Навигация-табы в шапке ─────────────────────────────────────────── */
.topnav { display: inline-flex; gap: 2px; margin-left: 22px; padding: 3px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 11px; }
.topnav-link { font-size: 13px; font-weight: 600; color: var(--ink-soft);
  padding: 6px 14px; border-radius: 8px; transition: background .15s, color .15s; }
.topnav-link:hover { color: var(--ink); }
.topnav-link.on { background: var(--grad); color: #fff; box-shadow: var(--shadow-sm); }

/* ─── CTA-баннер «Букеты-лидеры» на дашборде ─────────────────────────── */
.lead-cta { display: flex; align-items: center; gap: 14px; margin: 10px 0 22px;
  padding: 14px 18px; background: linear-gradient(100deg, color-mix(in srgb, var(--accent) 10%, transparent), color-mix(in srgb, var(--cyan) 6%, transparent));
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  transition: transform .16s var(--ease), box-shadow .16s, border-color .16s; }
.lead-cta:hover { transform: translateY(-2px); box-shadow: var(--shadow);
  border-color: var(--accent); }
.lead-cta-ic { display: grid; place-items: center; width: 42px; height: 42px; flex: none;
  border-radius: 11px; background: var(--surface); color: var(--accent-bright); }
.lead-cta-ic svg { width: 22px; height: 22px; }
.lead-cta-txt { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.lead-cta-txt strong { font-size: 15px; color: var(--ink); font-weight: 700; }
.lead-cta-txt span { font-size: 12.5px; color: var(--muted); }
.lead-cta-go { font-size: 13px; font-weight: 700; color: var(--accent-bright); flex: none; }

/* ─── Города-пилюли на странице букетов ──────────────────────────────── */
.lead-cities { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 20px; }
.lead-citypill { font-size: 13px; font-weight: 600; color: var(--ink-soft);
  padding: 7px 14px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; transition: background .15s, color .15s, border-color .15s; }
.lead-citypill:hover { color: var(--ink); border-color: var(--line-strong); }
.lead-citypill.on { background: var(--grad); color: #fff; border-color: transparent;
  box-shadow: var(--shadow-sm); }

/* подпись режима + статус «динамика завтра» на странице букетов */
.lead-caption { color: var(--muted); font-size: 13px; margin: -6px 2px 14px; }
.lead-note { display: block; color: var(--ink-soft); font-size: 13px; line-height: 1.5;
  background: color-mix(in srgb, var(--cyan) 6%, transparent); border: 1px solid color-mix(in srgb, var(--cyan) 22%, transparent);
  border-radius: var(--radius-sm); padding: 12px 14px; margin: 0 0 16px; }
.lead-note strong { color: var(--cyan); }

/* столбец «На главной» — число букетов магазина в ленте города */
.feedcount { font-weight: 700; color: var(--cyan); }

/* группа контролов виджета лидеров (кол-во 30/60 + сортировка) */
.lead-controls { display: inline-flex; gap: 8px; flex-wrap: wrap; }

/* блок «О конкуренте» на карточке магазина */
.si-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin: 14px 0 16px; }
.si-item { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; }
.si-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  font-weight: 600; }
.si-val { font-size: 18px; font-weight: 700; color: var(--ink); margin-top: 4px; }
.si-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.si-flag { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 8px;
  background: var(--surface-hi); color: var(--ink-soft); border: 1px solid var(--line); }
.si-flag.hot { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-bright); border-color: transparent; }
.si-schedule { margin-top: 4px; }
.si-days { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.si-day { display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px;
  padding: 6px 10px; min-width: 64px; }
.si-dow { font-size: 11px; font-weight: 700; color: var(--accent-bright); }
.si-hours { font-size: 11px; color: var(--ink-soft); white-space: nowrap; }

/* подпись/доставка в блоке «О конкуренте» */
.si-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.si-sub.free { color: var(--up); font-weight: 600; }
.si-deliv { border-color: var(--line-strong); }
.si-deliv .si-val { color: var(--cyan); }

/* ============================================================
   MOBILE / RESPONSIVE — comprehensive pass
   (appended last so these rules win the cascade)
   ============================================================ */

/* ——— Tablet (≤900px): tighter chrome, panels fit viewport ——— */
@media (max-width: 900px) {
  header.topbar { padding: .75rem 1.1rem; gap: .7rem; }
  .topnav { margin-left: 12px; }
  main { padding: 0 1.1rem; }
  .add-city-panel { width: min(360px, calc(100vw - 2rem)); }
  .citysel-panel { width: min(300px, calc(100vw - 2rem)); }
}

/* ——— Large phone (≤640px): controls go full-width ——— */
@media (max-width: 640px) {
  .toolbar { width: 100%; gap: .9rem; }
  .toolbar .ctl { flex: 1 1 100%; }
  .citysel, .citysel-btn { width: 100%; }
  .citysel-btn { min-width: 0; }
  .segment { width: 100%; }
  .segment button { flex: 1; text-align: center; }
  .add-city { width: 100%; }
  .add-city-btn { width: 100%; justify-content: center; }

  /* filter bar stacks: search takes the full row */
  .fb-search { flex: 1 1 100%; max-width: none; }
  .fb-count { margin-left: 0; }
  /* sort dropdown appears on phones (column headers are hidden) — full-width row */
  .fb-sort { display: inline-flex; flex: 1 1 100%; align-items: center; gap: .6rem; }
  .fb-sort .sortmenu-btn { flex: 1; }

  /* leaders: two snug columns */
  .lead-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .lead-name { font-size: 13px; min-height: 33px; }
  .lead-controls { width: 100%; }
  .lead-head { gap: 10px; }

  /* shop card */
  .shop-head h1 { font-size: 1.7rem; }
  .si-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

  /* личный кабинет — одна колонка */
  .acc-grid { grid-template-columns: 1fr; }

  /* iOS: inputs need ≥16px to avoid focus auto-zoom */
  input, select, textarea { font-size: 16px; }
}

/* ——— Phone (≤480px) ——— */
@media (max-width: 480px) {
  /* header reflows to two rows: brand row + full-width nav */
  header.topbar { flex-wrap: wrap; padding: .6rem .9rem; gap: .5rem .6rem; }
  .logo { font-size: 1.05rem; }
  .logo .name-dim { display: none; }
  .status-dot { display: none; }
  .userchip .avatar { width: 28px; height: 28px; }
  .topnav { order: 10; width: 100%; margin: 0; justify-content: center; }
  .topnav-link { flex: 1; text-align: center; }

  main { margin: 1.2rem auto 3rem; padding: 0 .9rem; }
  .page-head h1 { font-size: 1.55rem; }
  .page-head .sub { font-size: .86rem; }

  /* leaders: single comfortable column */
  .lead-grid { grid-template-columns: 1fr; }
  .lead-title h2 { font-size: 16px; }

  /* shop card: shorter charts, single-column info */
  .chart-box { height: 240px; }
  .chart-card { padding: 1.1rem; }
  .si-grid { grid-template-columns: 1fr; }

  /* auth card a touch tighter */
  .auth-card { padding: 1.9rem 1.4rem 1.6rem; }
}

/* ——— Phones (≤560px): table → cards, zero horizontal scroll ——— */
@media (max-width: 560px) {
  /* Header is NOT sticky on phones: the 2-row nav (98px tall) used to sit on top
     of the filter controls and swallow taps ("нельзя выбрать фильтры"). Letting it
     scroll away frees every control underneath it. */
  header.topbar { position: static; }

  /* kill the horizontal scroll container — rows become stacked cards */
  .table-scroll { overflow: visible; }
  #shoptable { display: block; width: 100%; min-width: 0; }
  #shoptable thead { display: none; }
  #shoptable tbody { display: block; }

  #shoptable tr.srow {
    display: flex; flex-wrap: wrap; align-items: center; gap: 9px 10px;
    padding: 13px 14px; border-bottom: 1px solid var(--line);
  }
  #shoptable tr.srow:last-child { border-bottom: 0; }
  #shoptable td { display: block; padding: 0; border: 0; }

  /* header line of the card: rank · name · ★ · ✕ */
  #shoptable td:nth-child(2) { order: 1; }                                 /* rank badge */
  #shoptable td:nth-child(3) { order: 2; flex: 1 1 40%; min-width: 0; }    /* name grows → pushes metrics to next line */
  #shoptable td:nth-child(3) .shopname { font-size: 15px; }
  #shoptable td:nth-child(1) { order: 3; }                                 /* star */
  #shoptable td:nth-child(10) { order: 4; text-align: right; padding: 0; } /* hide ✕ */

  /* metrics become labelled chips, 3 per row */
  #shoptable td:nth-child(4), #shoptable td:nth-child(5),
  #shoptable td:nth-child(6), #shoptable td:nth-child(7),
  #shoptable td:nth-child(8), #shoptable td:nth-child(9) {
    order: 5; flex: 1 1 27%;
    background: var(--surface-2); border: 1px solid var(--line);
    border-radius: 10px; padding: 7px 9px; font-variant-numeric: tabular-nums;
  }
  #shoptable td[data-label]::before {
    content: attr(data-label); display: block; line-height: 1.2;
    font-size: 9.5px; text-transform: uppercase; letter-spacing: .04em;
    color: var(--muted); font-weight: 700; margin-bottom: 3px;
  }
  /* sparkline is cramped in a chip — keep the number, drop the spark */
  #shoptable td:nth-child(4) .spark, #shoptable td:nth-child(4) .spark-empty { display: none; }
  #shoptable td:nth-child(4) .sales-num { min-width: 0; }
}

/* ——— Touch devices: no hover, so reveal hover-only affordances ——— */
@media (hover: none) {
  .rowhide { opacity: .55; }
  .city-opt-add { opacity: .8; }
  .lead-card .lead-open { max-height: 40px; padding: 0 12px 11px; }
}

/* ============================================================
   Переключатель оформления (светлое ⇄ тёмное)
   ============================================================ */
.theme-toggle { display: inline-grid; place-items: center; width: 34px; height: 34px;
  border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--muted); cursor: pointer; flex: none; padding: 0;
  transition: color .15s, border-color .15s, background .15s, transform .12s; }
.theme-toggle:hover { color: var(--accent-bright); border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent); }
.theme-toggle:active { transform: scale(.92); }
.theme-toggle svg { display: block; }
.theme-toggle .ic-sun { display: none; }
html.theme-dark .theme-toggle .ic-moon { display: none; }
html.theme-dark .theme-toggle .ic-sun { display: block; }
@media (max-width: 480px) { .theme-toggle { width: 30px; height: 30px; } }

/* ============================================================
   Подсказка о частоте обновления статистики (на дашборде)
   ============================================================ */
.update-note { display: inline-flex; align-items: center; gap: .4rem; margin-top: .55rem;
  font-size: .82rem; font-weight: 500; color: var(--muted); }
.update-note .un-ic { width: 14px; height: 14px; flex: none; opacity: .9; }
.update-note b { font-weight: 700; }
.update-note.hot .un-ic, .update-note.hot b { color: var(--cyan); }
.update-note.day .un-ic { color: var(--muted); }
.update-note.day b { color: var(--ink-soft); }

/* глубина данных по городу (с какой даты копится история) + предупреждение о коротком окне */
.data-span { margin-top: .3rem; font-size: .78rem; font-weight: 500; color: var(--muted); }
.data-span b { font-weight: 700; color: var(--ink-soft); }
.data-warn { display: inline-flex; align-items: center; gap: .4rem; margin-top: .35rem;
  font-size: .78rem; font-weight: 600; color: var(--warn, #e0a23a);
  background: color-mix(in srgb, var(--warn, #e0a23a) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn, #e0a23a) 32%, transparent);
  padding: .28rem .55rem; border-radius: 8px; }
.data-warn svg { width: 14px; height: 14px; flex: none; }
/* кнопка периода вне накопленной глубины — приглушена + точка-метка */
.segment button.over { opacity: .6; }
.segment button.over::after { content: "•"; margin-left: .15rem; color: var(--warn, #e0a23a);
  font-size: .9em; vertical-align: top; }
.segment button.over.active { opacity: 1; }

/* ============================================================
   Стилизованные диалоги (confirm) и тосты — вместо нативных alert/confirm
   ============================================================ */
.ui-modal { position: fixed; inset: 0; z-index: 120; display: none; place-items: center;
  background: rgba(6,7,11,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 1.2rem; }
html.theme-dark .ui-modal { background: rgba(6,7,11,.8); }
.ui-modal.on { display: grid; animation: pop .18s var(--ease) both; }
.ui-modal-card { width: 100%; max-width: 410px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  padding: 1.6rem 1.5rem 1.3rem; box-shadow: var(--shadow); }
.ui-modal-msg { font-size: 1rem; line-height: 1.55; color: var(--ink); margin-bottom: 1.4rem; }
.ui-modal-actions { display: flex; gap: .7rem; }
.ui-modal-actions .btn, .ui-modal-actions .btn-ghost { margin: 0; width: auto; flex: 1; }
.ui-modal-ok.ui-danger { background: var(--down); box-shadow: none; }
.ui-modal-ok.ui-danger:hover { filter: brightness(1.06); }

#ui-toasts { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%);
  z-index: 130; display: flex; flex-direction: column; gap: .5rem; align-items: center;
  pointer-events: none; width: max-content; max-width: 92vw; }
.ui-toast { pointer-events: auto; background: linear-gradient(180deg, var(--surface-2), var(--surface));
  color: var(--ink); border: 1px solid var(--line-strong); border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); padding: .7rem 1rem; font-size: .9rem; font-weight: 600;
  box-shadow: var(--shadow); animation: pop .2s var(--ease) both; }
.ui-toast.err { border-left-color: var(--down); }
.ui-toast.ok { border-left-color: var(--up); }
.ui-toast.out { opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s; }

/* ============ Аналитика «Рынок города» ============ */
.market-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .market-grid { grid-template-columns: 1fr; } }
.market-share-body { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.donut-box { width: 230px; height: 230px; flex: none; }
.share-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 2px; }
.share-legend li { display: flex; align-items: center; gap: 10px; font-size: .9rem;
  padding: 5px 7px; border-radius: 9px; transition: background .14s; }
.share-legend li:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.sl-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--muted);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--muted) 14%, transparent); }
.sl-name { flex: 1; color: var(--ink); text-decoration: none; font-weight: 600; }
a.sl-name:hover { color: var(--accent-bright); }
.sl-pct { font-family: 'JetBrains Mono', monospace; font-weight: 700; color: var(--ink-soft); }
.sl-others .sl-name { color: var(--muted); font-weight: 500; }
.growers-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.grower { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-bottom: 1px solid var(--line); }
.grower:last-child { border-bottom: 0; }
.grower-rank { font-family: 'JetBrains Mono', monospace; font-size: .8rem; color: var(--muted); min-width: 34px; }
.grower-name { flex: 1; color: var(--ink); text-decoration: none; font-weight: 600; }
.grower-name:hover { color: var(--accent-bright); }
.grower-sales { font-family: 'JetBrains Mono', monospace; font-weight: 700; color: var(--accent); font-size: .85rem; }
.seg-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.seg-chip { font-size: .8rem; color: var(--ink-soft); background: var(--surface-hi);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; }
.seg-chip b { color: var(--accent); font-family: 'JetBrains Mono', monospace; }
.rev-themes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 16px; }
.rev-themes-cap { font-size: .85rem; color: var(--ink-soft); font-weight: 600; }
.rev-theme-chip { font-size: .8rem; color: var(--ink-soft); background: var(--surface-hi);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; }
.rev-theme-chip b { color: var(--accent); font-family: 'JetBrains Mono', monospace; }
/* «Новые букеты» на карточке магазина: компактные плитки итогов над графиком */
.np-stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 2px 0 14px; }
.np-stat { display: flex; flex-direction: column; gap: 2px; min-width: 128px;
  padding: .6rem .85rem; background: var(--surface-hi); border: 1px solid var(--line);
  border-radius: var(--radius-sm); }
.np-k { font-family: 'Clash Display', sans-serif; font-size: 1.35rem; font-weight: 600;
  letter-spacing: -.02em; line-height: 1; color: var(--ink); }
.np-l { font-size: .74rem; color: var(--muted); font-weight: 600; }
.np-box { height: 220px; }
.np-note { margin-top: 12px; font-size: .8rem; }
.season-filling { display: inline-flex; align-items: center; gap: .5rem; margin: 8px 0 4px;
  font-size: .9rem; color: var(--muted); }
.season-filling .un-ic { width: 16px; height: 16px; flex: none; color: var(--accent); }
.season-filling b { color: var(--ink-soft); }
.season-holidays { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }

/* ── ADMIN: список пользователей ─────────────────────────────── */
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.csv-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px;
  border: 1px solid var(--line-strong); border-radius: 10px; color: var(--ink-soft);
  text-decoration: none; font-size: .88rem; background: var(--surface-hi); white-space: nowrap; }
.csv-btn:hover { color: var(--accent); border-color: var(--accent); }
.admin-search { display: flex; gap: 8px; align-items: center; margin: 14px 0 18px; flex-wrap: wrap; }
.admin-search input[type="search"] { flex: 1 1 260px; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface-hi); color: var(--ink);
  font: inherit; font-size: .92rem; }
.admin-search input[type="search"]:focus { outline: none; border-color: var(--accent); }
.admin-search .btn { padding: 10px 18px; }
.admin-reset { color: var(--muted); font-size: .85rem; }
/* ── Админ-таблица: всё в одном экране, без горизонтального скролла ── */
.admintable { min-width: 0; width: 100%; font-size: .85rem; }
.admintable th, .admintable td { padding: .5rem .55rem; }      /* плотнее базовых .72/.95rem */
.admintable td.nowrap, .admintable th { white-space: nowrap; }
/* email: типовой — в одну строку (комфортный минимум), аномально длинный — переносится */
.admintable td.emailcell { min-width: 178px; max-width: 240px; overflow-wrap: anywhere; }
/* город может переноситься (длинные «Ростов-на-Дону» не растягивают таблицу) */
.admintable td.citycell { max-width: 130px; overflow-wrap: anywhere; }
.adm-ok { color: var(--accent); font-weight: 600; }
.adm-no { color: #e07a5f; font-weight: 600; }
.adm-bell { margin-left: 4px; font-size: .82em; opacity: .85; }
.adm-toggle { display: inline; }
.adm-btn { font: inherit; font-size: .78rem; padding: 3px 9px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line-strong); background: transparent; color: var(--muted); white-space: nowrap; }
.adm-btn:hover { color: var(--accent); border-color: var(--accent); }
.adm-btn.on { color: var(--accent); border-color: var(--accent); }

/* активность / онлайн */
.dot-online { display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #22c55e; box-shadow: 0 0 0 3px color-mix(in srgb, #22c55e 22%, transparent);
  vertical-align: middle; animation: pulse-online 2s var(--ease) infinite; }
@keyframes pulse-online { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
.seen-on { color: #16a34a; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.seen-off { color: var(--muted); }
.admin-sort { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: -6px 0 16px; font-size: .82rem; }
.admin-sort .srt-lbl { color: var(--muted); }
.admin-sort .srt { padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line-strong);
  color: var(--muted); white-space: nowrap; transition: color .15s, border-color .15s, background .15s; }
.admin-sort .srt:hover { color: var(--accent); border-color: var(--accent); }
.admin-sort .srt.on { color: var(--accent); border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent); }
.admin-sort .srt.flt.on { color: #16a34a; border-color: #22c55e;
  background: color-mix(in srgb, #22c55e 12%, transparent); }
@media (prefers-reduced-motion: reduce) { .dot-online { animation: none; } }

/* «Магазин / сайт»: компактная метка + раскрытие полной ссылки по клику */
.shopcell { max-width: 220px; }
.lk-toggle { display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
  font: inherit; font-size: .85rem; padding: 3px 8px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface-hi); color: var(--ink-soft); }
.lk-toggle:hover { border-color: var(--accent); color: var(--accent); }
.lk-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lk-chev { flex: 0 0 auto; font-size: .7em; opacity: .7; transition: transform .15s ease; }
.lk-toggle.on .lk-chev { transform: rotate(180deg); }
.lk-plain { color: var(--ink-soft); }
.lk-detail[hidden] { display: none; }
.lk-detail > td { padding: 0 .55rem .7rem !important; border-bottom: 1px solid var(--line); }
.lk-detail-in { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  padding: 9px 12px; border-radius: 10px; background: var(--surface-hi); border: 1px solid var(--line); }
.lk-cap { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.lk-full { font-size: .85rem; word-break: break-all; color: var(--ink); }
a.lk-full { color: var(--cyan); text-decoration: none; }
a.lk-full:hover { text-decoration: underline; }
.lk-copy, .lk-open { font: inherit; font-size: .78rem; padding: 4px 10px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: transparent; color: var(--ink-soft);
  cursor: pointer; text-decoration: none; white-space: nowrap; }
.lk-copy:hover, .lk-open:hover { color: var(--accent); border-color: var(--accent); }

/* ── Админка: под-навигация по разделам (Пользователи · Аналитика · Логи) ── */
.adminsub { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 1.4rem; border-bottom: 1px solid var(--line); }
.adminsub a { padding: 9px 16px; color: var(--muted); text-decoration: none; font-weight: 600;
  font-size: .92rem; border-radius: 10px 10px 0 0; border: 1px solid transparent; border-bottom: 0;
  margin-bottom: -1px; transition: color .15s, background .15s; }
.adminsub a:hover { color: var(--ink); }
.adminsub a.on { color: var(--accent); background: var(--surface-hi);
  border-color: var(--line); border-bottom-color: var(--surface-hi); }

/* маленькая доля рядом со значением плитки */
.t-sub { font-family: 'General Sans', sans-serif; font-size: .9rem; font-weight: 600;
  color: var(--muted); margin-left: .45rem; letter-spacing: 0; }

/* заголовок секции внутри карточки */
.cardhead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  flex-wrap: wrap; margin-bottom: 1rem; }
.cardhead h2 { font-family: 'Clash Display', sans-serif; font-size: 1.12rem; font-weight: 600;
  margin: 0; letter-spacing: -.02em; }
.cardhead-sub { color: var(--muted); font-size: .82rem; }
.bt-head { margin-top: 1.3rem; }
.empty-line { color: var(--muted); font-size: .9rem; padding: .8rem 0; text-align: center; }

/* горизонтальные бар-листы (воронка / города / каналы / типы / причины ошибок) */
.statbars { display: flex; flex-direction: column; gap: 9px; }
.scroll-list { max-height: 340px; overflow-y: auto; padding-right: 4px; }
.scroll-list::-webkit-scrollbar { width: 8px; }
.scroll-list::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; }
.statrow { display: grid; grid-template-columns: minmax(92px, 34%) 1fr auto; align-items: center; gap: 10px; }
.statlabel { font-size: .86rem; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stattrack { height: 10px; background: color-mix(in srgb, var(--veil) 8%, transparent); border-radius: 6px; overflow: hidden; }
.statfill { display: block; height: 100%; border-radius: 6px; min-width: 2px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 55%, transparent), var(--accent)); }
.statfill.cyan { background: linear-gradient(90deg, color-mix(in srgb, var(--cyan) 55%, transparent), var(--cyan)); }
.statfill.ok   { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 50%, transparent), var(--accent)); }
.statfill.warn { background: linear-gradient(90deg, color-mix(in srgb, #e0a23a 55%, transparent), #e0a23a); }
.statval { font-variant-numeric: tabular-nums; font-weight: 600; font-size: .9rem; color: var(--ink);
  white-space: nowrap; text-align: right; }
.statpct { color: var(--muted); font-weight: 500; font-size: .8rem; margin-left: 6px; }

/* блок «ошибки регистрации» — крупная доля */
.err-summary { display: flex; align-items: center; gap: 16px; margin-bottom: 1rem; flex-wrap: wrap; }
.num.big { font-family: 'Clash Display', sans-serif; font-size: 2.1rem; font-weight: 600; line-height: 1; color: var(--accent); }
.err-cap { display: block; color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; }
.err-frac { color: var(--ink-soft); font-size: .88rem; }

/* журнал логов: бейджи уровня + ячейка деталей + фильтр */
.evlvl { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 600; border: 1px solid transparent; }
.ev-info  { color: var(--cyan); border-color: color-mix(in srgb, var(--cyan) 35%, transparent); background: color-mix(in srgb, var(--cyan) 9%, transparent); }
.ev-warn  { color: #d98a2b; border-color: color-mix(in srgb, #e0a23a 40%, transparent); background: color-mix(in srgb, #e0a23a 12%, transparent); }
.ev-error { color: #e0563f; border-color: color-mix(in srgb, #e07a5f 45%, transparent); background: color-mix(in srgb, #e07a5f 13%, transparent); }
.logtable td.logdetail { white-space: normal; max-width: 360px; color: var(--ink-soft); font-size: .85rem; }
.log-filter .lf-select { padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--surface-hi); color: var(--ink); font: inherit; font-size: .9rem; cursor: pointer; }

/* ── Пароль: глазок + табы способа регистрации ───────────────── */
.pw-wrap { position: relative; }
.pw-wrap input { width: 100%; padding-right: 44px; box-sizing: border-box; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center; padding: 6px;
  background: none; border: none; cursor: pointer; color: var(--muted); border-radius: 8px; }
.pw-eye:hover, .pw-eye.on { color: var(--accent); }
.pw-hint { margin-top: 6px; font-size: .82rem; }
.pw-hint.err { color: #e07a5f; }
.pw-hint.ok { color: var(--accent); }
.reg-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.reg-tab { flex: 1; padding: 10px 12px; font: inherit; font-size: .9rem; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-hi);
  color: var(--muted); }
.reg-tab.on { color: var(--accent); border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, transparent); font-weight: 600; }
.tg-login-or { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px;
  color: var(--faint); font-size: .82rem; }
.tg-login-or::before, .tg-login-or::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }

/* ============================================================
   ИНСАЙТЫ — лендинг: зачем Florstat + факторы выдачи Flowwow
   ============================================================ */
.ins { max-width: 1080px; margin: 0 auto; }
.ins-hero { text-align: center; padding: 1.5rem 0 .5rem; }
.ins-hero .eyebrow, .ins-section-head .eyebrow { justify-content: center; }
.ins-title { font-family: 'Clash Display', sans-serif; font-weight: 600;
  font-size: clamp(2rem, 4.4vw, 3.1rem); line-height: 1.08; letter-spacing: -.02em;
  margin: .7rem auto .8rem; max-width: 17ch; }
.ins-title em { font-style: normal; background: var(--grad); -webkit-background-clip: text;
  background-clip: text; -webkit-text-fill-color: transparent; }
.ins-lead { color: var(--muted); font-size: 1.06rem; line-height: 1.62; max-width: 60ch; margin: 0 auto 1.3rem; }
.ins-tags { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-bottom: 1.5rem; }
.ins-tag { font-size: .8rem; font-weight: 600; color: var(--ink-soft);
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  padding: .32rem .7rem; border-radius: 999px; }
.ins-hero-actions { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; }
.ins-btn { width: auto; margin: 0; padding-left: 1.4rem; padding-right: 1.4rem; }

.ins-section { margin-top: 3.2rem; }
.ins-section-head { text-align: center; margin-bottom: 1.7rem; }
.ins-h2 { font-family: 'Clash Display', sans-serif; font-weight: 600; font-size: 1.75rem; margin: .35rem 0 .45rem; }
.ins-sub { color: var(--muted); max-width: 58ch; margin: 0 auto; line-height: 1.55; }

.ins-features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.ins-feature { display: block; background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: 18px; padding: 1.35rem; box-shadow: var(--shadow-sm);
  color: var(--ink); transition: transform .16s var(--ease), border-color .16s, box-shadow .16s; }
.ins-feature:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: var(--shadow); color: var(--ink); }
.ins-feature-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent-bright); margin-bottom: .85rem; }
.ins-feature-ic svg { width: 22px; height: 22px; }
.ins-feature h3 { font-family: 'Clash Display', sans-serif; font-size: 1.08rem; font-weight: 600; margin: 0 0 .35rem; }
.ins-feature p { color: var(--muted); font-size: .88rem; line-height: 1.5; margin: 0; }
.ins-feature-go { display: inline-block; margin-top: .7rem; color: var(--accent-bright); font-weight: 600; font-size: .85rem; }

/* советы: чек-лист рекомендаций (персональные good/todo + общие) */
.ins-tips { display: grid; grid-template-columns: repeat(2, 1fr); gap: .85rem; }
.ins-tip { display: flex; gap: .9rem; align-items: flex-start; background: var(--surface);
  border: 1px solid var(--line); border-radius: 15px; padding: 1.05rem 1.15rem; box-shadow: var(--shadow-sm);
  transition: transform .16s var(--ease), border-color .16s; }
.ins-tip:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.ins-tip-ic { flex: none; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent-bright); }
.ins-tip-ic svg { width: 21px; height: 21px; }
.ins-tip h4 { font-size: .98rem; font-weight: 600; margin: 0 0 .25rem; }
.ins-tip p { color: var(--muted); font-size: .85rem; line-height: 1.5; margin: 0; }
.ins-tip.good { border-color: color-mix(in srgb, var(--up) 30%, transparent); }
.ins-tip.good .ins-tip-ic { background: var(--up-soft); color: var(--up); }
.ins-tip.todo { border-color: color-mix(in srgb, var(--mid-base) 38%, transparent); }
.ins-tip.todo .ins-tip-ic { background: color-mix(in srgb, var(--mid-base) 18%, transparent); color: var(--mid); }

/* приглашение привязать магазин / заметка «данные собираются» */
.ins-prompt { display: flex; align-items: center; gap: 1.1rem; padding: 1.3rem 1.5rem; border-radius: 18px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); color: var(--ink); transition: border-color .16s, transform .16s; }
a.ins-prompt:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); transform: translateY(-2px); color: var(--ink); }
.ins-prompt-note { background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 22%, transparent); }
.ins-prompt-ic { flex: none; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent-bright); }
.ins-prompt-ic svg { width: 24px; height: 24px; }
.ins-prompt > div { display: flex; flex-direction: column; gap: .2rem; flex: 1; }
.ins-prompt strong { font-family: 'Clash Display', sans-serif; font-size: 1.1rem; font-weight: 600; }
.ins-prompt span { color: var(--muted); font-size: .9rem; line-height: 1.45; }
.ins-prompt-go { flex: none; color: var(--accent-bright); font-weight: 700; white-space: nowrap; }

.ins-factors { display: grid; grid-template-columns: repeat(2, 1fr); gap: .85rem; }
.ins-factor { display: flex; gap: .9rem; align-items: flex-start; background: var(--surface);
  border: 1px solid var(--line); border-radius: 15px; padding: 1.05rem 1.15rem; box-shadow: var(--shadow-sm);
  transition: transform .16s var(--ease), border-color .16s; }
.ins-factor:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.ins-factor-ic { flex: none; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent-bright); }
.ins-factor-ic svg { width: 21px; height: 21px; }
.ins-factor h4 { font-size: .98rem; font-weight: 600; margin: 0 0 .25rem; }
.ins-factor p { color: var(--muted); font-size: .85rem; line-height: 1.5; margin: 0; }

.ins-note { display: flex; gap: 1rem; align-items: flex-start; margin-top: 1.3rem;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent); border-radius: 16px; padding: 1.2rem 1.3rem; }
.ins-note-ic { flex: none; color: var(--accent-bright); margin-top: .05rem; }
.ins-note p { margin: 0; color: var(--ink-soft); font-size: .92rem; line-height: 1.62; }
.ins-note b { color: var(--ink); }

.ins-cta { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem;
  margin-top: 2.6rem; padding: 1.5rem 1.8rem; border-radius: 20px; background: var(--grad);
  color: #fff; box-shadow: var(--accent-glow); flex-wrap: wrap; }
.ins-cta:hover { color: #fff; filter: brightness(1.04); }
.ins-cta-copy { display: flex; flex-direction: column; gap: .25rem; }
.ins-cta-copy strong { font-family: 'Clash Display', sans-serif; font-size: 1.25rem; font-weight: 600; }
.ins-cta-copy span { opacity: .92; font-size: .92rem; }
.ins-cta-go { font-weight: 700; white-space: nowrap; background: rgba(255, 255, 255, .18);
  padding: .6rem 1.1rem; border-radius: 12px; }

@media (max-width: 900px) {
  .ins-features { grid-template-columns: repeat(2, 1fr); }
  .ins-factors, .ins-tips { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .ins-features { grid-template-columns: 1fr; }
  .ins-cta, .ins-prompt { flex-direction: column; align-items: flex-start; }
}

/* ============ Lottie-анимации (ленивый рендер, обе темы) ============ */
/* контейнеры держат размер, чтобы не было сдвига при подгрузке svg */
[data-lottie] { display: inline-block; }
[data-lottie] svg { display: block; width: 100%; height: 100%; }

/* лоадер при HTMX-загрузке карточки магазина */
.hint-load { display: flex; align-items: center; gap: .5rem; padding: .5rem .2rem; }
.lottie-loader { width: 54px; height: 54px; flex: none; }

/* пустое состояние «город не на полном сборе» — заменяет статичную иконку */
.season-anim { width: 30px; height: 30px; flex: none; }

/* пустое состояние «данные собираются» на «Советах» */
.ins-prompt-anim { width: 56px; height: 56px; flex: none; }

/* hero-анимация на странице «Советы» */
.ins-hero-anim { width: 168px; height: 168px; margin: 0 auto .4rem; }

/* брендовый знак на экранах входа/регистрации — анимация вместо ✿,
   с фолбэком-глифом пока svg не отрисован (и при reduced-motion) */
.auth-card .brand .mark-anim { background: none; box-shadow: none; width: 96px; height: 96px; }
.auth-card .brand .mark-anim::after { content: "✿"; color: var(--accent); font-size: 46px; line-height: 1; }
.auth-card .brand .mark-anim[data-lottie-on]::after { content: none; }

@media (prefers-reduced-motion: reduce) {
  /* чисто декоративные контейнеры скрываем, чтобы не зияли пустотой;
     текст рядом (загрузка/пустые состояния) остаётся информативным */
  .ins-hero-anim, .lottie-loader, .season-anim, .ins-prompt-anim { display: none; }
  /* у брендового знака оставляем ✿ */
}

/* цвета Lottie по ролям — следуют активной теме (перекраска в lottie.js) */
:root { --anim-deep: #0a7d79; --anim-mid: #1aa39d; --anim-light: #5fc9c3; --anim-core: #e8b54a; }
html.theme-dark { --anim-deep: #d61f63; --anim-mid: #ff4d8d; --anim-light: #ff8f6b; --anim-core: #ffb86b; }

/* размеры новых Lottie-мест (loader/collecting/celebrate/404) */
.lt-load { width: 44px; height: 44px; display: inline-block; vertical-align: middle; margin-right: .4rem; flex: none; }
.lt-load-lg { width: 60px; height: 60px; margin: .6rem auto .2rem; display: block; }
.lt-empty { width: 84px; height: 84px; margin: 0 auto .5rem; display: block; }
.ins-celebrate { width: 132px; height: 132px; margin: 0 auto -.2rem; display: block; }
/* страница 404 — поникший цветок */
.err-card { text-align: center; }
.err-anim { width: 188px; height: 188px; margin: 0 auto .4rem; display: block; }
.err-code { font-family: 'Clash Display', sans-serif; font-weight: 600; font-size: 2.6rem;
  letter-spacing: -.03em; line-height: 1; color: var(--accent-bright); }
.err-title { font-family: 'Clash Display', sans-serif; font-size: 1.4rem; font-weight: 600; margin: .3rem 0 .2rem; }

@media (prefers-reduced-motion: reduce) {
  .lt-load, .lt-load-lg, .lt-empty, .ins-celebrate, .err-anim { display: none; }
}

/* ============ Виджет «Динамика выкупов» (rt-card) ============ */
.rt-card .rt-head{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.rt-toggle{ display:inline-flex; gap:4px; background:var(--surface-hi); border:1px solid var(--line);
  border-radius:10px; padding:3px; }
.rt-tab{ border:0; background:transparent; color:var(--muted); font:inherit; padding:5px 12px;
  border-radius:8px; cursor:pointer; }
.rt-tab.is-active{ background:var(--accent); color:#fff; }
.rt-note{ color:var(--muted); font-size:.88rem; margin:.4rem 0 1rem; max-width:880px; }
/* донат (доля) + бары (по периодам) рядом; на узком — друг под другом */
.rt-charts{ display:grid; grid-template-columns:300px 1fr; gap:22px; align-items:stretch; }
@media (max-width:760px){ .rt-charts{ grid-template-columns:1fr; } }
.rt-chart-cap{ display:block; font-size:.8rem; font-weight:600; color:var(--muted); margin-bottom:8px; }
.rt-donut-box{ height:260px; position:relative; }
.rt-bars-box{ height:300px; position:relative; }
/* общая легенда: цветная плашка + полное имя + число */
.rt-legend{ display:flex; flex-wrap:wrap; gap:8px 16px; margin:16px 2px 4px; }
.rt-leg{ display:inline-flex; align-items:center; gap:7px; font-size:.9rem; color:var(--ink-soft); }
.rt-leg i{ width:12px; height:12px; border-radius:3px; flex:none; }
.rt-leg b{ color:var(--ink); font-weight:700; }
/* заголовок таблицы + сортировка */
.rt-table-head{ display:flex; align-items:center; justify-content:space-between; gap:12px;
  margin:18px 0 6px; }
.rt-detail-toggle{ display:inline-flex; align-items:center; gap:8px; border:0; background:transparent;
  padding:4px 2px; cursor:pointer; font:inherit; }
.rt-table-title{ font-size:.95rem; font-weight:600; color:var(--ink); }
.rt-caret{ width:0; height:0; border-left:5px solid transparent; border-right:5px solid transparent;
  border-top:6px solid var(--muted); transition:transform .18s ease; flex:none; }
.rt-detail.is-collapsed .rt-caret{ transform:rotate(-90deg); }
.rt-detail.is-collapsed .rt-table-wrap,
.rt-detail.is-collapsed .rt-sort{ display:none; }
.rt-sort{ display:inline-flex; gap:4px; background:var(--surface-hi); border:1px solid var(--line);
  border-radius:10px; padding:3px; }
.rt-sortbtn{ border:0; background:transparent; color:var(--muted); font:inherit; font-size:.85rem;
  padding:5px 11px; border-radius:8px; cursor:pointer; }
.rt-sortbtn.is-active{ background:var(--accent); color:#fff; }
.rt-table-wrap{ overflow:auto; }
.rt-table{ width:100%; border-collapse:collapse; font-size:.92rem; }
.rt-table th,.rt-table td{ text-align:left; padding:9px 12px; border-bottom:1px solid var(--line); }
.rt-table th:last-child,.rt-table td:last-child{ text-align:right; width:1%; white-space:nowrap; }
.rt-table th{ color:var(--muted); font-weight:600; }
.rt-table tbody tr:hover{ background:var(--surface-hi); }
.rt-blink{ color:var(--accent); text-decoration:none; }
.rt-blink:hover{ text-decoration:underline; }
.rt-empty{ color:var(--muted); text-align:center; }
/* пустое состояние вкладки «День» с Lottie */
.rt-day-empty{ display:flex; flex-direction:column; align-items:center; text-align:center;
  padding:30px 16px 36px; gap:6px; }
.rt-empty-anim{ width:140px; height:140px; display:block; }
.rt-day-empty-text{ color:var(--muted); max-width:440px; margin:0; }

/* ============================================================
   ТЕЛЕФОННЫЙ ЯКОРЬ (≤520px) — канонический брейкпоинт мобильной адаптации.
   Только правила для телефона; десктоп/планшет не затрагиваются.
   ============================================================ */
@media (max-width: 520px) {
  main { padding: 0 .85rem; }                 /* контент влезает по ширине без горизонт-скролла */
  input, select, textarea { font-size: 16px; } /* iOS не зумит поле при фокусе */
}

/* ===== Мобильная навигация: бургер + выпадающее меню (≤560px) ===== */
.nav-toggle { display: none; align-items: center; justify-content: center;
  width: 42px; height: 42px; border: 1px solid var(--line-strong);
  background: var(--surface-hi); border-radius: 10px; color: var(--ink); cursor: pointer; }
@media (max-width: 560px) {
  .nav-toggle { display: inline-flex; margin-left: auto; order: 5; }
  header.topbar { flex-wrap: wrap; row-gap: .5rem; }
  .status-dot { display: none; }
  /* свёрнуто: в баре только логотип + переключатель темы + бургер */
  header.topbar .topnav,
  header.topbar .userchip,
  header.topbar .logout-form { display: none; }
  /* раскрыто: пункты меню, профиль и выход — вертикально под шапкой */
  header.topbar.nav-open .topnav { display: flex; flex-direction: column; gap: 2px;
    width: 100%; order: 10; margin: 0; }
  header.topbar.nav-open .topnav-link { flex: initial; text-align: left;
    padding: .7rem .7rem; border-radius: 8px; }
  header.topbar.nav-open .userchip { display: flex; width: 100%; order: 11; }
  header.topbar.nav-open .userchip-mail { display: inline; }
  header.topbar.nav-open .logout-form { display: block; width: 100%; order: 12; }
}

/* ===== Таблицы на телефоне: обёртки не растягивают родителя + плотность ===== */
.table-scroll, .rt-table-wrap { min-width: 0; max-width: 100%; }   /* классический min-width:0 фикс grid/flex overflow */
.table-card { min-width: 0; }
@media (max-width: 520px) {
  .table-scroll table th, .table-scroll table td { padding-left: .55rem; padding-right: .55rem; }
}

/* ===== Графики на телефоне: уменьшенные высоты, фикс-донат центрируется (≤520px) ===== */
@media (max-width: 520px) {
  .chart-box { height: 230px; }
  .rt-donut-box { height: 220px; }
  .rt-bars-box { height: 240px; }
  .donut-box { width: 200px; height: 200px; margin-left: auto; margin-right: auto; }
}

/* ===== Постраничный телефонный sweep: стек тесных сеток, страховочный wrap (≤520px) ===== */
@media (max-width: 520px) {
  .reg-types { grid-template-columns: 1fr; }      /* типы бизнеса при регистрации — в столбик, удобно тапать */
  .acc-grid { grid-template-columns: 1fr; }        /* поля личного кабинета — в один столбец */
  .ins-tips, .ins-factors { grid-template-columns: 1fr; }  /* карточки советов — в столбик */
  .lead-sort { flex-wrap: wrap; }                  /* сегмент сортировки лидеров не вылезает за экран */
  .si-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }  /* мелкие стат-плитки — 2 в ряд */
}

/* ===== Сенсорные цели на телефоне ≥40px (≤520px) ===== */
@media (max-width: 520px) {
  .theme-toggle { width: 40px; height: 40px; }   /* комфортный тап (перекрывает компактные 30px) */
}

/* ── Прогресс к цели по пользователям (админка) ── */
.goal-card { margin: 0 0 16px; padding: 18px 20px; border-radius: 16px;
  background: var(--card-bg, #fff); box-shadow: var(--card-shadow, 0 1px 3px rgba(0,0,0,.06)); }
.goal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.goal-title { font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted, #66707a); }
.goal-badge { font-size: .85rem; font-weight: 600; color: var(--accent, #1aa29d); }
.goal-count { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 12px; font-size: 1.4rem; font-weight: 600; }
.goal-count b { font-size: 2rem; font-weight: 700; }
.goal-pct { font-size: 1rem; font-weight: 500; color: var(--muted, #66707a); }
/* трек: фон-дорожка во всю ширину */
.goal-bar { position: relative; height: 24px; border-radius: 12px; overflow: hidden;
  background: color-mix(in srgb, var(--anim-mid, #1aa29d) 14%, transparent); }
/* заливка: ширина РОВНО по проценту (пропорциональна данным) */
.goal-fill { position: absolute; left: 0; top: 0; bottom: 0;
  width: calc(var(--pct, 0) * 1%); min-width: 6px; border-radius: 12px;
  background: linear-gradient(90deg, var(--anim-deep, #097c79), var(--anim-mid, #1aa29d) 55%, var(--anim-light, #5fc8c3));
  transition: width 1s cubic-bezier(.2,.8,.2,1); overflow: hidden; }
/* водяной перелив: светлый блик, бегущий по заливке */
.goal-fill::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 25%, rgba(255,255,255,.45) 50%, transparent 75%);
  background-size: 250% 100%;
  animation: goal-shimmer 2.8s ease-in-out infinite; }
@keyframes goal-shimmer { 0% { background-position: 130% 0; } 100% { background-position: -130% 0; } }
/* без анимаций — оставляем статичную заливку */
@media (prefers-reduced-motion: reduce) { .goal-fill::after { animation: none; opacity: 0; } }
.goal-foot { margin-top: 8px; font-size: .85rem; color: var(--muted, #66707a); }

/* ============================================================
   CHANNEL BANNER — баннер подписки на Telegram-канал
   Двухэтапный выкат: .is-preview (суперадмин) → одобрение → всем
   ============================================================ */

/* Enter animation: banner slides in from top */
@keyframes cb-enter {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: none; }
}

/* Staggered children enter */
@keyframes cb-child-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.channel-banner {
  /* Layout */
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .9rem 1.1rem;
  margin-bottom: 1.4rem;

  /* Shape — outer radius; inner buttons use --radius-sm (12px) = 18−6px pad */
  border-radius: var(--radius);

  /* Surface: accent-tinted soft card */
  background: linear-gradient(
    110deg,
    color-mix(in srgb, var(--accent) 9%, var(--surface)),
    color-mix(in srgb, var(--cyan) 5%, var(--surface))
  );

  /* Shadows over borders: layered transparent shadows for natural depth */
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent),
    0 4px 14px -6px color-mix(in srgb, var(--accent) 22%, transparent),
    0 1px 3px rgba(0,0,0,.04);

  /* Enter animation */
  animation: cb-enter .4s var(--ease) both;

  /* Specific transitions — never `all` */
  transition: box-shadow .2s, transform .15s var(--ease);
}

/* Icon: stagger delay 1 */
.cb-ic {
  font-size: 1.35rem;
  line-height: 1;
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px; /* concentric: banner 18px − 7px padding ≈ 11px */
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  animation: cb-child-in .35s var(--ease) .05s both;
}

/* Text block: stagger delay 2 */
.cb-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .18rem;
  animation: cb-child-in .35s var(--ease) .1s both;
}

.cb-text strong {
  font-size: .95rem;
  font-weight: 700;
  color: var(--ink);
  text-wrap: balance; /* principle: headings use balance */
}

.cb-text .cb-sub {
  font-size: .8rem;
  color: var(--muted);
  text-wrap: pretty; /* principle: body avoids orphans */
}

/* Preview tag — amber/warning tint */
.cb-tag {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .15rem .5rem;
  border-radius: 6px; /* concentric: tag is tiny, inner radius much smaller */
  background: color-mix(in srgb, var(--mid-base) 22%, transparent);
  color: var(--mid);
  margin-bottom: .15rem;
}

/* Actions: stagger delay 3 */
.cb-actions {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex: none;
  animation: cb-child-in .35s var(--ease) .16s both;
}

/* Primary CTA button — inherits .btn base, but auto-width and no full-width */
.cb-actions .btn.cb-go {
  width: auto;
  margin-top: 0;
  padding: .55rem 1rem;
  font-size: .88rem;
  /* scale on press: 0.96 — tactile feedback */
  transition: transform .1s var(--ease), box-shadow .2s, filter .2s;
}
.cb-actions .btn.cb-go:hover { transform: translateY(-1px); }
.cb-actions .btn.cb-go:active { transform: scale(.96); }

/* Approve button — secondary success tint (superadmin only) */
.cb-actions .btn.cb-approve {
  width: auto;
  margin-top: 0;
  padding: .55rem .9rem;
  font-size: .85rem;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--up) 80%, var(--accent)),
    color-mix(in srgb, var(--up) 60%, var(--cyan))
  );
  box-shadow: 0 8px 22px -8px color-mix(in srgb, var(--up) 55%, transparent);
  transition: transform .1s var(--ease), box-shadow .2s, filter .2s;
}
.cb-actions .btn.cb-approve:hover { filter: brightness(1.06); transform: translateY(-1px); }
.cb-actions .btn.cb-approve:active { transform: scale(.96); }

/* Close (×) dismiss button — icon-only, no heavy border, min 40×40px hit area */
.cb-close {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;

  /* Hit area: at least 40×40px */
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px; /* concentric: inside banner 18px, padded down */

  font-size: 1.3rem;
  line-height: 1;
  color: var(--muted);
  transition: background .15s, color .15s, transform .1s var(--ease);
}
.cb-close:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--ink);
}
.cb-close:active { transform: scale(.96); }

/* .is-preview variant: dashed warning border, slightly warmer tint */
.channel-banner.is-preview {
  background: linear-gradient(
    110deg,
    color-mix(in srgb, var(--mid-base) 10%, var(--surface)),
    color-mix(in srgb, var(--accent) 6%, var(--surface))
  );
  box-shadow:
    0 0 0 1.5px color-mix(in srgb, var(--mid-base) 50%, transparent),
    0 4px 14px -6px color-mix(in srgb, var(--mid-base) 18%, transparent);
  /* Dashed effect via outline (outline respects border-radius unlike border) */
  outline: 1.5px dashed color-mix(in srgb, var(--mid) 40%, transparent);
  outline-offset: 2px;
}

.channel-banner.is-preview .cb-ic {
  background: color-mix(in srgb, var(--mid-base) 20%, transparent);
}

/* Responsive: stack on mobile ≤560px */
@media (max-width: 560px) {
  .channel-banner {
    flex-wrap: wrap;
    gap: .75rem;
    padding: .85rem .9rem;
  }

  .cb-text { order: 1; width: calc(100% - 50px); } /* full width after icon */
  .cb-ic   { order: 0; }
  .cb-actions {
    order: 2;
    width: 100%;
    flex-wrap: wrap;
    gap: .45rem;
  }
  /* On mobile, go/approve buttons take up comfortable width */
  .cb-actions .btn.cb-go,
  .cb-actions .btn.cb-approve {
    flex: 1;
    min-width: 120px;
  }
  .cb-close {
    margin-left: auto; /* push × to the right edge */
  }
}

/* Reduce motion: skip all banner animations */
@media (prefers-reduced-motion: reduce) {
  .channel-banner,
  .cb-ic,
  .cb-text,
  .cb-actions { animation: none; }
}

/* ════════════════════════════════════════════════════════════════════════
   Выкупы: редизайн (карточки rc-* + панель «Динамика выкупов» rdp-*).
   Все цвета — через токены тем → работают в светлой (teal) и тёмной (pink).
   ════════════════════════════════════════════════════════════════════════ */

/* ─── Новые карточки букетов (rc-*) ──────────────────────────────────── */
.rc-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.rc-card { display: flex; flex-direction: column; min-width: 0; color: inherit; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s; }
.rc-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--accent); color: inherit; }
.rc-thumb { position: relative; flex: none; width: 100%; aspect-ratio: 4 / 3; overflow: hidden;
  background-size: cover; background-position: center; background-color: var(--surface-2); }
.rc-num { position: absolute; left: 10px; top: 10px; padding: 3px 9px; border-radius: 8px;
  background: rgba(8,9,14,.72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .01em; }
.rc-buys { position: absolute; right: 10px; top: 10px; display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px; background: var(--grad); color: #fff;
  font-size: 12px; font-weight: 800; box-shadow: 0 5px 16px -4px color-mix(in srgb, var(--accent) 65%, transparent); }
.rc-body { padding: 12px 13px 14px; display: flex; flex-direction: column; gap: 0; flex: 1; }
.rc-name { font-size: 13.5px; font-weight: 650; line-height: 1.3; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 35px; }
.rc-shop { font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-meta { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-top: 10px; }
.rc-price { font-size: 17px; font-weight: 800; letter-spacing: -.01em; color: var(--ink); }
.rc-rate { font-size: 13px; font-weight: 700; color: #f5c451; }
.rc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; padding-top: 11px;
  border-top: 1px solid var(--line); min-height: 22px; }
.rc-chip { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 7px; line-height: 1.35; white-space: nowrap; }
.rc-chip.up { background: var(--up-soft); color: var(--up); }
.rc-chip.down { background: var(--down-soft); color: var(--down); }
.rc-chip.fav { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-bright); }
.rc-chip.muted { background: var(--surface-hi); color: var(--muted); }
.rc-chip.ready { background: color-mix(in srgb, var(--cyan) 16%, transparent); color: var(--cyan); }
.rc-chip.disc { background: var(--down-soft); color: var(--down); }
@media (prefers-reduced-motion: reduce) { .rc-card:hover { transform: none; } }

/* бейдж «за период» рядом с заголовком секции */
.rc-period-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600;
  color: var(--accent-bright); background: color-mix(in srgb, var(--accent) 13%, transparent);
  padding: 5px 12px; border-radius: 999px; }
.rc-period-badge svg { opacity: .85; }

/* ─── Панель «Динамика выкупов» (rdp-*) ──────────────────────────────── */
.rdp { position: relative; }
.rdp-head { display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.rdp-title { flex: 1; min-width: 240px; }
.rdp-title-row { display: flex; align-items: center; gap: 10px; }
.rdp-title h3 { margin: 0; }
.rdp-gran { font-size: 11px; font-weight: 700; color: var(--accent-bright);
  background: color-mix(in srgb, var(--accent) 14%, transparent); padding: 3px 9px; border-radius: 999px; }
.rdp-sub { margin: 7px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); max-width: 560px; }

.rdp-period { position: relative; display: flex; align-items: center; gap: 8px; }
.rdp-pbtn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 15px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
  cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; transition: border-color .15s, background .15s; }
.rdp-pbtn:hover { border-color: var(--accent); }
.rdp-pbtn-lab { font-weight: 700; }
.rdp-pbtn-caret { opacity: .55; font-size: 11px; }
.rdp-clear { width: 38px; height: 38px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 11px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted);
  text-decoration: none; font-size: 15px; transition: border-color .15s, color .15s; }
.rdp-clear:hover { border-color: var(--down); color: var(--down); }

/* поповер-календарь */
.rdp-pop { position: absolute; top: calc(100% + 10px); right: 0; z-index: 60; width: 326px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 18px;
  box-shadow: var(--shadow); padding: 16px; transform-origin: top right; animation: pop .16s var(--ease) both; }
.rdp-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.rdp-preset { padding: 6px 11px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: all .15s; }
.rdp-preset:hover { color: var(--accent); border-color: var(--accent); }
.rdp-cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.rdp-cal-mon { font-size: 14px; font-weight: 700; color: var(--ink); }
.rdp-nav { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink); cursor: pointer; font-size: 15px; line-height: 1; }
.rdp-nav:hover { border-color: var(--accent); color: var(--accent); }
.rdp-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 4px; }
.rdp-dow span { text-align: center; font-size: 10.5px; font-weight: 700; color: var(--faint); padding: 4px 0; }
.rdp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; width: 100%; }
.rdp-cell { height: 38px; min-width: 0; display: flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--ink); border-radius: 9px; font: inherit; font-size: 12.5px;
  font-weight: 600; cursor: pointer; padding: 0; transition: background .12s, color .12s; }
.rdp-cell.empty { background: none; cursor: default; }
.rdp-cell:not(.dis):not(.empty):hover { background: var(--surface-hi); }
.rdp-cell.dis { color: var(--faint); opacity: .4; cursor: not-allowed; }
.rdp-cell.insel { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-bright); border-radius: 0; }
.rdp-cell.edge { background: var(--grad); color: #fff; border-radius: 9px; }
.rdp-cal-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
.rdp-cal-sel { font-size: 12px; color: var(--muted); font-weight: 500; line-height: 1.3; flex: 1; }
.rdp-apply { padding: 8px 16px; border-radius: 10px; border: 0; background: var(--grad); color: #fff;
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; box-shadow: var(--shadow-sm); }
.rdp-apply[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }

/* KPI ряд варианта A */
.rdp-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.rdp-kpi { background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 15px 16px; }
.rdp-kpi-l { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.rdp-kpi-v { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); line-height: 1; }
.rdp-kpi-v.up { color: var(--up); } .rdp-kpi-v.down { color: var(--down); } .rdp-kpi-v.muted { color: var(--faint); }
.rdp-kpi-s { font-size: 11.5px; color: var(--faint); margin-top: 6px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* энтранс-анимации варианта A (как в макете): KPI и строки топа всплывают по очереди */
.rdp-kpi { animation: rise .5s var(--ease) both; }
.rdp-kpi:nth-child(1){ animation-delay: .04s } .rdp-kpi:nth-child(2){ animation-delay: .1s }
.rdp-kpi:nth-child(3){ animation-delay: .16s } .rdp-kpi:nth-child(4){ animation-delay: .22s }
.rdp-top-row { animation: rise .45s var(--ease) both; }
.rdp-top-row:nth-child(2){ animation-delay: .05s } .rdp-top-row:nth-child(3){ animation-delay: .1s }
.rdp-top-row:nth-child(4){ animation-delay: .15s } .rdp-top-row:nth-child(5){ animation-delay: .2s }
.rdp-top-row:nth-child(n+6){ animation-delay: .25s }
@media (prefers-reduced-motion: reduce) { .rdp-kpi, .rdp-top-row { animation: none; } }

/* график + топ */
.rdp-chart-box { position: relative; height: 248px; }
.rdp-drill { margin-top: 12px; font-size: 12px; color: var(--faint); display: flex; align-items: center; gap: 8px; }
.rdp-drill-ic { display: inline-flex; width: 19px; height: 19px; align-items: center; justify-content: center;
  border-radius: 6px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-bright);
  font-size: 12px; font-weight: 700; }
.rdp-top { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.rdp-top-h { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 14px; }
.rdp-top-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 11px 30px; }
.rdp-top-row { display: flex; align-items: center; gap: 11px; min-width: 0; }
.rdp-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; background: var(--muted); }
.rdp-top-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
a.rdp-top-name:hover { color: var(--accent); }
.rdp-top-pct { font-size: 12px; color: var(--faint); font-weight: 600; }
.rdp-top-cnt { font-size: 14px; font-weight: 800; color: var(--ink); min-width: 22px; text-align: right; }

/* пустое состояние */
.rdp-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  min-height: 248px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-2); padding: 28px; }
.rdp-empty-anim { width: 84px; height: 84px; margin-bottom: 10px; }
.rdp-empty-t { font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.rdp-empty-d { font-size: 13px; color: var(--muted); max-width: 400px; line-height: 1.5; margin-bottom: 18px; }
.rdp-empty-btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 12px;
  border: 0; background: var(--grad); color: #fff; font: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer; text-decoration: none; box-shadow: var(--shadow-sm); }

/* адаптив */
@media (max-width: 760px) {
  .rdp-kpis { grid-template-columns: repeat(2, 1fr); }
  .rdp-top-grid { grid-template-columns: 1fr; gap: 9px; }
  .rdp-head { flex-direction: column; }
  .rdp-period { width: 100%; }
  .rdp-pbtn { flex: 1; justify-content: center; }
}
@media (max-width: 520px) {
  .rc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .rdp-pop { position: fixed; left: 12px; right: 12px; width: auto; top: auto; }
  .rdp-chart-box { height: 210px; }
}
@media (max-width: 380px) {
  .rc-grid { grid-template-columns: 1fr; }
  .rdp-kpis { grid-template-columns: 1fr; }
}

/* ═══════════════ Поддержка (обращения) ═══════════════ */

/* — плавающая кнопка «Сообщить о проблеме» — */
.support-fab{position:fixed;right:20px;bottom:20px;z-index:60;display:inline-flex;
  align-items:center;gap:8px;padding:12px 18px 12px 15px;border-radius:100px;
  background:var(--grad);color:#fff;font:600 14px/1 inherit;text-decoration:none;
  box-shadow:0 10px 28px -8px color-mix(in srgb,var(--accent) 60%,transparent),
             0 2px 6px rgba(15,36,35,.18);
  transition:transform .35s var(--ease),box-shadow .35s var(--ease)}
.support-fab svg{width:18px;height:18px;flex:none}
.support-fab:hover{transform:translateY(-2px);
  box-shadow:0 16px 34px -8px color-mix(in srgb,var(--accent) 70%,transparent),
             0 3px 8px rgba(15,36,35,.2)}
.support-fab:active{transform:translateY(0)}
.support-fab-label{white-space:nowrap}
@media (max-width:560px){
  .support-fab{right:14px;bottom:14px;padding:13px}
  .support-fab-label{display:none}
}

/* — модалка обращения — */
.support-modal{position:fixed;inset:0;z-index:70;display:none;align-items:center;
  justify-content:center;padding:18px;
  background:color-mix(in srgb,var(--ink) 55%,transparent);
  backdrop-filter:blur(6px) saturate(1.1);-webkit-backdrop-filter:blur(6px) saturate(1.1)}
.support-modal.on{display:flex;animation:supFade .25s var(--ease)}
.support-modal-card{background:var(--surface);color:var(--ink);max-width:480px;width:100%;
  padding:22px;border-radius:var(--radius-lg);border:1px solid var(--line);
  box-shadow:var(--shadow);display:flex;flex-direction:column;gap:13px;
  max-height:calc(100vh - 36px);overflow:auto;animation:supRise .3s var(--ease)}
.support-modal-card h3{margin:0;font-size:1.15rem;letter-spacing:-.01em}
.support-modal-card .sup-modal-hint{margin:-6px 0 2px;font-size:.82rem;color:var(--muted)}
.support-modal-card input[type=text],.support-modal-card textarea,
.sup-reply textarea{width:100%;padding:11px 13px;border:1px solid var(--line-strong);
  border-radius:var(--radius-sm);background:var(--input-bg);color:var(--ink);
  font:inherit;font-size:.95rem;transition:border-color .2s var(--ease),box-shadow .2s var(--ease)}
.support-modal-card input[type=text]:focus,.support-modal-card textarea:focus,
.sup-reply textarea:focus{outline:none;border-color:var(--accent);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 18%,transparent)}
.support-modal-card textarea{resize:vertical;min-height:120px}
.sup-reply textarea{resize:vertical;min-height:150px}
.support-modal-actions{display:flex;gap:8px;justify-content:flex-end;align-items:center;
  flex-wrap:wrap;margin-top:2px}
.support-modal-actions .btn,.support-modal-actions .btn-ghost{width:auto;margin:0;padding:.72rem 1.1rem}
.support-modal-actions .sup-mine{margin-right:auto;font-size:.86rem}

/* — красивый файл-дропзон (клик / drag-drop / вставка из буфера) — */
.sup-drop{display:block}
.sup-drop-zone[hidden],.sup-drop-preview[hidden]{display:none}   /* атрибут hidden > наш display */
.sup-drop-zone{display:flex;align-items:center;gap:12px;width:100%;
  padding:14px 16px;border:1.5px dashed var(--line-strong);border-radius:var(--radius-sm);
  background:var(--surface-2);color:var(--muted);cursor:pointer;text-align:left;
  transition:border-color .2s var(--ease),background .2s var(--ease),color .2s var(--ease)}
.sup-drop-zone:hover,.sup-drop-zone:focus-visible{border-color:var(--accent);
  background:color-mix(in srgb,var(--accent) 7%,var(--surface));color:var(--ink-soft);outline:none}
.sup-drop.dragover .sup-drop-zone{border-color:var(--accent);border-style:solid;
  background:color-mix(in srgb,var(--accent) 12%,var(--surface));color:var(--accent-deep)}
.sup-drop-ico{flex:none;width:34px;height:34px;display:grid;place-items:center;
  border-radius:10px;background:color-mix(in srgb,var(--accent) 14%,transparent);color:var(--accent)}
.sup-drop-ico svg{width:19px;height:19px}
.sup-drop-txt{display:flex;flex-direction:column;gap:1px;line-height:1.3}
.sup-drop-txt strong{color:var(--ink-soft);font-weight:600;font-size:.92rem}
.sup-drop-txt span{font-size:.78rem}
.sup-drop-txt kbd{font:600 .72rem/1 'JetBrains Mono', monospace;padding:1px 5px;border-radius:5px;
  background:var(--surface-hi);border:1px solid var(--line);color:var(--ink-soft)}
.sup-drop-preview{position:relative;margin-top:10px;display:inline-block;
  border-radius:var(--radius-sm);overflow:hidden;border:1px solid var(--line);
  box-shadow:var(--shadow-sm);animation:supRise .25s var(--ease)}
.sup-drop-preview img{display:block;max-width:100%;max-height:190px;object-fit:contain}
.sup-drop-remove{position:absolute;top:7px;right:7px;width:26px;height:26px;
  display:grid;place-items:center;border:none;border-radius:50%;cursor:pointer;
  background:color-mix(in srgb,var(--ink) 72%,transparent);color:#fff;font-size:14px;
  line-height:1;transition:background .2s var(--ease),transform .2s var(--ease)}
.sup-drop-remove:hover{background:var(--down);transform:scale(1.08)}
.sup-drop-name{margin-top:6px;font-size:.78rem;color:var(--muted);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* — номер обращения — */
.sup-num{font:600 .8rem/1 'JetBrains Mono', monospace;color:var(--accent-deep);
  background:color-mix(in srgb,var(--accent) 11%,transparent);
  padding:3px 8px;border-radius:7px;letter-spacing:.01em;white-space:nowrap}
.sup-num-lg{font-size:.95rem;padding:4px 10px}

/* — статус-чип (тема-aware) — */
.sup-chip{display:inline-flex;align-items:center;gap:6px;font-size:.76rem;font-weight:600;
  padding:3px 11px;border-radius:100px;white-space:nowrap;line-height:1.5}
.sup-chip::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor}
.sup-new{color:var(--accent-deep);background:color-mix(in srgb,var(--accent) 14%,transparent)}
.sup-open{color:var(--mid);background:color-mix(in srgb,var(--mid-base) 20%,transparent)}
.sup-resolved{color:var(--up);background:var(--up-soft)}
.theme-dark .sup-new{color:var(--accent-bright)}

/* — список «Мои обращения» — */
.sup-list{list-style:none;padding:0;margin:14px 0 0;display:flex;flex-direction:column;gap:10px}
.sup-list-item a{display:flex;align-items:center;gap:12px;text-decoration:none;color:var(--ink);
  padding:14px 16px;border:1px solid var(--line);border-radius:var(--radius);
  background:var(--surface);transition:transform .25s var(--ease),
  border-color .25s var(--ease),box-shadow .25s var(--ease)}
.sup-list-item a:hover{transform:translateY(-1px);border-color:color-mix(in srgb,var(--accent) 40%,var(--line));
  box-shadow:var(--shadow-sm)}
.sup-li-main{display:flex;flex-direction:column;gap:5px;min-width:0;flex:1}
.sup-li-top{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.sup-li-subj{font-weight:600;font-size:.98rem;overflow:hidden;text-overflow:ellipsis;
  white-space:nowrap;max-width:100%}
.sup-li-meta{font-size:.8rem;color:var(--muted)}
.sup-li-item.unread .sup-li-subj{font-weight:700}
.sup-dot{flex:none;width:8px;height:8px;border-radius:50%;background:var(--accent);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 22%,transparent)}
.sup-list-item .sup-chevron{flex:none;color:var(--faint)}

/* — тред сообщений — */
.sup-thread{display:flex;flex-direction:column;gap:12px;margin:16px 0}
.sup-msg{max-width:82%;padding:11px 14px;border-radius:16px;position:relative}
.sup-user{align-self:flex-start;background:var(--surface-2);border:1px solid var(--line);
  border-bottom-left-radius:5px}
.sup-admin{align-self:flex-end;
  background:color-mix(in srgb,var(--accent) 13%,var(--surface));
  border:1px solid color-mix(in srgb,var(--accent) 25%,var(--line));border-bottom-right-radius:5px}
.sup-msg-meta{font-size:.72rem;color:var(--muted);margin-bottom:5px;font-weight:600;
  letter-spacing:.01em}
.sup-msg-body{font-size:.94rem;line-height:1.5;white-space:pre-wrap;word-break:break-word}
.sup-attach{display:inline-block;margin-top:8px}
.sup-attach img{max-width:240px;max-height:200px;border-radius:10px;display:block;
  border:1px solid var(--line);cursor:zoom-in;transition:transform .2s var(--ease)}
.sup-attach img:hover{transform:scale(1.02)}
.sup-empty{color:var(--muted);text-align:center;padding:22px}

/* — форма ответа — */
.sup-reply{display:flex;flex-direction:column;gap:10px;margin-top:16px;
  padding-top:16px;border-top:1px solid var(--line)}
.sup-reply .sup-reply-actions{display:flex;justify-content:flex-end}
.sup-reply-actions .btn{width:auto;margin:0}

/* — тред-хедер (номер + тема + статус) — */
.sup-head{display:flex;align-items:center;gap:11px;flex-wrap:wrap;margin:2px 0 4px}
.sup-head h1{margin:0;font-size:1.4rem;letter-spacing:-.015em}
.sup-back{display:inline-flex;align-items:center;gap:5px;color:var(--muted);
  text-decoration:none;font-size:.88rem;margin-bottom:6px}
.sup-back:hover{color:var(--accent)}

/* — фильтры (админка) — */
.sup-filters{display:flex;gap:7px;margin-bottom:16px;flex-wrap:wrap}
.sup-filters a{padding:6px 14px;border-radius:100px;text-decoration:none;font-size:.85rem;
  font-weight:500;color:var(--muted);border:1px solid var(--line);background:var(--surface);
  transition:all .2s var(--ease)}
.sup-filters a:hover{color:var(--ink);border-color:var(--line-strong)}
.sup-filters a.on{color:#fff;background:var(--accent);border-color:var(--accent)}

/* — админ-мета + статус-форма — */
.sup-meta{font-size:.85rem;line-height:1.7;margin:8px 0 14px}
.sup-meta b{color:var(--ink-soft)}
.sup-status-form{display:flex;align-items:center;gap:9px;flex-wrap:wrap;
  padding:12px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);margin-bottom:6px}
.sup-status-form .sup-sf-label{margin-right:auto;font-size:.85rem;color:var(--muted)}
.sup-status-form .btn-ghost{width:auto;margin:0}

/* — админ-таблица: непрочитанные строки — */
.admintable tr.row-unread td{background:color-mix(in srgb,var(--accent) 6%,transparent)}
.admintable tr.row-unread .sup-li-subj,.row-unread a{font-weight:700}
/* — кликабельная строка целиком — */
.admintable tr.sup-row{cursor:pointer;transition:background .18s var(--ease)}
.admintable tr.sup-row:hover td{background:color-mix(in srgb,var(--accent) 9%,transparent)}

/* — привязанный магазин в админ-таблице — */
.bound-shop{display:inline-flex;align-items:center;gap:5px;font-weight:600;color:var(--accent-deep);
  background:color-mix(in srgb,var(--accent) 11%,transparent);padding:2px 9px;border-radius:8px}
.theme-dark .bound-shop{color:var(--accent-bright)}
.bound-shop .bound-ic{font-size:.85em;filter:grayscale(.15)}

/* — бейдж в навигации — */
.nav-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;
  height:18px;padding:0 5px;border-radius:100px;background:var(--accent);color:#fff;
  font:700 .68rem/1 inherit;vertical-align:middle;margin-left:3px}

@keyframes supFade{from{opacity:0}to{opacity:1}}
@keyframes supRise{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}

/* ═══════════════ Подсказка «дозаполните профиль» ═══════════════ */
.setup-banner{margin-bottom:1.4rem;padding:1.05rem 1.15rem 1.1rem;border-radius:var(--radius);
  background:linear-gradient(115deg,color-mix(in srgb,var(--accent) 9%,var(--surface)),
    color-mix(in srgb,var(--cyan) 5%,var(--surface)));
  box-shadow:0 0 0 1px color-mix(in srgb,var(--accent) 20%,transparent),
    0 6px 18px -8px color-mix(in srgb,var(--accent) 24%,transparent),0 1px 3px rgba(0,0,0,.04);
  animation:supRise .4s var(--ease) both;overflow:hidden;
  transition:height .25s var(--ease),opacity .25s var(--ease),margin .25s var(--ease),padding .25s var(--ease)}
.setup-banner.setup-hiding{opacity:0;height:0!important;margin:0;padding-top:0;padding-bottom:0}
.setup-head{display:flex;align-items:flex-start;gap:.75rem}
.setup-ic{flex:none;width:36px;height:36px;display:grid;place-items:center;border-radius:11px;
  background:color-mix(in srgb,var(--accent) 16%,transparent);color:var(--accent)}
.setup-ic svg{width:20px;height:20px}
.setup-head-txt{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1;padding-top:1px}
.setup-head-txt strong{font-family:'Clash Display',sans-serif;font-weight:600;font-size:1.02rem;
  letter-spacing:-.01em;color:var(--ink)}
.setup-head-txt span{font-size:.85rem;color:var(--muted);line-height:1.4}
.setup-close{flex:none;width:28px;height:28px;display:grid;place-items:center;border:none;
  border-radius:9px;background:transparent;color:var(--faint);font-size:20px;line-height:1;
  cursor:pointer;transition:background .18s var(--ease),color .18s var(--ease)}
.setup-close:hover{background:color-mix(in srgb,var(--ink) 8%,transparent);color:var(--ink-soft)}
.setup-tasks{display:flex;gap:10px;margin-top:.9rem;flex-wrap:wrap}
.setup-task{flex:1 1 240px;display:flex;align-items:center;gap:11px;text-decoration:none;
  padding:11px 13px;border-radius:var(--radius-sm);background:var(--surface);
  border:1px solid var(--line);color:var(--ink);
  transition:transform .22s var(--ease),border-color .22s var(--ease),box-shadow .22s var(--ease)}
.setup-task:hover{transform:translateY(-1px);
  border-color:color-mix(in srgb,var(--accent) 45%,var(--line));box-shadow:var(--shadow-sm)}
.setup-task-ic{flex:none;width:34px;height:34px;display:grid;place-items:center;border-radius:10px;
  background:color-mix(in srgb,var(--accent) 12%,transparent);color:var(--accent)}
.setup-task-ic svg{width:18px;height:18px}
.setup-task-txt{display:flex;flex-direction:column;gap:1px;min-width:0;flex:1;line-height:1.3}
.setup-task-txt strong{font-weight:600;font-size:.93rem}
.setup-task-txt span{font-size:.78rem;color:var(--muted)}
.setup-task-cta{flex:none;font-size:.82rem;font-weight:600;color:var(--accent);white-space:nowrap}
@media (max-width:560px){.setup-tasks{flex-direction:column}.setup-task{flex:1 1 auto}}
@media (prefers-reduced-motion:reduce){
  .setup-banner,.setup-task{animation:none;transition:none}}
@media (prefers-reduced-motion:reduce){
  .support-fab,.sup-list-item a,.sup-attach img,.sup-drop-remove{transition:none}
  .support-modal.on,.support-modal-card,.sup-drop-preview{animation:none}
}
/* пометка «данные собираются» в строке таблицы */
.collecting-badge{display:inline-block;margin-left:8px;padding:1px 8px;border-radius:9px;
  font-size:11px;line-height:1.5;background:var(--chip-bg,#eef1f4);color:var(--muted,#7a828c);
  white-space:nowrap;vertical-align:middle}
.collecting-note{margin:4px 0 14px}
/* пагинатор таблицы города */
.pager{display:flex;align-items:center;justify-content:center;gap:14px;padding:14px 0 4px}
.pager-btn{padding:6px 14px;border-radius:8px;border:1px solid var(--border,#dfe3e8);
  color:var(--text,#2c3138);text-decoration:none;font-size:13px;background:var(--card,#fff)}
.pager-btn:hover{border-color:var(--accent,#c04a6e)}
.pager-btn.disabled{opacity:.4;pointer-events:none}
.pager-info{font-size:13px;color:var(--muted,#7a828c)}
