/* RxW — дизайн-система кабинета.
   Тёмная база, золотой акцент, боковая навигация, плотная сетка под данные.
   Отступы по шкале 4/8/12/16/24/32/48/64, кегли 12/14/16/18/20/24/30/36. */

:root {
    /* Серые с холодным подтоном: тёмное не выглядит грязным */
    --bg:          hsl(222 17% 11%);
    --bg-2:        hsl(222 16% 13%);
    --surface:     hsl(221 15% 15%);
    --surface-2:   hsl(221 14% 18%);
    --surface-3:   hsl(221 13% 22%);
    --border:      hsl(221 12% 25%);
    --border-soft: hsl(221 12% 20%);

    --font-display: "Segoe UI Variable Display", "SF Pro Display", -apple-system,
                    BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

    /* Три уровня текста — больше не нужно */
    --text:        hsl(220 24% 96%);
    --text-2:      hsl(220 14% 72%);
    --text-3:      hsl(220 11% 53%);

    /* Золото = деньги и премиальность. Единственный акцент. */
    --gold:        hsl(42 96% 62%);
    --gold-2:      hsl(36 92% 54%);
    --gold-dim:    hsl(42 58% 44%);
    --gold-bg:     hsl(42 92% 58% / 0.11);
    --gold-edge:   hsl(42 92% 58% / 0.30);
    --gold-glow:   hsl(42 96% 60% / 0.28);

    --green:       hsl(152 62% 50%);
    --green-bg:    hsl(152 62% 50% / 0.13);
    --red:         hsl(2 74% 63%);
    --red-bg:      hsl(2 74% 63% / 0.13);
    --blue:        hsl(208 90% 66%);
    --blue-bg:     hsl(208 90% 66% / 0.13);
    --violet:      hsl(268 78% 70%);
    --violet-bg:   hsl(268 78% 70% / 0.13);

    /* Тени двухчастные: мягкий свет сверху + плотная тень контакта */
    --sh-sm: 0 1px 2px hsl(226 40% 2% / 0.55), 0 1px 1px hsl(226 40% 2% / 0.4);
    --sh-md: 0 10px 28px hsl(226 40% 2% / 0.5), 0 2px 5px hsl(226 40% 2% / 0.5);
    --sh-lg: 0 28px 64px hsl(226 40% 2% / 0.62), 0 4px 10px hsl(226 40% 2% / 0.55);

    --r-sm: 7px;
    --r-md: 11px;
    --r-lg: 16px;

    --side-w: 264px;
    --ease: cubic-bezier(0.22, 0.9, 0.3, 1);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI Variable Text", "SF Pro Text", -apple-system,
                 BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1, "lnum" 1; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: hsl(226 14% 24%); }

/* ═══ Каркас: боковое меню + полотно ═══════════════════════════════════════ */

.shell { display: flex; min-height: 100vh; }

.side {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--side-w);
    display: flex;
    flex-direction: column;
    padding: 20px 12px;
    background: linear-gradient(180deg, var(--bg-2), var(--bg));
    border-right: 1px solid var(--border-soft);
    z-index: 30;
}

.logo {
    display: flex;
    align-items: baseline;
    gap: 7px;
    padding: 0 12px 24px;
    font-size: 15px;
    font-weight: 650;
    letter-spacing: -0.01em;
}
.logo .x {
    color: var(--gold);
    font-weight: 500;
    animation: spin-x 9s linear infinite;
    display: inline-block;
}
@keyframes spin-x {
    0%, 82% { transform: rotate(0deg); }
    92%, 100% { transform: rotate(180deg); }
}

.nav-group { margin-bottom: 24px; }

.nav-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-3);
}
.nav-title .pip {
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 8px var(--gold-glow);
}
.nav-title.whisper .pip { background: var(--violet); box-shadow: 0 0 8px hsl(268 78% 70% / 0.5); }

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    margin-bottom: 2px;
    border-radius: var(--r-sm);
    color: var(--text-2);
    font-size: 13.5px;
    transition: color 200ms var(--ease), background 200ms var(--ease), transform 200ms var(--ease);
}
.nav-item svg { width: 16px; height: 16px; flex: none; opacity: 0.75; transition: opacity 200ms var(--ease); }
.nav-item:hover { color: var(--text); background: var(--surface-2); transform: translateX(2px); }
.nav-item:hover svg { opacity: 1; }

.nav-item.on {
    color: var(--text);
    background: linear-gradient(90deg, var(--gold-bg), transparent 70%);
    font-weight: 550;
}
.nav-item.on svg { opacity: 1; color: var(--gold); }
.nav-item.on::before {
    content: "";
    position: absolute;
    left: 0; top: 50%;
    width: 3px; height: 62%;
    background: var(--gold);
    border-radius: 0 3px 3px 0;
    box-shadow: 0 0 10px var(--gold-glow);
    transform: translateY(-50%);
    animation: bar-in 260ms var(--ease);
}
@keyframes bar-in { from { height: 0; opacity: 0; } }

.nav-item .tail {
    margin-left: auto;
    font-size: 11.5px;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
}
.nav-item.on .tail { color: var(--gold); }

