:root {
  --bg: #080b22;
  --card: #0f1431;
  --card-2: #141a3d;
  --panel: #161d45;
  --line: #1e2652;
  --line-2: #2a3466;
  --ink: #f3f5ff;
  --muted: #7d86ae;
  --blue: #7f90f5;
  --blue-dim: #3c4687;
  --yellow: #f6b83f;
  --yellow-dim: #7a5d2c;
  --neg: #ff6b7b;
  --radius: 22px;
  --head: "Unbounded", "Montserrat", "Segoe UI", sans-serif;
  --body: "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: dark; }
body {
  margin: 0; color: var(--ink); font: 15px/1.5 var(--body); -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(127,144,245,.10), transparent 60%),
    radial-gradient(700px 400px at -5% 0%, rgba(246,184,63,.05), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; }

.pos { color: var(--blue); }
.neg { color: var(--neg); }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.mono { font-family: var(--mono); }
.eyebrow { font: 500 13px/1 var(--mono); letter-spacing: .28em; text-transform: uppercase; color: var(--blue); }
.label { font: 500 12px/1 var(--mono); letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }

/* Навигация */
.top { border-bottom: 1px solid var(--line); background: rgba(8,11,34,.7); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 5; }
.top-in { max-width: 1180px; margin: 0 auto; padding: 0 24px; height: 58px; display: flex; align-items: center; gap: 26px; }
.brand { display: flex; align-items: center; gap: 10px; font: 600 13px var(--head); letter-spacing: .02em; }
.brand i { width: 24px; height: 24px; border-radius: 8px; background: linear-gradient(135deg, var(--yellow), var(--blue)); display: grid; place-items: center; }
.brand svg { width: 14px; height: 14px; stroke: var(--bg); }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { padding: 7px 14px; border-radius: 99px; color: var(--muted); font-size: 14px; transition: .15s; }
.nav a:hover { color: var(--ink); }
.nav a.on { color: var(--ink); background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.who { display: flex; align-items: center; gap: 14px; color: var(--muted); }
.who b { color: var(--ink); font-weight: 500; }

main { max-width: 1180px; margin: 0 auto; padding: 36px 24px 90px; }

/* Шапка страницы */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; flex-wrap: wrap; }
.hero h1 { font: 700 clamp(30px, 5.2vw, 54px)/1.05 var(--head); letter-spacing: -.02em; margin-top: 18px; }
.hero-r { text-align: right; }
.hero-r .when { font: 700 28px/1.2 var(--head); margin: 10px 0 6px; text-transform: capitalize; }
.hero-r .sub { color: var(--muted); font-size: 14px; }
.month { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; }
.month button { width: 34px; height: 34px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--card); cursor: pointer; color: var(--muted); font-size: 17px; line-height: 1; transition: .15s; }
.month button:hover { color: var(--ink); border-color: var(--blue); }
.rule { height: 4px; border-radius: 4px; margin: 26px 0 24px; background: linear-gradient(90deg, var(--yellow) 0 6.5%, var(--blue) 6.5% 100%); }