.side-foot { margin-top: auto; padding: 0 12px; }
.side-foot .exit {
    display: block;
    padding: 8px 0;
    font-size: 12.5px;
    color: var(--text-3);
    transition: color 180ms var(--ease);
}
.side-foot .exit:hover { color: var(--red); }

.main {
    flex: 1;
    margin-left: var(--side-w);
    min-width: 0;
    padding: 24px 32px 64px;
    background-image:
        radial-gradient(1100px 520px at 10% -10%, hsl(42 60% 30% / 0.07), transparent 62%),
        radial-gradient(800px 460px at 95% -4%, hsl(268 60% 40% / 0.06), transparent 64%);
}

/* ═══ Заголовок страницы ═══════════════════════════════════════════════════ */

.head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 24px; }
.head h1 { margin: 0; font-family: var(--font-display); font-size: 24px;
           font-weight: 600; letter-spacing: -0.024em; }
.head .sub { font-size: 13px; color: var(--text-3); padding-bottom: 3px; }
.head .spacer { flex: 1; }

/* ═══ Плитки показателей ═══════════════════════════════════════════════════ */

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}

.tile {
    position: relative;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-md);
    box-shadow: var(--sh-sm);
    overflow: hidden;
    transition: transform 240ms var(--ease), border-color 240ms var(--ease), box-shadow 240ms var(--ease);
    animation: rise 420ms var(--ease) backwards;
}
.tile:hover { transform: translateY(-2px); border-color: var(--surface-3); box-shadow: var(--sh-md); }
.tile .v { font-family: var(--font-display); font-size: 30px; font-weight: 600;
           line-height: 1.08; letter-spacing: -0.03em; }
.tile .k { margin-top: 3px; font-size: 12px; color: var(--text-3); }

.tile.accent { border-color: var(--gold-edge); }
.tile.accent::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(140deg, var(--gold-bg), transparent 62%);
    pointer-events: none;
}
.tile.accent .v { color: var(--gold); }
.tile.accent:hover { box-shadow: var(--sh-md), 0 0 0 1px var(--gold-edge); }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.tiles .tile:nth-child(1) { animation-delay: 0ms; }
.tiles .tile:nth-child(2) { animation-delay: 40ms; }
.tiles .tile:nth-child(3) { animation-delay: 80ms; }
.tiles .tile:nth-child(4) { animation-delay: 120ms; }
.tiles .tile:nth-child(5) { animation-delay: 160ms; }
.tiles .tile:nth-child(6) { animation-delay: 200ms; }

/* ═══ Панель управления списком ════════════════════════════════════════════ */

.controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }

.chips { display: flex; gap: 3px; padding: 4px; background: var(--surface); border-radius: var(--r-md); border: 1px solid var(--border-soft); }

.chip {
    position: relative;
    padding: 7px 13px;
    font-size: 13px;
    color: var(--text-2);
    border-radius: var(--r-sm);
    white-space: nowrap;
    transition: background 200ms var(--ease), color 200ms var(--ease);
}
.chip:hover { color: var(--text); background: var(--surface-2); }
.chip.on { background: var(--surface-3); color: var(--text); font-weight: 550; }
.chip .n { margin-left: 6px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.chip.on .n { color: var(--gold); }

.search {
    flex: 1; min-width: 200px; max-width: 320px;
    padding: 9px 14px;
    font: inherit; font-size: 13px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-sm);
    transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}
.search::placeholder { color: var(--text-3); }
.search:focus { outline: none; border-color: var(--gold-edge); box-shadow: 0 0 0 3px var(--gold-bg); }

/* ═══ Карточка и таблица ═══════════════════════════════════════════════════ */

.card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-md);
    overflow: hidden;
}

table { width: 100%; border-collapse: collapse; }

thead th {
    position: sticky; top: 0; z-index: 5;
    padding: 11px 16px;
    font-size: 10.5px; font-weight: 600;
    text-align: left; text-transform: uppercase; letter-spacing: 0.07em;
    color: var(--text-3);
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody td { padding: 11px 16px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }

tbody tr {
    transition: background 180ms var(--ease);
    animation: row-in 380ms var(--ease) backwards;
}
@keyframes row-in { from { opacity: 0; transform: translateY(4px); } }
tbody tr:nth-child(1) { animation-delay: 0ms; }
tbody tr:nth-child(2) { animation-delay: 18ms; }
tbody tr:nth-child(3) { animation-delay: 36ms; }
tbody tr:nth-child(4) { animation-delay: 54ms; }
tbody tr:nth-child(5) { animation-delay: 72ms; }
tbody tr:nth-child(6) { animation-delay: 90ms; }
tbody tr:nth-child(7) { animation-delay: 108ms; }
tbody tr:nth-child(8) { animation-delay: 126ms; }
tbody tr:nth-child(n+9) { animation-delay: 140ms; }

tbody tr:hover { background: var(--surface-2); }

/* Полоска слева выезжает при наведении, у горячего лида светится золотом */
tbody td:first-child { position: relative; }
tbody td:first-child::before {
    content: "";
    position: absolute; left: 0; top: 50%;
    width: 3px; height: 0;
    background: var(--surface-3);
    border-radius: 0 3px 3px 0;
    transform: translateY(-50%);
    transition: height 220ms var(--ease);
}
tbody tr:hover td:first-child::before { height: 68%; }
tbody tr.hot td:first-child::before {
    height: 68%;
    background: var(--gold);
    box-shadow: 0 0 10px var(--gold-glow);
}

.col-pick  { width: 42px; }
.col-score { width: 74px; }
.col-num   { width: 108px; text-align: right; }
.col-act   { width: 124px; text-align: right; }

.score {
    display: inline-block; min-width: 38px;
    padding: 4px 8px;
    font-size: 14.5px; font-weight: 650; text-align: center;
    color: var(--text-2);
    background: var(--surface-2);
    border-radius: var(--r-sm);
    font-variant-numeric: tabular-nums;
    transition: transform 200ms var(--ease);
}
tbody tr:hover .score { transform: scale(1.05); }
.score.hot {
    color: hsl(226 30% 8%);
    background: linear-gradient(135deg, var(--gold), var(--gold-2));
    box-shadow: 0 2px 10px var(--gold-glow);
}

.name { font-weight: 550; color: var(--text); }
.meta { margin-top: 1px; font-size: 11.5px; color: var(--text-3); }

.badge {
    display: inline-block;
    padding: 3px 9px;
    font-size: 11px; font-weight: 550;
    border-radius: 5px; white-space: nowrap;
}
.badge.channel { color: var(--blue);   background: var(--blue-bg); }
.badge.group   { color: var(--green);  background: var(--green-bg); }
.badge.none    { color: var(--text-3); background: var(--surface-2); }
.badge.queued  { color: var(--gold);   background: var(--gold-bg); }
.badge.wait    { color: var(--violet); background: var(--violet-bg); }

.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 7px; vertical-align: middle; }
.dot.alive { background: var(--green); box-shadow: 0 0 0 0 hsl(152 62% 50% / 0.6); animation: pulse 2.4s infinite; }
.dot.dead  { background: var(--red); }
.dot.unk   { background: var(--text-3); }
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 hsl(152 62% 50% / 0.55); }
    70%  { box-shadow: 0 0 0 6px hsl(152 62% 50% / 0); }
    100% { box-shadow: 0 0 0 0 hsl(152 62% 50% / 0); }
}

.online { color: var(--green); font-size: 11.5px; }

.links { display: flex; gap: 5px; justify-content: flex-end; }
.links a {
    display: inline-flex; align-items: center; justify-content: center;
    width: 27px; height: 27px;
    font-size: 10.5px; font-weight: 650;
    color: var(--text-3);
    background: var(--surface-2);
    border-radius: var(--r-sm);
    transition: color 180ms var(--ease), background 180ms var(--ease), transform 180ms var(--ease);
}
.links a:hover { color: var(--gold); background: var(--surface-3); transform: translateY(-2px); }

/* Свой чекбокс — системный ломает тёмную тему */
.pick { position: relative; display: block; width: 18px; height: 18px; cursor: pointer; }
.pick input { position: absolute; opacity: 0; width: 0; height: 0; }
.pick span {
    position: absolute; inset: 0;
    background: var(--surface-2);
    border: 1px solid var(--surface-3);
    border-radius: 5px;
    transition: background 180ms var(--ease), border-color 180ms var(--ease), transform 140ms var(--ease);
}
.pick:hover span { border-color: var(--gold-edge); }
.pick input:checked + span { background: var(--gold); border-color: var(--gold); transform: scale(1.06); }
.pick input:checked + span::after {
    content: "";
    position: absolute; left: 5px; top: 1px;
    width: 5px; height: 10px;
    border: solid hsl(226 30% 8%); border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ═══ Плавающая панель действий ════════════════════════════════════════════ */

.actionbar {
    position: sticky; bottom: 20px;
    display: flex; align-items: center; gap: 16px;
    margin-top: 20px; padding: 13px 20px;
    background: hsl(226 18% 13% / 0.92);
    backdrop-filter: blur(14px);
    border: 1px solid var(--surface-3);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-lg);
    transition: border-color 240ms var(--ease);
}
.actionbar.armed { border-color: var(--gold-edge); }
.actionbar .count { font-size: 13px; color: var(--text-2); }
.actionbar .count b { color: var(--gold); font-variant-numeric: tabular-nums; }
.actionbar .spacer { flex: 1; }

.btn {
    padding: 9px 18px;
    font: inherit; font-size: 13px; font-weight: 650;
    color: hsl(226 30% 8%);
    background: linear-gradient(135deg, var(--gold), var(--gold-2));
    border: none; border-radius: var(--r-sm);
    cursor: pointer;
    box-shadow: 0 2px 12px var(--gold-glow);
    transition: transform 130ms var(--ease), filter 200ms var(--ease), box-shadow 200ms var(--ease);
}
.btn:hover { filter: brightness(1.07); box-shadow: 0 4px 18px var(--gold-glow); }
.btn:active { transform: scale(0.97); }
.btn.quiet {
    color: var(--text-2);
    background: transparent;
    border: 1px solid var(--border);
    box-shadow: none;
}
.btn.quiet:hover { color: var(--text); background: var(--surface-3); }