/* Полоса «Главное» */
.ticker { display: flex; align-items: center; gap: 22px; border: 1px solid var(--line-2); background: var(--card); border-radius: 99px; padding: 10px 12px; overflow-x: auto; scrollbar-width: none; }
.ticker::-webkit-scrollbar { display: none; }
.pill { flex: none; font: 700 12px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; background: var(--yellow); color: #1a1405; padding: 10px 16px; border-radius: 99px; }
.tick { flex: none; white-space: nowrap; color: var(--muted); }
.tick b { color: var(--ink); font-weight: 600; }
.tick em { font: normal 600 14px var(--mono); color: var(--blue); margin-left: 6px; }
.tick em.y { color: var(--yellow); }

/* Секции */
.sec { margin-top: 44px; }
.sec-h { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; margin-bottom: 18px; flex-wrap: wrap; }
.sec-h h2 { font: 600 20px/1.2 var(--body); display: flex; align-items: center; gap: 12px; }
.sec-h h2::before { content: ""; width: 11px; height: 11px; background: var(--yellow); transform: rotate(45deg); border-radius: 2px; flex: none; }
.sec-h p { margin: 0; color: var(--muted); font-size: 14px; max-width: 520px; text-align: right; }

.box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.box h3 { font: 600 17px var(--body); }
.box .hint { color: var(--muted); font: 13px/1.4 var(--mono); margin-top: 8px; }

/* KPI-панель */
.kpi-panel { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; }
.kpi { padding: 24px 24px 22px; border-left: 1px solid var(--line); min-width: 0; container-type: inline-size; }
.kpi:first-child { border-left: 0; }
.kpi .v {
  font: 700 clamp(13px, calc(100cqw / (var(--n, 9) * .8)), 34px)/1.1 var(--head); letter-spacing: -.02em;
  margin: 16px 0 2px; white-space: nowrap; overflow: hidden;
}

/* Карточки лидеров */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.lead { position: relative; background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 26px 26px 22px; cursor: pointer; transition: .2s; overflow: hidden; }
.lead::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--yellow) 0 16%, var(--blue) 16% 100%); }
.lead:hover { transform: translateY(-2px); border-color: var(--blue); }
.lead-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.lead-top .pill { padding: 9px 14px; }
.lead-top .meta { font: 13px var(--mono); color: var(--muted); letter-spacing: .06em; }
.lead h3 { font: 700 30px/1.15 var(--head); letter-spacing: -.02em; margin: 22px 0 6px; overflow-wrap: anywhere; }
.lead .about { color: var(--muted); }
.trio { display: grid; gap: 0; margin: 22px 0 14px; background: var(--card-2); border: 1px solid var(--line); border-radius: 16px; }
.trio > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); min-width: 0; }
.trio > div:first-child { border-top: 0; }
.trio b { font: 700 17px/1.2 var(--head); letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.days3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.days3 > div { background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.days3 .label { display: block; margin-bottom: 8px; }
.days3 b { font: 600 14px var(--mono); white-space: nowrap; display: block; overflow: hidden; text-overflow: ellipsis; }

/* Рейтинги */
.rank-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.rank { margin-top: 14px; display: grid; gap: 2px; }
.rk2 { display: grid; grid-template-columns: 24px 1fr auto; column-gap: 10px; row-gap: 7px; align-items: baseline; padding: 11px 10px; border-radius: 12px; cursor: pointer; }
.rk2:hover, .rk2.me { background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.rk2 .n { color: var(--muted); font: 14px var(--mono); text-align: right; }
.rk2 .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.rk2 .vl { font: 500 14px var(--mono); white-space: nowrap; }
.rk2 .vl.neg { color: var(--neg); }
.rk2 .tr { grid-column: 2 / 4; height: 8px; border-radius: 99px; background: rgba(255,255,255,.04); }
.rk2 .fl { height: 100%; border-radius: 99px; min-width: 3px; background: var(--blue-dim); }
.rk2.y .fl { background: var(--yellow-dim); }
.rank.solo .rk2 .fl, .rk2.me .fl { background: var(--blue); }
.rank.solo .rk2.y .fl, .rk2.y.me .fl { background: var(--yellow); }

/* График */
.chart-wrap { position: relative; margin-top: 6px; }
.chart { width: 100%; height: auto; display: block; overflow: visible; touch-action: pan-y; }
.chart .band { fill: transparent; } .chart .band.odd { fill: rgba(127,144,245,.035); }
.chart .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 5; }
.chart .zero { stroke: var(--line-2); stroke-width: 1.2; }
.chart text { fill: var(--muted); font: 11px var(--mono); }
.chart .xl { fill: #4f5890; } .chart .xl.on { fill: var(--muted); }
.chart .hl { fill: rgba(127,144,245,.13); }
.chart .ln { fill: none; stroke: var(--blue); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--card); stroke-width: 2.4; }
.chart .dot.p { stroke: var(--blue); } .chart .dot.n { stroke: var(--neg); }
.chart .halo { fill: rgba(246,184,63,.22); stroke: var(--yellow); stroke-width: 1.6; }
.tip { position: absolute; z-index: 3; pointer-events: none; min-width: 168px; background: #0b1030; border: 1px solid var(--line-2); border-radius: 12px; padding: 11px 13px; box-shadow: 0 10px 30px rgba(0,0,0,.45); opacity: 0; transition: opacity .12s; }
.tip.on { opacity: 1; }
.tip-d { font: 12px var(--mono); color: var(--muted); text-transform: capitalize; margin-bottom: 6px; }
.tip-p { font: 700 16px var(--head); margin-bottom: 8px; }
.tip-r { display: flex; justify-content: space-between; gap: 18px; font-size: 13px; color: var(--muted); }
.tip-r b { color: var(--ink); font: 500 13px var(--mono); }
.tip-n { color: var(--muted); font-size: 13px; }

/* Таблицы */
.tbl { width: 100%; border-collapse: collapse; margin-top: 8px; }
.tbl th { text-align: left; font: 500 12px var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); padding: 0 12px 14px; }
.tbl th.num { text-align: right; }
.tbl td { padding: 14px 12px; border-top: 1px solid var(--line); }
.tbl tbody tr.link { cursor: pointer; }
.tbl tbody tr.link:hover td { background: var(--card-2); }
.tbl tfoot td { font-weight: 600; border-top: 1px solid var(--line-2); }
.scroll { overflow-x: auto; margin: 0 -12px; }
.me-tag { font: 11px var(--mono); letter-spacing: .12em; color: var(--yellow); border: 1px solid var(--yellow-dim); border-radius: 99px; padding: 2px 8px; margin-left: 8px; text-transform: uppercase; }
.tabs { display: inline-flex; background: var(--card-2); border: 1px solid var(--line); border-radius: 99px; padding: 3px; }
.tabs button { border: 0; background: none; padding: 7px 16px; border-radius: 99px; cursor: pointer; color: var(--muted); font-size: 14px; }
.tabs button.on { background: var(--blue); color: #0a0d24; font-weight: 600; }

/* Форма ввода и кнопки */
.entry { display: grid; grid-template-columns: 1.1fr 1fr 1fr 1fr 1fr auto; gap: 14px; align-items: end; border-color: var(--line-2); }
.field label { display: block; margin-bottom: 9px; font: 500 12px var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.field input, .field select { width: 100%; height: 46px; padding: 0 14px; background: var(--card-2); border: 1px solid var(--line-2); border-radius: 12px; outline: none; transition: .15s; color-scheme: dark; }
.field select { padding: 0 10px; color: var(--ink); font: inherit; }
.field select option { background: var(--card-2); color: var(--ink); }
.field input::placeholder { color: #4a5382; }
.field input:focus, .field select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(127,144,245,.18); }
.field .ro { height: 46px; display: flex; align-items: center; font: 700 17px var(--head); }
.btn { height: 46px; padding: 0 24px; border-radius: 12px; border: 0; background: var(--yellow); color: #1a1405; cursor: pointer; font-weight: 700; transition: .15s; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn.ghost { background: none; color: var(--ink); border: 1px solid var(--line-2); font-weight: 500; }
.btn.ghost:hover { border-color: var(--blue); filter: none; }
.btn.sm { height: 34px; padding: 0 14px; border-radius: 99px; font-size: 13px; }
.btn.danger { background: none; color: var(--neg); border: 1px solid #5a2a3a; font-weight: 500; }
.icon-btn { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 5px 9px; border-radius: 8px; }
.icon-btn:hover { background: var(--card-2); color: var(--ink); }
.icon-btn.del:hover { color: var(--neg); }

/* Вход */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login { width: 100%; max-width: 400px; }
.login .brand { justify-content: center; margin-bottom: 26px; font-size: 16px; }
.login .box { padding: 30px; border-color: var(--line-2); }
.login .field + .field { margin-top: 18px; }
.login .btn { width: 100%; margin-top: 26px; }
.err { color: var(--neg); font-size: 14px; margin-top: 14px; min-height: 20px; }

/* Админка */
.admin-form { display: grid; grid-template-columns: 1fr 1fr 1.2fr 1.3fr auto auto; gap: 14px; align-items: end; margin-top: 18px; }
.sub-note { margin-top: 3px; font: 11px var(--mono); letter-spacing: .06em; color: var(--muted); white-space: nowrap; }
.cred { margin-top: 20px; padding: 16px 18px; border: 1px dashed var(--yellow-dim); border-radius: 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: rgba(246,184,63,.04); }
.cred code { font: 14px/1.7 var(--mono); }
.actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.off { opacity: .5; }
.empty { color: var(--muted); padding: 34px 0; text-align: center; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--yellow); color: #1a1405; font-weight: 600; padding: 11px 18px; border-radius: 12px; transition: .25s; z-index: 20; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Фильтр «кто» на странице баера */
.who-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; }
.who-bar .label { margin-right: 6px; }
.chip { height: 38px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--card); color: var(--muted); cursor: pointer; font-size: 14px; transition: .15s; display: inline-flex; align-items: center; gap: 8px; }
.chip i { font: normal 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; opacity: .7; }
.chip:hover { color: var(--ink); border-color: var(--blue); }
.chip.on { background: var(--blue); border-color: var(--blue); color: #0a0d24; font-weight: 600; }

/* Топ по офферам (трекер) */
.tr-ctl { display: grid; grid-template-columns: minmax(220px, 380px) max-content; gap: 14px; align-items: end; margin-top: 22px; }
.tr-note { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 13px; }
.tr-err { color: var(--neg); }
.tr-day { margin-bottom: 16px; }
.tr-dh { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 22px; margin-bottom: 8px; }
.tr-dh h3 { font: 600 18px var(--head); margin-right: 6px; }
.tr-dh span { color: var(--muted); font-size: 13px; } .tr-dh b { color: var(--ink); font-weight: 600; }
.tr-dh .tr-top b { color: var(--yellow); }
.tr-geo td { border-top: 1px solid var(--line-2); padding-top: 12px; font-weight: 500; }
.tr-geo .rk { display: inline-block; width: 22px; color: var(--muted); font: 11px var(--mono); }
.tr-off td { color: var(--muted); font-size: 13px; padding-top: 6px; padding-bottom: 6px; }
.tr-off td:first-child { padding-left: 34px; }
.tr-dbg { margin-top: 26px; } .tr-dbg summary { cursor: pointer; color: var(--muted); }
.tr-dbg pre { margin: 14px 0 0; max-height: 360px; overflow: auto; font: 12px/1.5 var(--mono); color: var(--ink); white-space: pre-wrap; word-break: break-all; }

/* Рейтинги GEO */
.gr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.gr h3 { font: 600 18px var(--head); }
.gr-h { margin: 6px 0 18px; font: 12px var(--mono); letter-spacing: .06em; color: var(--muted); }
.gr-row { display: grid; grid-template-columns: 22px 28px 1fr 64px 52px; align-items: center; gap: 10px; margin: 0 0 12px; }
.gr-row .n { color: var(--muted); font: 13px var(--mono); text-align: right; }
.gr-row .fl { font-size: 17px; line-height: 1; }
.gr-bar { display: flex; align-items: center; gap: 8px; height: 22px; min-width: 0; }
.gr-fill { position: relative; height: 100%; border-radius: 5px; }
.gr-fill i { display: block; min-width: 3px; height: 100%; }
.gr-fill { background: var(--blue); }
.gr .code { font: 600 13px var(--mono); }
.gr .code.in { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); color: #0a0d24; }
.gr-row .vl { text-align: right; font: 600 14px var(--mono); }
.gr-b { display: inline-flex; justify-content: center; align-items: center; height: 30px; border-radius: 8px; font: 600 12px var(--mono); border: 1px solid var(--line-2); color: var(--muted); }
.gr-b.up { color: var(--blue); border-color: rgba(127,144,245,.5); background: rgba(127,144,245,.12); }
.gr-b.dn { color: var(--muted); } .gr-b.new { background: var(--yellow); border-color: var(--yellow); color: #1a1405; } .gr-b.z { opacity: .5; }
.gr-drop { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line-2); font: 12px var(--mono); color: var(--muted); }
.gr-drop span { letter-spacing: .14em; text-transform: uppercase; } .gr-drop em { font-style: normal; color: var(--ink); font-size: 14px; }
.gr-lg { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; } .gr-lg i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 6px; }
.gr-row.wa { grid-template-columns: 22px 28px minmax(60px, 1fr) 60px 150px 52px; }
.gr-apps { display: flex; flex-direction: column; gap: 2px; font: 11px/1.25 var(--mono); color: var(--muted); min-width: 0; }
.gr-apps span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .gr-apps b { color: var(--ink); font-weight: 600; }
.gr-head { margin: -6px 0 6px; } .gr-ah { font: 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.gr .fl { font-size: 20px; }
@media (max-width: 1000px) { .gr-grid { grid-template-columns: 1fr; } }

/* Выбор периода */
.hero-r { position: relative; }
.month .dp-trigger { width: auto; height: 34px; padding: 0 14px; border-radius: 99px; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--ink); }
.month .dp-trigger.on, .month .dp-trigger:hover { border-color: var(--blue); color: var(--ink); }
.dp { position: absolute; right: 0; top: calc(100% + 10px); z-index: 30; display: flex; text-align: left; background: #0d1230; border: 1px solid var(--line-2); border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.55); overflow: hidden; }
.dp[hidden] { display: none; }
.dp-pre { display: flex; flex-direction: column; padding: 10px; gap: 2px; border-right: 1px solid var(--line); min-width: 150px; }
.dp-pre button { text-align: left; background: none; border: 0; color: var(--muted); padding: 9px 12px; border-radius: 10px; cursor: pointer; font-size: 14px; white-space: nowrap; }
.dp-pre button:hover { background: var(--card-2); color: var(--ink); }
.dp-pre button.on { background: rgba(127,144,245,.16); color: var(--ink); }
.dp-cal { padding: 14px 18px 16px; }
.dp-nav { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
.dp-nav button { width: 30px; height: 30px; border-radius: 8px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; }
.dp-nav button:hover { background: var(--card-2); color: var(--ink); }
.dp-hint { flex: 1; text-align: center; font: 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.dp-months { display: flex; gap: 26px; }
.dp-m { width: 252px; }
.dp-mh { text-align: center; font: 600 15px var(--head); margin: 4px 0 10px; }
.dp-wd, .dp-g { display: grid; grid-template-columns: repeat(7, 1fr); }
.dp-wd span { text-align: center; font: 11px var(--mono); color: var(--muted); padding: 4px 0 6px; }
.dp-g .d { height: 34px; border: 0; background: none; color: var(--ink); cursor: pointer; font-size: 14px; position: relative; border-radius: 0; }
.dp-g .d:hover { background: var(--card-2); border-radius: 8px; }
.dp-g .d.in { background: rgba(127,144,245,.18); }
.dp-g .d.st, .dp-g .d.en { background: var(--blue); color: #0a0d24; font-weight: 700; }
.dp-g .d.st { border-radius: 8px 0 0 8px; } .dp-g .d.en { border-radius: 0 8px 8px 0; }
.dp-g .d.st.en { border-radius: 8px; }
.dp-g .d.today:not(.st):not(.en) { color: var(--yellow); font-weight: 700; }
.dp-foot { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.dp-sel { flex: 1; text-transform: capitalize; font: 500 13px var(--mono); color: var(--ink); }
.dp-foot .btn.sm { height: 34px; padding: 0 16px; }
@media (max-width: 860px) {
  .dp { flex-direction: column; left: 0; right: auto; max-width: calc(100vw - 32px); }
  .dp-pre { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); min-width: 0; }
  .dp-months { gap: 0; } .dp-m + .dp-m { display: none; }
  .dp-m { width: min(300px, calc(100vw - 68px)); }
}

@media (max-width: 1000px) {
  .kpi-panel { grid-template-columns: repeat(2, 1fr); }
  .kpi { border-top: 1px solid var(--line); }
  .kpi:nth-child(-n+2) { border-top: 0; }
  .kpi:nth-child(odd) { border-left: 0; }
  .cards, .rank-grid { grid-template-columns: 1fr; }
  .entry { grid-template-columns: 1fr 1fr; }
  .entry .btn { grid-column: 1 / -1; }
  .admin-form { grid-template-columns: 1fr 1fr; }
  .hero-r { text-align: left; }
  .sec-h p { text-align: left; }
}
@media (max-width: 560px) {
  main { padding: 26px 16px 80px; }
  .top-in { padding: 0 16px; gap: 10px; }
  .who span { display: none; }
      .box { padding: 18px; }
  .lead h3 { font-size: 24px; }
  .days3 b { font-size: 12px; }
}

/* Команды */
.team-tag { display: inline-block; padding: 3px 10px; border-radius: 99px; background: rgba(110,140,255,.12); border: 1px solid var(--line-2); color: var(--ink); font-size: 12px; }
.me-tag.tl { background: var(--blue); color: #0a0d24; border-color: var(--blue); font-weight: 600; }
.team-line { margin: 14px 0 0; color: var(--muted); font-size: 14px; }
.team-line b { color: var(--ink); font-weight: 600; }
td select, .tbl select { height: 34px; background: var(--card); color: var(--ink); border: 1px solid var(--line-2); border-radius: 8px; padding: 0 8px; font: inherit; font-size: 13px; max-width: 190px; }

.team-bar { margin: 0 0 18px; gap: 8px; }
.team-bar .chip { height: 34px; padding: 0 14px; font-size: 13px; }
.me-tag { display: inline-block; vertical-align: middle; line-height: 1.5; }
.me-tag.tl { margin-left: 8px; }
.team-tag { white-space: nowrap; line-height: 1.4; vertical-align: middle; }

.tr-loading { display: flex; align-items: center; justify-content: center; gap: 12px; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--blue); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Топ по офферам: все GEO */
.gr-fill.warm { background: linear-gradient(90deg, #ef5b5b, #f5b942); }

.tr-all th.srt { cursor: pointer; user-select: none; } .tr-all th.srt:hover { color: var(--ink); }
.tr-all td { vertical-align: middle; } .tr-all .fl { margin-right: 8px; font-size: 17px; } .tr-nm { margin-left: 8px; font-size: 12px; }
.tr-chev { display: inline-block; width: 16px; color: var(--muted); }
.tr-g.open td { background: rgba(127,144,245,.06); }
.tr-barc { min-width: 170px; } .tr-barc .gr-bar { height: 10px; margin-bottom: 4px; } .tr-barc .gr-fill { border-radius: 4px; }
.tr-bv { font: 12px var(--mono); color: var(--muted); }
.tr-dr > td { padding: 0 !important; background: rgba(0,0,0,.18); }
.tr-det { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; padding: 18px 20px 22px 34px; }
.tr-det h4 { margin: 0 0 8px; font: 600 14px var(--head); }
.tr-det .tbl { font-size: 13px; }
@media (max-width: 1100px) { .tr-det { grid-template-columns: 1fr; padding-left: 20px; } }

.tr-all td:first-child { white-space: nowrap; }
.tr-det > div { min-width: 0; }

/* Загрузка из трекера */
.tr-loader { display: flex; align-items: center; gap: 34px; padding: 44px 48px; margin-top: 22px; }
.tr-loader.err { justify-content: center; text-align: center; }
.tr-ring { position: relative; width: 132px; height: 132px; flex: none; }
.tr-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.tr-ring circle { fill: none; stroke-width: 7; } .tr-ring .rb { stroke: var(--line-2); }
.tr-ring .rf { stroke: var(--yellow); stroke-linecap: round; transition: stroke-dashoffset .25s linear; filter: drop-shadow(0 0 8px rgba(245,185,66,.45)); }
.tr-sec { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.tr-sec b { font: 700 34px/1 var(--head); } .tr-sec span { font: 11px var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.tr-lt h3 { margin: 0 0 8px; font: 600 22px var(--head); } .tr-lt p { margin: 0; color: var(--muted); font-size: 15px; }
.tr-lt .tr-err { color: var(--neg); margin-bottom: 16px; } .tr-cdt { margin-bottom: 18px !important; font: 13px var(--mono); }
.tr-dots { display: flex; gap: 7px; margin-top: 18px; }
.tr-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); animation: trpulse 1.2s ease-in-out infinite; }
.tr-dots i:nth-child(2) { animation-delay: .2s; } .tr-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes trpulse { 0%, 80%, 100% { opacity: .2; transform: scale(.8); } 40% { opacity: 1; transform: scale(1.15); } }
@media (max-width: 560px) { .tr-loader { flex-direction: column; text-align: center; padding: 34px 22px; gap: 22px; } .tr-dots { justify-content: center; } }
.tr-ring svg { overflow: visible; }

/* Дерево: гео → оффер → дни */
.tr-det { display: block !important; padding: 10px 20px 20px 34px !important; }
.tr-tree .tr-node { cursor: pointer; } .tr-tree .tr-node:hover td { background: rgba(127,144,245,.07); }
.tr-tree .tr-node.open td { background: rgba(127,144,245,.05); }
.tr-tree .tr-day td { color: var(--muted); font-size: 12.5px; padding-top: 6px; padding-bottom: 6px; border-top: 0; }
.tr-tree .tr-day td:first-child { padding-left: 46px; } .tr-tree .tr-day .num b { font-weight: 600; color: var(--ink); }
.tr-tree .tr-node td:first-child { white-space: nowrap; }
@media (max-width: 1100px) { .tr-det { padding-left: 8px !important; } }

/* Колонка GEO сжимается по содержимому — бар доли встаёт сразу рядом с названием страны */
.tr-all > thead th:first-child, .tr-all > tbody > tr.tr-g > td:first-child { width: 1%; white-space: nowrap; padding-right: 28px; }
.tr-barc { width: 240px; min-width: 200px; }
.tr-barc { width: 190px; min-width: 170px; }
.tr-all > tbody > tr.tr-g > td:last-child { white-space: nowrap; }

.tr-all > tbody > tr.tr-g > td:last-child { white-space: normal; }
.tr-barc { vertical-align: middle; } .tr-barc .gr-bar { margin: 0; }

/* Длинные названия стран не растягивают таблицу — обрезаются с затемнением */
.tr-code, .tr-nm { display: inline-block; vertical-align: middle; max-width: 130px; overflow: hidden; white-space: nowrap;
}
.tr-code.cut, .tr-nm.cut { -webkit-mask-image: linear-gradient(90deg, #000 70%, transparent); mask-image: linear-gradient(90deg, #000 70%, transparent); }
.tr-nm { max-width: 110px; }

/* Поиск */
.tr-search { position: relative; display: flex; align-items: center; max-width: 460px; margin-bottom: 18px; }
.tr-search .si { position: absolute; left: 16px; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; transition: .15s; }
.tr-search input { width: 100%; height: 48px; padding: 0 78px 0 46px; background: var(--card-2); border: 1px solid var(--line-2); border-radius: 14px; outline: none; font-size: 15px; color: var(--ink); color-scheme: dark; -webkit-appearance: none; appearance: none; transition: .15s; }
.tr-search input::placeholder { color: #5b6598; }
.tr-search input:hover { border-color: rgba(127,144,245,.4); }
.tr-search input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(127,144,245,.18); background: var(--card); }
.tr-search:focus-within .si { stroke: var(--blue); }
.tr-search .sx { position: absolute; right: 12px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(127,144,245,.16); color: var(--muted); font-size: 11px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: .15s; }
.tr-search .sx:hover { background: var(--blue); color: #0a0d24; } .tr-search .sx[hidden] { display: none; }
.tr-search .sc { position: absolute; right: 46px; font: 11px var(--mono); color: var(--muted); letter-spacing: .06em; pointer-events: none; }

/* ───── Мобильная версия ───── */
.mo-team, .mo-hint { display: none; }
.burger { display: none; }
.mmenu { display: none; }
.kpi-panel.k4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 760px) {
  .top .nav, .top .who { display: none; }
  .top-in { justify-content: space-between; }
  .burger { display: inline-flex; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card); cursor: pointer; }
  .burger i { display: block; height: 2px; border-radius: 2px; background: var(--ink); transition: .2s; }
  .burger.on i:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .burger.on i:nth-child(2) { opacity: 0; }
  .burger.on i:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .mmenu { display: flex; flex-direction: column; gap: 6px; padding: 0 16px; max-height: 0; overflow: hidden; border-top: 0 solid var(--line); transition: max-height .25s ease, padding .25s ease; background: rgba(8,11,34,.96); }
  .mmenu.open { max-height: 420px; padding: 14px 16px 18px; border-top-width: 1px; }
  .mm-who { font: 11px var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); padding: 2px 4px 8px; }
  .mmenu a { display: block; padding: 14px 16px; border-radius: 14px; font-size: 17px; color: var(--ink); background: var(--card); border: 1px solid var(--line); }
  .mmenu a.on { background: var(--card-2); border-color: var(--blue); }
  .mmenu .btn { margin-top: 8px; height: 48px; }
}
@media (max-width: 560px) {
  .hero { gap: 18px; } .hero h1 { font-size: clamp(30px, 9vw, 40px); line-height: 1.08; word-break: break-word; }
  .hero-r { width: 100%; } .hero-r .when { font-size: clamp(24px, 7.5vw, 32px); }
  .sec { margin-top: 34px; } .sec-h { gap: 6px; margin-bottom: 14px; } .sec-h h2 { font-size: 18px; }
  .sec-h p { font-size: 13px; max-width: none; }
  .hm { display: none !important; }
  .tbl { font-size: 13px; } .tbl th, .tbl td { padding-left: 8px; padding-right: 8px; }
  .tbl th:first-child, .tbl td:first-child { padding-left: 4px; }
  .box { padding: 14px; border-radius: 18px; } .scroll { margin: 0 -4px; padding: 0 4px; }
  .kpi { padding: 16px 14px; } .kpi .v { margin-top: 10px; }
  .kpi-panel.k4 { grid-template-columns: repeat(2, 1fr); }
  .kpi-panel.k4 .kpi:nth-child(-n+2) { border-top: 0; } .kpi-panel.k4 .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
  .kpi-panel.k4 .kpi:nth-child(odd) { border-left: 0; } .kpi-panel.k4 .kpi:nth-child(even) { border-left: 1px solid var(--line); }
  .who-bar { gap: 6px; } .team-bar .chip { height: 32px; padding: 0 12px; }
  .ticker { gap: 14px; }
  .entry, .admin-form, .tr-ctl { grid-template-columns: 1fr; }
  .tr-all td:first-child, .tr-all th:first-child { position: sticky; left: 0; z-index: 1; background: var(--card); }
  .tr-barc { display: none; } .tr-all th:nth-child(2) { display: none; }
  .tr-det { padding: 6px 0 12px !important; }
  .tr-tree .tr-day td:first-child { padding-left: 24px; }
  .tr-code, .tr-nm { max-width: 90px; } .tr-nm { display: none; }
  .tr-search { max-width: none; }
  .gr-row { grid-template-columns: 18px 24px 1fr 52px 44px; gap: 8px; }
  .gr h3 { font-size: 16px; }
  .lead { padding: 20px; }
  .tabs { max-width: 100%; }
}

/* Бегущая строка «Главное» */
.ticker { overflow: hidden; }
.marq { flex: 1; min-width: 0; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); }
.marq-track { display: flex; width: max-content; animation: marq 38s linear infinite; }
.marq-set { display: flex; align-items: center; gap: 22px; padding-right: 22px; flex: none; }
.marq:hover .marq-track { animation-play-state: paused; }
@keyframes marq { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marq-track { animation: none; } .marq { overflow-x: auto; } }

@media (max-width: 560px) {
  .mo-team { display: block; margin-top: 3px; font: 11px var(--mono); letter-spacing: .04em; color: var(--muted); }
  .me-tag { margin-left: 6px; padding: 1px 6px; font-size: 10px; letter-spacing: .08em; line-height: 1.5; }
  .tbl td:first-child { min-width: 92px; }
}
@media (max-width: 560px) { .mo-hint { display: block; margin: -6px 0 10px; font: 11px var(--mono); letter-spacing: .06em; color: var(--muted); } }

@media (max-width: 560px) {
  .tbl.stack thead { display: none; }
  .tbl.stack, .tbl.stack tbody, .tbl.stack tr, .tbl.stack td { display: block; width: 100%; }
  .tbl.stack tr { padding: 14px 0; border-top: 1px solid var(--line); } .tbl.stack tr:first-child { border-top: 0; }
  .tbl.stack td { padding: 4px 0 !important; border: 0 !important; text-align: left !important; min-width: 0 !important; }
  .tbl.stack td select { max-width: 100%; width: 100%; height: 40px; }
  .tbl.stack .actions { flex-wrap: wrap; gap: 8px; justify-content: flex-start; margin-top: 6px; }
  .tbl.stack .muted { font-size: 12px; }
}

/* Гороскоп дня */
.horo { --tone: var(--yellow); margin: 0 0 22px; padding: 22px 24px; border: 1px solid var(--line-2); border-radius: 18px; position: relative; overflow: hidden;
  background: radial-gradient(520px 240px at 100% -10%, color-mix(in srgb, var(--tone) 16%, transparent), transparent 70%),
    radial-gradient(420px 220px at -5% 110%, rgba(127,144,245,.12), transparent 70%), var(--card);
  box-shadow: 0 10px 40px -18px rgba(0,0,0,.6); }
.horo::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--tone), transparent 70%); }
.horo.t-good { --tone: #5be3a1; }
.horo.t-mid { --tone: var(--yellow); }
.horo.t-bad { --tone: #ff7a7a; }
.horo-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.horo-head { display: flex; align-items: center; gap: 14px; }
.horo-glyph { width: 52px; height: 52px; flex: none; display: grid; place-items: center; font-size: 30px; line-height: 1; border-radius: 15px; color: var(--tone);
  background: color-mix(in srgb, var(--tone) 14%, transparent); border: 1px solid color-mix(in srgb, var(--tone) 45%, transparent); }
.horo-kicker { font: 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.horo-sign { font-size: 21px; font-weight: 650; margin-top: 2px; }
.horo-verdict { padding: 7px 14px; border-radius: 99px; font-weight: 650; font-size: 13.5px; color: #0a0d24; background: var(--tone); box-shadow: 0 6px 20px -8px var(--tone); }
.horo-text { margin: 0 0 18px; font-size: 17px; line-height: 1.55; color: var(--ink); max-width: 76ch; }
.horo-flavor { color: var(--muted); }
.horo-meters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.horo-m { padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid var(--line-2); }
.horo-m-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 9px; font-size: 12.5px; color: var(--muted); }
.horo-m-top b { color: var(--ink); font-weight: 600; font-size: 13px; text-align: right; }
.seg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.seg i { height: 8px; border-radius: 4px; background: rgba(255,255,255,.08); }
.seg i.on { background: linear-gradient(90deg, var(--blue), #a6b4ff); }
.horo-m.bad .seg i.on { background: linear-gradient(90deg, var(--yellow), #ff7a7a); }
.horo-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.horo-tip { display: flex; gap: 12px; padding: 14px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(255,255,255,.025); }
.horo-tip b { display: block; font: 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 5px; }
.horo-tip p { margin: 0; line-height: 1.45; font-size: 15px; }
.horo-ic { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%; font-weight: 700; font-size: 14px; }
.horo-tip.do b { color: #5be3a1; } .horo-tip.do .horo-ic { background: rgba(91,227,161,.15); color: #5be3a1; }
.horo-tip.dont b { color: #ff7a7a; } .horo-tip.dont .horo-ic { background: rgba(255,122,122,.15); color: #ff7a7a; }
.horo-extra { margin: 0 0 14px; padding: 12px 16px; border-left: 3px solid var(--blue); border-radius: 4px 12px 12px 4px; background: rgba(127,144,245,.08); font-size: 15px; line-height: 1.5; font-style: italic; }
.horo-extra span { display: block; font: 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--blue); margin-bottom: 4px; font-style: normal; }
.horo-lucky { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.hl { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(255,255,255,.02); min-width: 0; }
.hl-i { font-size: 20px; }
.hl em { display: block; font-style: normal; font: 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hl b { display: block; font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
@media (max-width: 760px) { .horo-meters { grid-template-columns: 1fr; } .horo-cols { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .horo { padding: 18px 16px; border-radius: 16px; } .horo-text { font-size: 16px; } .horo-lucky { grid-template-columns: 1fr 1fr; } .horo-verdict { font-size: 12.5px; } }