/* ═══ Пустое состояние ═════════════════════════════════════════════════════ */

.empty { padding: 88px 32px; text-align: center; }
.empty .icon { font-size: 34px; opacity: 0.3; }
.empty h2 { margin: 14px 0 8px; font-size: 17px; font-weight: 600; }
.empty p { margin: 0 auto; max-width: 46ch; color: var(--text-3); }
.empty code { padding: 2px 6px; font-size: 12px; background: var(--surface-2); border-radius: 4px; }

/* ═══ Полоса заполнения (источники) ════════════════════════════════════════ */

.bar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.bar i {
    display: block; height: 100%;
    background: linear-gradient(90deg, var(--gold-dim), var(--gold));
    border-radius: 3px;
    animation: fill 700ms var(--ease) backwards;
}
@keyframes fill { from { width: 0 !important; } }

/* ═══ Вход ═════════════════════════════════════════════════════════════════ */

.login { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px;
         background-image: radial-gradient(700px 400px at 50% 0%, hsl(42 60% 30% / 0.1), transparent 60%); }
.login .card { width: 100%; max-width: 372px; padding: 32px; animation: rise 460ms var(--ease); }
.login h1 { margin: 0 0 4px; font-size: 19px; font-weight: 650; }
.login p { margin: 0 0 22px; font-size: 13px; color: var(--text-3); }
.login input {
    width: 100%; padding: 11px 14px; margin-bottom: 12px;
    font: inherit; font-size: 14px; color: var(--text);
    background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-sm);
    transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}
.login input:focus { outline: none; border-color: var(--gold-edge); box-shadow: 0 0 0 3px var(--gold-bg); }
.login .btn { width: 100%; padding: 11px; }
.login .err {
    margin-bottom: 12px; padding: 10px 12px;
    font-size: 13px; color: var(--red); background: var(--red-bg); border-radius: var(--r-sm);
    animation: shake 380ms var(--ease);
}
@keyframes shake {
    0%,100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ═══ Узкие экраны ═════════════════════════════════════════════════════════ */

@media (max-width: 1000px) {
    :root { --side-w: 64px; }
    .side { padding: 16px 8px; }
    .logo, .nav-title span, .nav-item span:not(.tail), .nav-item .tail, .side-foot .exit { display: none; }
    .nav-item { justify-content: center; padding: 11px 0; }
    .main { padding: 16px; }
    .col-num, thead .col-num { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ═══ Лиды, сгруппированные по источникам ══════════════════════════════════
   Блок на источник. Цвет блока — быстрый якорь для глаза: понятно, откуда
   лид, не читая подпись. Внутри блока лучшие лиды сверху. */

.srcgrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(370px, 1fr));
    gap: 14px;
}

.srcbox {
    --c: var(--text-2);
    --c-bg: var(--surface-2);
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-sm);
    overflow: hidden;
    transition: border-color 260ms var(--ease), box-shadow 260ms var(--ease), transform 260ms var(--ease);
    animation: rise 460ms var(--ease) backwards;
    animation-delay: calc(var(--i) * 55ms);
}
.srcbox:hover { border-color: var(--surface-3); box-shadow: var(--sh-md); transform: translateY(-2px); }

/* Цветная грань сверху — единственное место, где источник заявляет о себе */
.srcbox::before {
    content: "";
    height: 2px;
    background: linear-gradient(90deg, var(--c), transparent 78%);
}

.c-gold   { --c: hsl(42 96% 62%);  --c-bg: hsl(42 96% 62% / 0.13); }
.c-blue   { --c: hsl(208 90% 66%); --c-bg: hsl(208 90% 66% / 0.13); }
.c-green  { --c: hsl(152 62% 52%); --c-bg: hsl(152 62% 52% / 0.13); }
.c-violet { --c: hsl(268 78% 72%); --c-bg: hsl(268 78% 72% / 0.13); }
.c-orange { --c: hsl(22 92% 62%);  --c-bg: hsl(22 92% 62% / 0.13); }
.c-teal   { --c: hsl(178 70% 52%); --c-bg: hsl(178 70% 52% / 0.13); }
.c-pink   { --c: hsl(330 82% 68%); --c-bg: hsl(330 82% 68% / 0.13); }
.c-lime    { --c: hsl(88 62% 58%);  --c-bg: hsl(88 62% 58% / 0.13); }
.c-magenta { --c: hsl(300 72% 70%); --c-bg: hsl(300 72% 70% / 0.13); }
.c-grey   { --c: hsl(220 10% 52%); --c-bg: hsl(220 10% 52% / 0.13); }

.srchead { display: flex; align-items: center; gap: 11px; padding: 14px 16px 12px; }
.srchead .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--c);
    box-shadow: 0 0 12px var(--c);
    flex: none;
}
.srchead .who { min-width: 0; flex: 1; }
.srchead .nm { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.srchead .cap { font-size: 11px; color: var(--text-3); }
.srchead .stat { text-align: right; flex: none; }
.srchead .big { font-size: 20px; font-weight: 650; line-height: 1.1; color: var(--c); }

/* Полоска доли с телеграмом: источник без контактов бесполезен, и это видно сразу */
.srcmeter { position: relative; height: 20px; margin: 0 16px 10px; }
.srcmeter::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0;
    height: 3px; background: var(--surface-2); border-radius: 2px;
}
.srcmeter i {
    position: absolute; left: 0; top: 0;
    height: 3px; background: var(--c); border-radius: 2px;
    box-shadow: 0 0 8px var(--c);
    animation: fill 900ms var(--ease) backwards;
    animation-delay: calc(var(--i) * 55ms + 200ms);
}
.srcmeter .lbl { position: absolute; left: 0; top: 7px; font-size: 10.5px; color: var(--text-3); }

/* Список прокручивается внутри колонки, а не растягивает страницу вниз:
   у твиттера восемьдесят строк, у остальных десять — без этого страница
   становилась длиной в экран с лишним, а короткие колонки висели пустыми.
   Тени у краёв нарисованы фоном: слои local уезжают вместе с содержимым и
   открывают слои scroll, поэтому тень видна ровно тогда, когда есть что
   прокручивать, и гаснет на концах. Никакого JS. */
.srclist {
    display: flex; flex-direction: column;
    padding: 0 8px 8px;
    max-height: min(72vh, 900px);
    overflow-y: auto;
    overscroll-behavior: contain;   /* докрутил до края — страница не едет следом */
    scrollbar-width: thin;
    scrollbar-color: var(--surface-3) transparent;
    background:
        linear-gradient(var(--surface), transparent) top    / 100% 18px no-repeat local,
        linear-gradient(transparent, var(--surface)) bottom / 100% 18px no-repeat local,
        radial-gradient(farthest-side at 50% 0,    rgba(0,0,0,.42), transparent) top    / 100% 10px no-repeat scroll,
        radial-gradient(farthest-side at 50% 100%, rgba(0,0,0,.42), transparent) bottom / 100% 10px no-repeat scroll;
}
.srclist::-webkit-scrollbar { width: 10px; }
.srclist::-webkit-scrollbar-track { background: transparent; }
.srclist::-webkit-scrollbar-thumb {
    background: var(--surface-3);
    border: 3px solid transparent;      /* прозрачная рамка = зазор от края */
    background-clip: padding-box;
    border-radius: 6px;
    transition: background 160ms var(--ease);
}
.srcbox:hover .srclist::-webkit-scrollbar-thumb { background: var(--border); background-clip: padding-box; }
.srclist::-webkit-scrollbar-thumb:hover { background: var(--c); background-clip: padding-box; }

.lead {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 8px;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: background 160ms var(--ease);
}
.lead:hover { background: var(--surface-2); }
.lead input { position: absolute; opacity: 0; width: 0; height: 0; }

.lead .box {
    width: 16px; height: 16px; flex: none;
    background: var(--surface-2);
    border: 1px solid var(--surface-3);
    border-radius: 5px;
    position: relative;
    transition: background 160ms var(--ease), border-color 160ms var(--ease), transform 130ms var(--ease);
}
.lead:hover .box { border-color: var(--c); }
.lead input:checked + .box { background: var(--c); border-color: var(--c); transform: scale(1.08); }
.lead input:checked + .box::after {
    content: "";
    position: absolute; left: 4.5px; top: 1px;
    width: 4px; height: 9px;
    border: solid hsl(226 30% 8%); border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.lead input:focus-visible + .box { outline: 2px solid var(--c); outline-offset: 2px; }

.lead .sc { min-width: 34px; padding: 3px 6px; font-size: 12.5px; flex: none; }
.lead .txt { flex: 1; min-width: 0; }
.lead .t {
    display: block;
    font-size: 12.5px; font-weight: 550;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lead .m { display: block; font-size: 10.5px; color: var(--text-3); }
.lead .m b { color: var(--green); font-weight: 550; }

/* Строка выбранного лида подсвечивается цветом своего источника */
.lead:has(input:checked) { background: var(--c-bg); }

.lead .go {
    flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px;
    font-size: 10px; font-weight: 650;
    color: var(--text-3);
    background: var(--surface-2);
    border-radius: var(--r-sm);
    opacity: 0;
    transition: opacity 180ms var(--ease), color 180ms var(--ease), background 180ms var(--ease);
}
.lead:hover .go { opacity: 1; }
.lead .go:hover { color: var(--c); background: var(--surface-3); }

.srcmore {
    padding: 9px 16px 13px;
    font-size: 11px; color: var(--text-3);
    border-top: 1px solid var(--border-soft);
}

.actionbar .hint { font-size: 12px; color: var(--text-3); }

@media (max-width: 640px) {
    .srcgrid { grid-template-columns: 1fr; }
    .lead .go { opacity: 1; }
}

/* Название лида — ссылка на его телеграм; чекбокс живёт отдельно */
.lead .tick { display: flex; flex: none; cursor: pointer; }
.lead .txt { text-decoration: none; }
a.txt .t { transition: color 160ms var(--ease); }
a.txt:hover .t { color: var(--c); text-decoration: underline; text-underline-offset: 2px; }
.lead .ext { display: flex; gap: 4px; flex: none; opacity: 0; transition: opacity 180ms var(--ease); }
.lead:hover .ext { opacity: 1; }
.lead .ext a {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px;
    font-size: 10px; font-weight: 650;
    color: var(--text-3); background: var(--surface-2); border-radius: 6px;
    transition: color 160ms var(--ease), background 160ms var(--ease);
}
.lead .ext a:hover { color: var(--c); background: var(--surface-3); }
.lead:has(input:checked) { background: var(--c-bg); }
@media (max-width: 640px) { .lead .ext { opacity: 1; } }

/* ═══ Номер строки и закладка «проверено до сюда» ══════════════════════════ */

.lead .no {
    flex: none;
    width: 20px;
    font-size: 10.5px;
    color: var(--text-3);
    text-align: right;
    transition: opacity 160ms var(--ease);
}
.lead:hover .no { opacity: 0; }

/* Галочка встаёт на место номера — не раздвигая строку */
.lead .mark {
    position: absolute;
    left: 8px;
    width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
    padding: 0;
    font-size: 11px; font-family: inherit;
    color: var(--text-3);
    background: var(--surface-3);
    border: none; border-radius: 5px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 160ms var(--ease), color 160ms var(--ease), background 160ms var(--ease);
}
.lead { position: relative; }
.lead:hover .mark { opacity: 1; }
.lead .mark:hover { color: hsl(226 30% 8%); background: var(--c); }

/* Просмотренные тускнеют, но остаются доступными */


/* ═══ Номер строки — всегда видно; закладка ушла вправо ════════════════════ */

.lead .no {
    flex: none;
    width: 22px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
    text-align: right;
}
.lead:hover .no { opacity: 1; color: var(--c); }

.lead .mark {
    position: static;
    flex: none;
    width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
    padding: 0;
    font-size: 11px; font-family: inherit;
    color: var(--text-3);
    background: transparent;
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 160ms var(--ease), color 160ms var(--ease),
                background 160ms var(--ease), border-color 160ms var(--ease);
}
.lead:hover .mark { opacity: 1; }
.lead .mark:hover { color: hsl(226 30% 8%); background: var(--c); border-color: var(--c); }

/* ═══ Неделя карточками + всплывающий месяц ════════════════════════════════
   Работа идёт с последними днями, поэтому они всегда на виду. Остальные даты —
   за кнопкой: каждый день хранится отдельно и не перезаписывается. */









/* Выбранный день НЕ заливается золотом: белым по яркому золоту читать нельзя,
   контраст падает почти до единицы. Поэтому тёмная карточка с золотой гранью. */





/* Тонкая световая грань по верху — стекло ловит свет */



/* Ячеек-заполнителей нет: первое число само встаёт на свою колонку.
   Именно они раньше ломали строки и цифры наезжали друг на друга. */

@keyframes cell-in { from { opacity: 0; transform: scale(0.86); } }


/* День с лидами — светящаяся точка снизу */


/* Сегодня — приглушённый контур */

/* Выбранный — неоновый контур: свет снаружи и изнутри, без заливки */


/* Кнопка «Выбрать дату» в том же неоновом ключе */

@media (max-width: 1100px) {
            }

/* ── Календарь месяца: обычная таблица ─────────────────────────────────────
   CSS-сетку пришлось убрать: авто-раскладка разъезжалась и числа наезжали
   друг на друга. Таблица раскладывается браузером однозначно и сломаться
   не может — строки это <tr>, клетки это <td>. */





/* День с лидами — светящаяся точка снизу */


/* Сегодня — приглушённый контур */

/* Выбранный — неоновый контур: свет снаружи и изнутри, без заливки */

/* ── Календарь месяца ──────────────────────────────────────────────────────
   Ширина и высота клеток заданы прямо в разметке: инлайн-стиль сильнее любого
   правила из файла, поэтому сетка не разъедется из-за чужих стилей или кеша.
   Здесь остаётся только оформление. */



/* ── Календарь месяца ──────────────────────────────────────────────────────
   Намеренно простой: никаких свечений, анимаций и псевдо-элементов.
   Ровно те свойства, что нужны, — так нечему давать артефакты.
   Размеры клеток заданы в разметке, здесь только цвет. */




/* ══ Календарь-полоса с жидкой подсветкой ═════════════════════════════════
   Залит ровно один элемент — капля. Карточки прозрачные, у каждой своя
   подложка, которая гаснет под каплей. Поэтому подсветка не перерисовывается
   на новом месте, а физически переезжает. */

.cal {
    display: flex; align-items: stretch; gap: 10px;
    padding: 14px; margin-bottom: 24px;
    background: linear-gradient(180deg, var(--surface), hsl(221 15% 13%));
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    box-shadow: 0 22px 54px hsl(222 30% 3% / 0.36), inset 0 1px 0 hsl(0 0% 100% / 0.04);
}

.cal .nav {
    flex: none; width: 38px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-3); background: var(--surface-2);
    border: 1px solid var(--border-soft); border-radius: 12px;
    transition: color 180ms var(--ease), background 180ms var(--ease), transform 180ms var(--ease);
}
.cal .nav:hover { color: var(--text); background: var(--surface-3); }
.cal .nav:active { transform: scale(0.94); }
.cal .nav.off { opacity: 0.25; pointer-events: none; }
.cal .nav svg { width: 16px; height: 16px; }

.track { position: relative; flex: 1; display: flex; gap: 10px; min-width: 0; }

.blob {
    position: absolute; top: 0; left: 0; height: 100%;
    border-radius: 14px;
    background: linear-gradient(158deg, hsl(42 92% 69%), var(--gold) 40%, hsl(38 88% 54%));
    box-shadow: 0 8px 28px var(--gold-glow), 0 0 0 1px hsl(42 92% 58% / 0.5),
                inset 0 1px 0 hsl(0 0% 100% / 0.45);
    will-change: transform, width;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
/* Ореол под каплей — едет вместе с ней */
.blob::after {
    content: ""; position: absolute; inset: -14px; border-radius: 24px;
    background: radial-gradient(60% 70% at 50% 50%, var(--gold-glow), transparent 72%);
    filter: blur(10px); z-index: -1;
}
/* Блик пробегает по капле в момент приземления */
.blob i {
    position: absolute; top: 0; bottom: 0; width: 42%;
    background: linear-gradient(100deg, transparent, hsl(0 0% 100% / 0.5), transparent);
    transform: translateX(-160%);
    pointer-events: none;
}

.cday {
    position: relative; z-index: 1;
    flex: 1; min-width: 0;
    padding: 13px 14px 12px;
    background: transparent; border: none; border-radius: 14px;
    font: inherit; text-align: left; cursor: pointer;
    transition: transform 220ms var(--ease);
}
.cday::before {
    content: ""; position: absolute; inset: 0; border-radius: 14px; z-index: -1;
    background: var(--surface-2);
    box-shadow: inset 0 1px 0 hsl(0 0% 100% / 0.05);
    transition: opacity 280ms var(--ease), background 200ms var(--ease);
}
.cday:hover::before { background: var(--surface-3); }
.cday:hover { transform: translateY(-2px); }
.cday:active { transform: translateY(0); }

.cday .wd {
    display: block; font-size: 9.5px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-3);
    transition: color 260ms var(--ease);
}
.cday .dnum {
    display: block; margin-top: 3px;
    font-family: var(--font-display); font-size: 26px; font-weight: 600;
    line-height: 1; letter-spacing: -0.035em; color: var(--text);
    transition: color 260ms var(--ease), transform 420ms cubic-bezier(.34, 1.5, .5, 1);
}
.cday .cnt {
    display: block; margin-top: 5px; font-size: 11.5px; color: var(--text-2);
    transition: color 260ms var(--ease);
}
.cday .vol {
    display: block; margin-top: 9px; height: 3px; border-radius: 2px;
    background: hsl(0 0% 100% / 0.08); overflow: hidden;
}
.cday .vol i {
    display: block; height: 100%; border-radius: 2px;
    background: linear-gradient(90deg, var(--gold-dim), var(--gold));
    transition: background 260ms var(--ease);
}

.cday.today .wd { color: var(--gold); }
.cday.today::after {
    content: ""; position: absolute; top: 13px; right: 13px;
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--gold); box-shadow: 0 0 9px var(--gold-glow);
}

/* Выбранный: своя подложка гаснет, текст темнеет — под ним капля */
.cday.on::before { opacity: 0; }
.cday.on .wd { color: hsl(38 80% 12% / 0.62); }
.cday.on .dnum { color: hsl(38 80% 8%); transform: scale(1.06); }
.cday.on .cnt { color: hsl(38 80% 12% / 0.78); }
.cday.on .vol { background: hsl(38 80% 12% / 0.2); }
.cday.on .vol i { background: hsl(38 80% 12% / 0.55); }
.cday.on::after { background: hsl(38 80% 8%); box-shadow: none; }
.cday.on:hover { transform: none; }

.cday.empty .cnt { color: var(--text-3); }
.cday.empty .vol i { background: hsl(0 0% 100% / 0.12); }

@media (prefers-reduced-motion: reduce) {
    .blob { transition: none !important; }
}

/* Закладка: черта на месте, где владелец остановился.
   Ничего не прячет и не двигает — только отмечает позицию. */
.bookmark {
    display: flex; align-items: center; gap: 9px;
    margin: 6px 8px 2px;
    font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.07em;
    color: var(--c);
    white-space: nowrap;
}
.bookmark::before, .bookmark::after {
    content: ""; flex: 1; height: 1px;
    background: linear-gradient(90deg, transparent, var(--c), transparent);
    opacity: 0.55;
}

/* Отметка не ушла на сервер — видно сразу, а не после перезагрузки */
.lead.unsaved { box-shadow: inset 2px 0 0 var(--red); }


/* ═══ Страница источников ══════════════════════════════════════════════════
   Строка на источник вместо таблицы: цифр много, и в ячейках они сливались.
   Цвет строки повторяет цвет источника на странице лидов — глаз связывает их
   между собой без чтения названий. */

.health {
    display: flex; align-items: center; gap: 9px;
    padding: 8px 15px;
    font-size: 12.5px; font-weight: 600;
    color: var(--green);
    background: var(--green-bg);
    border: 1px solid hsl(152 62% 50% / 0.24);
    border-radius: 99px;
}
.health.bad {
    color: var(--red); background: var(--red-bg);
    border-color: hsl(2 74% 63% / 0.28);
}
.health i { font-style: normal; font-weight: 400; opacity: 0.6; }
.health .beat {
    width: 7px; height: 7px; border-radius: 50%; flex: none;
    background: currentColor;
    animation: beat-ring 2.2s ease-out infinite;
}
@keyframes beat-ring {
    0%   { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
    70%  { box-shadow: 0 0 0 7px transparent; opacity: 0.75; }
    100% { box-shadow: 0 0 0 0 transparent; opacity: 1; }
}

.srcboard { display: flex; flex-direction: column; gap: 10px; }

.srow {
    --c: var(--text-2);
    display: grid;
    grid-template-columns: 1.5fr 1.1fr 0.9fr 0.7fr 0.7fr 1.6fr 1fr;
    align-items: center;
    gap: 18px;
    padding: 16px 20px;
    background: linear-gradient(180deg, var(--surface), hsl(221 15% 13.5%));
    border: 1px solid var(--border-soft);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-sm);
    transition: transform 260ms var(--ease), border-color 240ms var(--ease),
                box-shadow 260ms var(--ease);
    animation: rise 440ms var(--ease) backwards;
    animation-delay: calc(var(--i) * 60ms);
    position: relative;
    overflow: hidden;
}
/* Цветная грань источника слева */
.srow::before {
    content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
    background: var(--c);
    opacity: 0.7;
}
.srow:hover {
    transform: translateY(-2px);
    border-color: var(--border);
    box-shadow: var(--sh-md), 0 0 26px hsl(0 0% 0% / 0.28);
}
.srow:hover::before { opacity: 1; box-shadow: 0 0 14px var(--c); }

/* Источник в беде — красная грань и лёгкое свечение */
.srow.alarm { border-color: hsl(2 74% 63% / 0.32); }
.srow.alarm::before { background: var(--red); opacity: 1; }
.srow.alarm::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(90deg, hsl(2 74% 63% / 0.07), transparent 42%);
}

.srow .col { min-width: 0; }
.srow .who { display: flex; align-items: center; gap: 12px; }
.srow .pip {
    width: 9px; height: 9px; border-radius: 50%; flex: none;
    background: var(--c); box-shadow: 0 0 12px var(--c);
}
.srow .nm { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.srow .cap { font-size: 11px; color: var(--text-3); margin-top: 1px; }

.srow .figure { text-align: right; }
.srow .big {
    font-family: var(--font-display);
    font-size: 21px; font-weight: 600; line-height: 1.1; letter-spacing: -0.03em;
}
.srow .figure .cap { text-align: right; }

.srow .bars { display: flex; flex-direction: column; gap: 3px; }
.barlabel {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: 10px; color: var(--text-3);
}
.barlabel b { color: var(--text-2); font-weight: 600; }
.barlabel.dim { margin-top: 5px; opacity: 0.75; }
.srow .bar { height: 5px; background: hsl(0 0% 100% / 0.07); border-radius: 3px; overflow: hidden; }
.srow .bar.thin { height: 3px; }
.srow .bar i {
    display: block; height: 100%; border-radius: 3px;
    background: linear-gradient(90deg, var(--c), var(--c));
    filter: saturate(1.1);
    transform-origin: left;
    animation: fill-bar 900ms var(--ease) backwards;
    animation-delay: calc(var(--i) * 60ms + 180ms);
}
@keyframes fill-bar { from { transform: scaleX(0); } }

.srow .meta { font-size: 11px; color: var(--text-3); line-height: 1.7; text-align: right; }
.srow .meta b { color: var(--text-2); font-weight: 600; }
.srow .meta .err { color: var(--red); }
.srow .meta .err b { color: var(--red); }

/* Состояние источника */
.state {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 12.5px; font-weight: 600;
}
.state i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.state.работает { color: var(--green); }
.state.работает i {
    background: var(--green);
    animation: beat-ring 2.4s ease-out infinite;
}
.state.молчит { color: hsl(38 92% 62%); }
.state.молчит i { background: hsl(38 92% 62%); box-shadow: 0 0 9px hsl(38 92% 62% / 0.5); }
.state.сбой { color: var(--red); }
.state.сбой i { background: var(--red); animation: beat-ring 1.4s ease-out infinite; }
.state.тихо { color: var(--text-3); }
.state.тихо i { background: var(--text-3); }

.howto { padding: 20px 24px; margin-top: 16px; }
.howto .nm { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.howto p { margin: 0 0 8px; max-width: 84ch; color: var(--text-3); font-size: 13px; }
.howto p:last-child { margin-bottom: 0; }
.howto b { color: var(--text-2); font-weight: 600; }

@media (max-width: 1300px) {
    .srow { grid-template-columns: 1.4fr 1fr 0.8fr 0.7fr 1.4fr; gap: 14px; }
    .srow .meta { display: none; }
}
@media (max-width: 900px) {
    .srow { grid-template-columns: 1fr 1fr; gap: 12px; }
    .srow .bars { grid-column: 1 / -1; }
}
