/*
 * Кабинет вебмастера — «Степь и золото».
 * Палитра выросла из флага Казахстана: небесная бирюза для действий, золото — только для денег.
 * Mobile-first: базовые правила — для телефона, расширения — в @media (min-width).
 */
:root {
  --night: #0F2A3D;      /* глубокая степная ночь: рейка, герой дашборда */
  --night-2: #183B54;
  --sky: #087A97;        /* основное действие (контраст с белым ≥ 4.5) */
  --sky-2: #0A6A84;
  --sky-soft: #DDF1F6;
  --gold: #F5B700;       /* деньги: сумма, копирование ссылки */
  --gold-2: #E0A600;
  --gold-soft: #FFF3CC;
  --mist: #EEF2F4;       /* фон страницы */
  --paper: #FFFFFF;
  --ink: #152033;
  --muted: #5A6878;
  --line: #D5DDE3;
  --line-soft: #E6ECF0;
  --ok: #1E7F52;   --ok-soft: #DDF3E7;
  --warn: #9A5B00; --warn-soft: #FDEFD3;
  --bad: #B8352F;  --bad-soft: #FBE3E1;
  --vio: #5B3FB8;  --vio-soft: #ECE6FB;

  --r-s: 8px;
  --r-m: 14px;
  --r-l: 22px;
  --tap: 44px;
  --gut: 16px;
  --tabbar-h: 64px;
  --top-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);

  --f-body: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --f-display: 'Unbounded', 'Onest', system-ui, sans-serif;
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--mist); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--mist);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
body.locked { overflow: hidden; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1 { font-family: var(--f-display); font-weight: 600; font-size: 1.375rem; line-height: 1.2; letter-spacing: -0.01em; }
h2 { font-size: 1.0625rem; font-weight: 600; line-height: 1.3; }
h3 { font-size: 0.9375rem; font-weight: 600; line-height: 1.3; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--sky); text-underline-offset: 2px; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.8125rem; }
.muted { color: var(--muted); }
.r { text-align: right; }
.sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 4px; }
.rail :focus-visible, .hero :focus-visible, .auth-side :focus-visible { outline-color: var(--gold); }
.skip {
  position: absolute; left: 8px; top: -60px; z-index: 100; padding: 10px 14px;
  background: var(--paper); color: var(--ink); border-radius: var(--r-s); font-weight: 600;
}
.skip:focus { top: calc(8px + var(--safe-t)); }
.clip-helper { position: fixed; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ───────── icons ───────── */
.ico {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}

/* ───────── buttons & fields ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  font-weight: 600; font-size: 0.9375rem; text-decoration: none; cursor: pointer;
  white-space: nowrap; touch-action: manipulation;
  transition: background-color .15s, border-color .15s, transform .08s;
}
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: .5; cursor: default; transform: none; }
.btn-primary { background: var(--sky); border-color: var(--sky); color: #fff; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #2A1E00; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost-dark { background: transparent; border-color: rgba(255,255,255,.18); color: #D9E6EE; }
.btn-danger-soft { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.btn-wide { width: 100%; }
.btn-icon { width: var(--tap); padding: 0; }
.btn.is-busy { position: relative; color: transparent; }
.btn.is-busy::after {
  content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; animation: spin .7s linear infinite;
}
@media (hover: hover) {
  .btn:hover { border-color: #A9B7C2; }
  .btn-primary:hover { background: var(--sky-2); border-color: var(--sky-2); }
  .btn-gold:hover { background: var(--gold-2); border-color: var(--gold-2); }
  .btn-ghost:hover { background: var(--line-soft); }
  .btn-ghost-dark:hover { background: rgba(255,255,255,.08); }
}
.linkish {
  all: unset; cursor: pointer; display: inline; text-align: left;
}
.linkish:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 4px; }
@media (hover: hover) { .linkish:hover { text-decoration: underline; text-underline-offset: 3px; } }

.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 0.8125rem; color: var(--muted); font-weight: 500; }
.input {
  width: 100%; min-height: var(--tap); padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--paper);
  font-size: 1rem; /* ≥16px: iOS не зумит поле при фокусе */
}
select.input {
  appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
  text-overflow: ellipsis;
}
.input:focus-visible { outline: 3px solid var(--sky); outline-offset: 0; border-color: var(--sky); border-radius: 12px; }
.input-mono, textarea.input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.875rem; }
textarea.input { resize: vertical; min-height: 84px; line-height: 1.45; word-break: break-all; }
.hint { font-size: 0.8125rem; color: var(--muted); }
.error { color: var(--bad); font-size: 0.875rem; min-height: 1.25em; font-weight: 500; }
.form { display: grid; gap: 14px; }
.form-row { display: grid; gap: 14px; }
.field-inline { grid-auto-flow: column; align-items: center; justify-content: start; gap: 8px; }

/* ───────── chips & segmented ───────── */
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  font-size: 0.875rem; font-weight: 500; cursor: pointer; white-space: nowrap; touch-action: manipulation;
  position: relative;
}
.chip::before { /* расширяем зону касания до 44px, не раздувая визуально */
  content: ''; position: absolute; inset: -2px 0;
}
.chip[aria-pressed="true"] { background: var(--night); border-color: var(--night); color: #fff; }
.chip[aria-pressed="true"] .model { box-shadow: 0 0 0 1.5px rgba(255,255,255,.7); }
.chip .ico { width: 18px; height: 18px; }
@media (hover: hover) { .chip:hover { border-color: #A9B7C2; } }
.chiprow {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(-1 * var(--gut)); padding: 2px var(--gut);
  scroll-padding-inline: var(--gut);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 20px), transparent);
  mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 20px), transparent);
}
.chiprow::-webkit-scrollbar { display: none; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--line-soft); max-width: 100%; overflow-x: auto; }
.seg button {
  border: 0; background: transparent; min-height: var(--tap); padding: 0 12px; border-radius: 9px;
  font-size: 0.875rem; font-weight: 500; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(15,42,61,.12); }

/* ───────── badges: model, status, geo, tags ───────── */
.model {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 22px; padding: 0 7px; border-radius: 6px;
  font-family: var(--f-display); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.04em;
}
.model-cpa { background: #D7EEF5; color: #075C72; }
.model-cpl { background: var(--vio-soft); color: var(--vio); }
.model-cpi { background: #DDF3E7; color: #17673F; }
.model-cps { background: #FFE6CF; color: #8A4300; }
.model-other { background: var(--line-soft); color: var(--muted); }

.status {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  min-height: 26px; padding: 0 10px; border-radius: 999px; font-size: 0.8125rem; font-weight: 600;
}
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-approved { background: var(--ok-soft); color: var(--ok); }
.st-pending { background: var(--warn-soft); color: var(--warn); }
.st-requested { background: var(--vio-soft); color: var(--vio); }
.st-open { background: var(--sky-soft); color: var(--sky-2); }
.st-rejected { background: var(--bad-soft); color: var(--bad); }

.geo {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px;
  border-radius: 7px; background: var(--mist); border: 1px solid var(--line-soft);
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap;
}
.geo .flag { font-size: 0.9375rem; line-height: 1; }
.geo-sm { height: 22px; padding: 0 6px; }
.geo-block { background: var(--bad-soft); border-color: transparent; color: var(--bad); text-decoration: line-through; }
.geo-dark { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.16); color: #fff; }
.geo-more { color: var(--muted); }
.flag { font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }
.tag {
  display: inline-flex; align-items: center; gap: 4px; min-height: 24px; padding: 2px 8px; margin: 2px 4px 2px 0;
  border-radius: 6px; background: var(--line-soft); font-size: 0.8125rem; overflow-wrap: anywhere;
}
.tags { display: flex; flex-wrap: wrap; }

.delta { display: inline-flex; align-items: center; gap: 2px; font-size: 0.8125rem; font-weight: 600; white-space: nowrap; }
.delta span { font-size: 0.625rem; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--bad); }
.delta-dark.up { color: #7BE0AE; }
.delta-dark.down { color: #FFA59E; }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dot-a { background: var(--gold); }
.dot-b { background: #7FB5C6; }
.dot-r { background: var(--bad); }

/* ───────── notes, empty states, toasts ───────── */
.note {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--r-m); font-size: 0.9375rem; line-height: 1.45;
  background: var(--sky-soft); color: #0B4F61;
}
.note .ico { margin-top: 1px; }
.note-requested { background: var(--vio-soft); color: #3F2A85; }
.note-pending { background: var(--warn-soft); color: #6E4100; }
.note-rejected { background: var(--bad-soft); color: #8A251F; }
.note-info { background: var(--ok-soft); color: #155C3A; }
.view-note { margin-bottom: 12px; }

.empty {
  display: grid; justify-items: center; gap: 8px; text-align: center;
  padding: 36px 20px; max-width: 46ch; margin: 0 auto;
}
.empty-ico { width: 36px; height: 36px; color: #93A4B2; stroke-width: 1.5; margin-bottom: 4px; }
.empty-title { font-weight: 600; font-size: 1.0625rem; }
.empty-hint { color: var(--muted); font-size: 0.9375rem; }
.empty .btn { margin-top: 8px; }
.empty-err .empty-ico { color: var(--bad); }

.toasts {
  position: fixed; z-index: 90; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px);
  display: grid; gap: 8px; width: min(440px, calc(100vw - 2 * var(--gut))); pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r-m);
  background: var(--night); color: #fff; font-size: 0.9375rem; font-weight: 500;
  box-shadow: 0 10px 30px rgba(15,42,61,.28); pointer-events: auto;
  animation: toast-in .22s ease-out;
}
.toast .ico { color: #7BE0AE; }
.toast-info .ico { color: #C7B6FF; }
.toast-err { background: #5E1612; }
.toast-err .ico { color: #FFB1AA; }

/* ───────── skeletons ───────── */
.skeletons { display: grid; gap: 14px; }
.sk {
  border-radius: var(--r-m); min-height: 16px;
  background: linear-gradient(90deg, #E2E8EC 0%, #EEF2F4 40%, #E2E8EC 80%);
  background-size: 300% 100%; animation: shimmer 1.3s ease-in-out infinite;
}
.sk-period { height: 44px; }
.sk-hero { height: 190px; border-radius: var(--r-l); background: linear-gradient(90deg, #1B3A50, #234A63, #1B3A50); background-size: 300% 100%; }
.sk-strip { height: 84px; }
.sk-chart { height: 260px; }
.sk-title { height: 32px; width: 40%; }
.sk-input { height: 48px; }
.sk-row { height: 132px; margin-bottom: 10px; }
.sk-table { height: 320px; margin: 0; }

/* ───────── auth ───────── */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; }
.auth-side {
  background: var(--night); color: #fff;
  padding: calc(20px + var(--safe-t)) var(--gut) 26px;
  display: grid; gap: 12px; align-content: start;
  background-image: radial-gradient(120% 90% at 100% 0%, rgba(245,183,0,.22), transparent 55%);
}
.auth-title { font-family: var(--f-display); font-size: 1.5rem; line-height: 1.2; font-weight: 600; max-width: 18ch; margin-top: 10px; }
.auth-sub { color: #BFD2DD; max-width: 46ch; }
.auth-points { display: none; }
.auth-points li { display: flex; gap: 12px; align-items: center; color: #DCE8EF; }
.auth-points .ico { color: var(--gold); }
.auth-models { display: inline-flex; gap: 4px; }
.auth-main { padding: 16px var(--gut) calc(28px + var(--safe-b)); display: grid; align-content: start; gap: 16px; }
.auth-top { display: flex; justify-content: flex-end; }
.auth-card {
  background: var(--paper); border-radius: var(--r-l); padding: 20px 18px; display: grid; gap: 18px;
  width: 100%; max-width: 480px; margin: 0 auto; box-shadow: 0 1px 0 var(--line);
}
.tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; gap: 4px; border-radius: 14px; background: var(--line-soft); }
.tab {
  border: 0; background: transparent; min-height: var(--tap); border-radius: 10px;
  font-weight: 600; color: var(--muted); cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(15,42,61,.12); }

.brandmark { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: var(--gold); color: var(--night); font-family: var(--f-display); font-weight: 700; font-size: 1rem;
}
.langs { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--line-soft); }
.langs button {
  border: 0; background: transparent; min-height: var(--tap); min-width: 48px; padding: 0 10px; border-radius: 9px;
  font-size: 0.8125rem; font-weight: 600; color: var(--muted); cursor: pointer; letter-spacing: 0.02em;
}
.langs button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(15,42,61,.12); }
.langs-dark { background: rgba(255,255,255,.08); }
.langs-dark button { color: #A9C0CE; }
.langs-dark button[aria-pressed="true"] { background: rgba(255,255,255,.16); color: #fff; box-shadow: none; }

/* ───────── shell: mobile ───────── */
.demo-tag {
  background: var(--gold); color: #2A1E00; font-size: 0.75rem; font-weight: 700;
  padding: 3px 8px; border-radius: 6px; white-space: nowrap;
}
.rail .demo-tag { margin: -12px 8px 0; text-align: center; }
.shell { min-height: 100vh; min-height: 100dvh; }
.rail { display: none; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  min-height: calc(var(--top-h) + var(--safe-t));
  padding: var(--safe-t) calc(var(--gut) + var(--safe-r)) 0 calc(var(--gut) + var(--safe-l));
  background: var(--night); color: #fff;
}
.topbar .mark { width: 30px; height: 30px; font-size: 0.875rem; }
.topbar-title { flex: 1; font-weight: 600; font-size: 1.0625rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: var(--tap); height: var(--tap); border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.12); color: #fff; font-weight: 700;
}
.main {
  display: block; min-width: 0;
  padding: 16px calc(var(--gut) + var(--safe-r)) calc(var(--tabbar-h) + var(--safe-b) + 28px) calc(var(--gut) + var(--safe-l));
}
.main > * + * { margin-top: 16px; }
.main:focus { outline: none; }
.tabbar {
  position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding: 0 var(--safe-r) var(--safe-b) var(--safe-l);
  background: rgba(255,255,255,.97); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
}
.tabbar a, .tabbar button {
  display: grid; justify-items: center; align-content: center; gap: 3px; min-width: 0;
  border: 0; background: transparent; color: var(--muted); text-decoration: none; cursor: pointer;
  font-size: 0.6875rem; font-weight: 600; padding: 6px 2px; position: relative;
}
.tabbar span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabbar .ico { width: 24px; height: 24px; }
.tabbar .is-on { color: var(--sky); }
.tabbar .is-on::before {
  content: ''; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--sky);
}
.page-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; }
.page-head .muted { font-size: 0.875rem; }

/* sticky period picker */
.period {
  position: sticky; top: calc(var(--top-h) + var(--safe-t)); z-index: 20;
  margin: -16px calc(-1 * var(--gut)) 0; padding: 10px var(--gut);
  background: rgba(238,242,244,.96); border-bottom: 1px solid var(--line-soft);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.period-chips {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(-1 * var(--gut)); padding: 2px var(--gut);
}
.period-chips::-webkit-scrollbar { display: none; }
.period-custom { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 10px; }
.period-custom .input { width: auto; min-width: 150px; }

/* ───────── panels ───────── */
.panel { background: var(--paper); border-radius: var(--r-m); border: 1px solid var(--line-soft); min-width: 0; }
.panel-pad { padding: 16px; display: grid; gap: 16px; }
.panel-flush { overflow: hidden; }
.panel-flush > .note { margin: 12px; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 6px; }
.link-more { font-size: 0.875rem; font-weight: 600; min-height: var(--tap); display: inline-flex; align-items: center; }
.cols { display: grid; gap: 16px; }

/* ───────── dashboard ───────── */
.hero {
  position: relative; overflow: hidden;
  background: var(--night); color: #fff; border-radius: var(--r-l);
  padding: 20px 18px 18px; display: grid; gap: 18px;
  background-image:
    radial-gradient(90% 120% at 100% 0%, rgba(245,183,0,.20), transparent 60%),
    radial-gradient(70% 90% at 0% 100%, rgba(8,122,151,.35), transparent 60%);
}
.hero-label { color: #A9C0CE; font-size: 0.9375rem; }
.hero-sum {
  font-family: var(--f-display); font-weight: 700; color: var(--gold);
  font-size: clamp(2rem, 9vw, 4.25rem); line-height: 1.05; letter-spacing: -0.02em;
  margin-top: 4px; overflow-wrap: anywhere;
}
.hero-sum-long { font-size: clamp(1.625rem, 7.4vw, 3.5rem); }
.hero-delta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin-top: 10px; color: #A9C0CE; font-size: 0.8125rem; min-height: 1.2em; }
.hero-split { display: grid; gap: 10px; }
.split { width: 100%; height: 10px; display: block; }
.split-bg { fill: rgba(255,255,255,.12); }
.split-a { fill: var(--gold); }
.split-b { fill: #7FB5C6; }
.hero-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.hero-legend dt { color: #A9C0CE; font-size: 0.8125rem; }
.hero-legend dd { font-weight: 600; font-size: 1.0625rem; }

.metrics {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--r-m); overflow: hidden;
}
.metric { background: var(--paper); padding: 12px 14px; display: grid; gap: 2px; min-width: 0; }
.metric dt { font-size: 0.8125rem; color: var(--muted); }
.metric dd { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.metric-v { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }
.metrics-flat { border: 0; border-radius: 0 0 var(--r-m) var(--r-m); border-top: 1px solid var(--line-soft); }

.chart-box { padding: 4px 8px 12px; min-height: 200px; overflow: hidden; }
.chart { display: block; width: 100%; height: auto; }
.chart .grid { stroke: var(--line-soft); stroke-width: 1; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--f-body); }
.chart .bar { fill: var(--sky); }
.chart-earnings .bar { fill: var(--gold); }
@media (hover: hover) { .chart .bar:hover { fill: var(--night); } }

.rank { padding: 4px 16px 14px; display: grid; }
.rank li { padding: 10px 0; display: grid; gap: 6px; border-bottom: 1px solid var(--line-soft); }
.rank li:last-child { border-bottom: 0; }
.rank-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.rank-name { font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.rank-sum { white-space: nowrap; }
.rank-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 0.8125rem; color: var(--muted); }
.share { display: block; width: 100%; height: 6px; }
.share-bg { fill: var(--line-soft); }
.share-fg { fill: var(--gold); }
.share-sky .share-fg { fill: var(--sky); }

.start { padding: 18px 16px; display: grid; gap: 14px; border-color: #BFE0E9; }
.start h2 { font-family: var(--f-display); font-size: 1.125rem; font-weight: 600; }
.steps { display: grid; gap: 4px; counter-reset: s; }
.step { display: grid; grid-template-columns: 36px 1fr; gap: 12px; padding: 10px 0; position: relative; }
.step:not(:last-child)::after {
  content: ''; position: absolute; left: 17px; top: 50px; bottom: -8px; width: 2px; background: var(--line-soft);
}
.step-n {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--line); font-weight: 700; color: var(--muted); background: var(--paper);
}
.step-n .ico { width: 18px; height: 18px; stroke-width: 2.5; }
.step.is-next .step-n { border-color: var(--sky); color: var(--sky); }
.step.is-done .step-n { background: var(--ok); border-color: var(--ok); color: #fff; }
.step.is-done .step-title { color: var(--muted); }
.step-title { font-weight: 600; padding-top: 6px; }
.step-hint { color: var(--muted); font-size: 0.9375rem; }
.step-cta { margin-top: 10px; }

/* ───────── offers ───────── */
.filters { display: grid; gap: 10px; }
.search { position: relative; display: block; }
.search .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .input { padding-left: 44px; min-height: 48px; border-radius: 14px; }
.selects { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.selects > *, .toolbar > * { min-width: 0; }
.offer-list { display: grid; gap: 12px; }
.offers { display: grid; gap: 10px; }
.offer {
  background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--r-m);
  padding: 14px; display: grid; gap: 10px 12px;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  grid-template-areas:
    "logo id   id"
    "pay  pay  status"
    "geo  geo  geo"
    "act  act  act";
  position: relative;
}
.offer::before { /* полоса статуса доступа слева */
  content: ''; position: absolute; left: -1px; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: transparent;
}
.acc-approved::before { background: var(--ok); }
.acc-requested::before { background: var(--vio); }
.acc-pending::before { background: var(--warn); }
.acc-open::before { background: var(--sky); }
.logo {
  grid-area: logo; width: 44px; height: 44px; border-radius: 12px; overflow: hidden; flex: none;
  display: grid; place-items: center; background: var(--sky-soft); color: var(--sky-2);
  font-family: var(--f-display); font-weight: 700; font-size: 1.125rem;
}
.logo img { width: 100%; height: 100%; object-fit: cover; }
.logo-lg { width: 52px; height: 52px; font-size: 1.25rem; }
.offer-id { grid-area: id; min-width: 0; align-self: center; }
.offer-name { font-size: 1rem; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.offer-meta { display: flex; flex-wrap: wrap; gap: 0 12px; font-size: 0.8125rem; color: var(--muted); margin-top: 2px; }
.offer-pay { grid-area: pay; display: flex; align-items: center; gap: 10px; min-width: 0; }
.pay { font-family: var(--f-display); font-size: 1.375rem; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.offer-status { grid-area: status; align-self: center; }
.offer-geo { grid-area: geo; display: flex; flex-wrap: wrap; gap: 6px; }
.offer-geo:empty { display: none; }
.offer-act { grid-area: act; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.offer-act > .btn:only-child { grid-column: 1 / -1; }
.offer-act .btn { white-space: normal; line-height: 1.15; padding: 6px 10px; min-width: 0; text-align: center; }
.offer-note { grid-column: 1 / -1; font-size: 0.875rem; color: var(--muted); }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; }
.pager-pos { color: var(--muted); font-size: 0.875rem; text-align: center; }

/* ───────── sheet (offer card / «Ещё») ───────── */
.overlay {
  position: fixed; inset: 0; z-index: 60; background: rgba(9,24,35,.5);
  animation: fade-in .2s ease-out;
}
.sheet {
  position: fixed; z-index: 61; left: 0; right: 0; bottom: 0;
  background: var(--mist); display: flex; flex-direction: column;
  border-radius: var(--r-l) var(--r-l) 0 0; overflow: hidden;
  max-height: calc(100vh - 12px); max-height: calc(100dvh - 12px - var(--safe-t));
  animation: sheet-up .28s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 -10px 40px rgba(9,24,35,.25);
}
.sheet-side { height: calc(100dvh - 12px - var(--safe-t)); }
.sheet-menu { background: var(--paper); padding-bottom: calc(16px + var(--safe-b)); }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: #B8C5CE; margin: 8px auto 0; flex: none; }
.sheet-head {
  display: flex; align-items: flex-start; gap: 12px; padding: 10px var(--gut) 12px; flex: none;
  background: var(--paper); border-bottom: 1px solid var(--line-soft);
}
.sheet-head-menu { border-bottom: 0; }
.sheet-title { flex: 1; min-width: 0; }
.sheet-title h2 { font-size: 1.125rem; line-height: 1.3; overflow-wrap: anywhere; }
.sheet-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 4px; font-size: 0.8125rem; }
.sheet-body {
  flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 14px var(--gut) 20px; display: grid; gap: 14px; align-content: start;
}
.sheet-foot {
  flex: none; padding: 12px var(--gut) calc(12px + var(--safe-b));
  background: var(--paper); border-top: 1px solid var(--line-soft);
}
.paycard {
  background: var(--night); color: #fff; border-radius: var(--r-l); padding: 18px; display: grid; gap: 6px;
  background-image: radial-gradient(90% 120% at 100% 0%, rgba(245,183,0,.22), transparent 60%);
}
.paycard-label { color: #A9C0CE; font-size: 0.875rem; }
.paycard-sum { font-family: var(--f-display); font-weight: 700; color: var(--gold); font-size: clamp(2rem, 10vw, 2.75rem); line-height: 1.05; overflow-wrap: anywhere; }
.paycard-model { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: #DCE8EF; font-size: 0.9375rem; }
.paycard-geo { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.sec { background: var(--paper); border-radius: var(--r-m); padding: 14px; display: grid; gap: 10px; min-width: 0; }
.sec:has(> .note:only-child) { padding: 0; background: transparent; }
.sec-link { border: 2px solid var(--gold); }
.sec-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.875rem; }
.link-ext { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); font-weight: 600; }
.link-ext .ico { width: 18px; height: 18px; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.9375rem; }
.payouts { display: grid; }
.payout-row {
  display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 6px 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line-soft);
}
.payout-row:last-child { border-bottom: 0; }
.payout-sum { font-family: var(--f-display); font-weight: 600; font-size: 1.0625rem; white-space: nowrap; }
.payout-cond { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; font-size: 0.875rem; }
.kv { display: grid; gap: 12px; }
.kv > div { display: grid; gap: 4px; min-width: 0; }
.kv dt { font-size: 0.8125rem; color: var(--muted); }
.kv dd { display: flex; flex-wrap: wrap; gap: 6px; overflow-wrap: anywhere; min-width: 0; }
.caps { display: grid; }
.caps li { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 0.9375rem; }
.caps li:last-child { border-bottom: 0; }
.creatives { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.creatives a { display: grid; gap: 4px; padding: 6px; border: 1px solid var(--line); border-radius: var(--r-s); text-decoration: none; color: var(--ink); font-size: 0.8125rem; }
.creatives img { width: 100%; height: 80px; object-fit: cover; border-radius: 4px; }

.menu-list { display: grid; padding: 4px var(--gut); }
.menu-list a {
  display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 4px;
  color: var(--ink); text-decoration: none; font-weight: 600; border-bottom: 1px solid var(--line-soft);
}
.menu-list .ico { color: var(--sky); }
.menu-lang { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px var(--gut); }
.sheet-menu > .btn-wide { width: auto; margin: 4px var(--gut) 0; }

/* ───────── link builder ───────── */
.builder { display: grid; gap: 14px; min-width: 0; }
.builder-out { display: grid; gap: 10px; }
.link-out { background: var(--gold-soft); border-color: #F0D88A; color: #3B2D00; }
.sub-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.more-params { border-top: 1px solid var(--line-soft); padding-top: 4px; }
.more-params summary {
  min-height: var(--tap); display: flex; align-items: center; gap: 8px; cursor: pointer;
  font-weight: 600; color: var(--sky); list-style: none;
}
.more-params summary::-webkit-details-marker { display: none; }
.more-params summary::before { content: '+'; font-size: 1.25rem; width: 20px; text-align: center; }
.more-params[open] summary::before { content: '−'; }
.more-params[open] .sub-grid { padding: 4px 0 6px; }
.copy-line { display: flex; gap: 8px; }
.copy-line .input { flex: 1; min-width: 0; }

.quick-links { display: grid; padding: 0 16px 8px; }
.quick-links li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.quick-links li:last-child { border-bottom: 0; }
.ql-text { flex: 1; min-width: 0; display: grid; }
.ql-text .cell-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ───────── tables ───────── */
.toolbar { display: grid; gap: 10px; align-items: end; }
.toolbar .chiprow { grid-column: 1 / -1; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.875rem; }
.table th, .table td { padding: 11px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-soft); }
.table th.r, .table td.r { text-align: right; }
.table thead th { font-size: 0.75rem; font-weight: 600; color: var(--muted); background: #F7F9FA; white-space: nowrap; }
.table tfoot th, .table tfoot td { font-weight: 700; background: #F7F9FA; border-bottom: 0; border-top: 2px solid var(--line); }
.cell-main { display: block; font-weight: 600; overflow-wrap: anywhere; }
.cell-sub { display: block; color: var(--muted); font-size: 0.75rem; }

/* статистика: горизонтальный скролл с закреплённой первой колонкой */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.table-scroll:focus-visible { outline-offset: -3px; }
.table-stats { min-width: 860px; }
.table-stats td { white-space: nowrap; }
.table-stats .sticky-col {
  position: sticky; left: 0; z-index: 1; background: var(--paper);
  min-width: 128px; max-width: 46vw; font-weight: 500; text-align: left;
  box-shadow: 1px 0 0 var(--line-soft), 6px 0 8px -6px rgba(15,42,61,.18);
}
.table-stats thead .sticky-col, .table-stats tfoot .sticky-col { background: #F7F9FA; z-index: 2; }
.table-stats .col-money { color: #6A4E00; font-weight: 700; background: #FFFBEA; }
.table-stats thead .col-money, .table-stats tfoot .col-money { background: #FFF3CC; }
.th-btn {
  all: unset; cursor: pointer; display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px;
  min-height: var(--tap); width: 100%; white-space: nowrap;
}
.table-stats thead th { padding-top: 0; padding-bottom: 0; vertical-align: middle; }
.th-btn:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 4px; }
.sort-ind { font-size: 0.625rem; min-width: 8px; color: var(--sky); }
[aria-sort="ascending"] .th-btn, [aria-sort="descending"] .th-btn { color: var(--ink); }

/* конверсии: на телефоне строки становятся карточками */
.table-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; }
.table-cards tr.conv {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.table-cards td { padding: 0; border: 0; text-align: left; }
.table-cards td.r { text-align: right; }
.table-cards .c-offer { grid-column: 1; grid-row: 1; }
.table-cards .c-pay { grid-column: 2; grid-row: 1; font-family: var(--f-display); font-weight: 600; font-size: 1rem; }
.table-cards .c-time { grid-column: 1; grid-row: 2; color: var(--muted); font-size: 0.8125rem; }
.table-cards .c-status { grid-column: 2; grid-row: 2; text-align: right; }
.table-cards td[data-label]:not(.c-offer):not(.c-pay):not(.c-time):not(.c-status) {
  grid-column: 1 / -1; display: flex; gap: 10px; font-size: 0.8125rem; align-items: center; flex-wrap: wrap;
}
.table-cards td[data-label]:not(.c-offer):not(.c-pay):not(.c-time):not(.c-status)::before {
  content: attr(data-label); color: var(--muted); min-width: 84px;
}
.table-cards .c-click { overflow-wrap: anywhere; }
.conv-rejected .c-pay { color: var(--muted); text-decoration: line-through; }

.account { display: grid; gap: 16px; max-width: 640px; }
.kv-account > div { padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.kv-account > div:last-child { border-bottom: 0; padding-bottom: 0; }
.kv-account dd { font-weight: 600; }

/* ───────── ≥ 768: планшет ───────── */
@media (min-width: 768px) {
  :root { --gut: 24px; }
  h1 { font-size: 1.625rem; }
  .form-row { grid-template-columns: 1fr 1fr; }
  .auth-card { padding: 28px; }
  .auth-title { font-size: 2rem; }
  .metrics { grid-template-columns: repeat(4, 1fr); }
  .metric { padding: 14px 18px; }
  .metric-v { font-size: 1.5rem; }
  .hero { grid-template-columns: 1fr minmax(240px, 34%); align-items: end; padding: 26px 28px; }
  .chiprow { margin: 0; padding: 2px 0; -webkit-mask-image: none; mask-image: none; flex-wrap: wrap; overflow: visible; }
  .period-chips { margin: 0; padding: 2px 0; flex-wrap: wrap; overflow: visible; }
  .filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .filters .search { grid-column: 1 / -1; }
  .filters .chiprow { grid-column: 1 / -1; }
  .selects { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 260px)); }
  .offers { grid-template-columns: 1fr 1fr; }
  .toolbar { grid-template-columns: repeat(2, minmax(0, 260px)) auto; justify-content: start; }
  .toolbar .btn { align-self: end; }
  .sub-grid { grid-template-columns: 1fr 1fr 1fr; }
  .toasts { bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px); }

  .sheet-side {
    left: auto; top: 0; bottom: 0; width: min(560px, 92vw); height: auto; max-height: none;
    border-radius: var(--r-l) 0 0 var(--r-l); animation-name: sheet-left;
  }
  .sheet-side .sheet-grip { display: none; }
  .sheet-side .sheet-head { padding-top: calc(16px + var(--safe-t)); }
  .sheet-menu { left: 50%; right: auto; width: 420px; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px); border-radius: var(--r-l); animation-name: fade-in; }

  /* конверсии — снова таблица */
  .table-cards { display: table; }
  .table-cards thead { display: table-header-group; position: static; width: auto; height: auto; clip: auto; overflow: visible; }
  .table-cards tbody { display: table-row-group; }
  .table-cards tr, .table-cards tr.conv { display: table-row; padding: 0; }
  .table-cards td, .table-cards td[data-label]:not(.c-offer):not(.c-pay):not(.c-time):not(.c-status) {
    display: table-cell; padding: 11px 12px; border-bottom: 1px solid var(--line-soft); font-size: 0.875rem; vertical-align: top;
  }
  .table-cards td[data-label]:not(.c-offer):not(.c-pay):not(.c-time):not(.c-status)::before { content: none; }
  .table-cards .c-time { color: var(--ink); white-space: nowrap; }
  .table-cards .c-status { text-align: left; }
  .table-cards .c-pay { font-size: 0.9375rem; white-space: nowrap; }
  .table-cards .c-click { max-width: 140px; }
}

/* ───────── ≥ 1024: десктоп с боковой рейкой ───────── */
@media (min-width: 1024px) {
  :root { --gut: 32px; }
  .shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); }
  .topbar, .tabbar { display: none; }
  .rail {
    display: flex; flex-direction: column; gap: 24px;
    position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto;
    padding: 22px 16px 18px; background: var(--night); color: #fff;
  }
  .rail .brandmark { padding: 0 8px; font-size: 0.9375rem; }
  .rail-nav { display: grid; gap: 2px; }
  .rail-nav a {
    display: flex; align-items: center; gap: 12px; min-height: var(--tap); padding: 0 12px; border-radius: 12px;
    color: #BFD2DD; text-decoration: none; font-weight: 500;
  }
  .rail-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
  .rail-nav a.is-on { background: rgba(255,255,255,.1); color: #fff; }
  .rail-nav a.is-on .ico { color: var(--gold); }
  .rail-foot { margin-top: auto; display: grid; gap: 12px; }
  .who { display: grid; padding: 0 8px; font-size: 0.8125rem; }
  .who-mail { color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .who-id { color: #8FA8B8; }
  .main { padding: 28px var(--gut) 48px; max-width: 1320px; width: 100%; }
  .main > * + * { margin-top: 20px; }
  .period { top: 0; margin: -28px calc(-1 * var(--gut)) 0; padding: 14px var(--gut); }
  .toasts { bottom: 24px; left: auto; right: 24px; transform: none; }
  .sheet-menu { bottom: 24px; }

  .auth { grid-template-rows: none; grid-template-columns: minmax(380px, 46%) 1fr; }
  .auth-side { padding: 40px 48px; align-content: space-between; gap: 28px; }
  .auth-title { font-size: 2.5rem; max-width: 16ch; }
  .auth-points { display: grid; gap: 14px; }
  .auth-main { padding: 28px 48px; align-content: start; }
  .auth-card { margin-top: 8vh; }

  .cols { grid-template-columns: 1fr 1fr; }
  .cols-links { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
  .filters { grid-template-columns: minmax(0, 1.4fr) auto; align-items: center; }
  .filters .search { grid-column: 1; }
  .filters .selects { grid-column: 2; grid-row: 1; grid-template-columns: 200px 200px; }

}

/* ≥ 1280: офферы — плотные строки-витрина (на 1024–1279 остаются карточки в 2 колонки) */
@media (min-width: 1280px) {
  .offers { grid-template-columns: 1fr; gap: 8px; }
  .offer {
    grid-template-columns: 44px minmax(0, 2fr) minmax(0, 1fr) 150px 320px;
    grid-template-areas:
      "logo id     geo pay act"
      "logo status geo pay act";
    align-items: center; padding: 12px 16px; row-gap: 4px;
  }
  .offer-status { align-self: start; }
  .offer-id { align-self: end; }
  .offer-geo { flex-wrap: nowrap; overflow: hidden; }
  .offer-pay { justify-content: flex-start; }
  .offer-act { display: flex; justify-content: flex-end; }
  .offer-act > .btn:only-child { grid-column: auto; }
  .offer-note { text-align: right; font-size: 0.8125rem; }
}

@media (min-width: 1440px) {
  .hero-sum:not(.hero-sum-long) { font-size: 4.75rem; }
  .offer { grid-template-columns: 44px minmax(0, 2.2fr) minmax(0, 1fr) 170px 340px; }
}

/* узкие телефоны (≤ 374px): ничего не должно вылезать по горизонтали */
@media (max-width: 374px) {
  :root { --gut: 12px; }
  .offer-act { grid-template-columns: 1fr; }
  .selects { grid-template-columns: 1fr; }
  .hero-legend { grid-template-columns: 1fr; }
  .metric-v { font-size: 1.125rem; }
  .langs button { min-width: 44px; padding: 0 8px; }
}

/* ───────── motion ───────── */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-left { from { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .sk { animation: none; }
}
@media (forced-colors: active) {
  .status, .model, .chip[aria-pressed="true"], .tab[aria-selected="true"] { border: 1px solid CanvasText; }
}

/* ═══════════════════════════════════════════════════════════════════
   v3 — «чистая аналитика»: светлая/тёмная тема, Inter, мягкие карточки.
   Слой лежит поверх базовых правил: переопределяет токены и оболочку.
   ═══════════════════════════════════════════════════════════════════ */
:root {
  --mist: #F4F5F7;  --paper: #FFFFFF;
  --ink: #111827;   --muted: #6B7280;
  --line: #E3E6EB;  --line-soft: #EEF0F3;
  --night: #111827; --night-2: #1F2937;
  --strong: #111827; --on-strong: #FFFFFF;
  --sky: #3B6BB3;  --sky-2: #2F5A9A;  --sky-soft: #E8EFF9;
  --gold: #F7D488; --gold-2: #F1C56A; --gold-soft: #FFF6DD;
  --ok: #1F7A4D;   --ok-soft: #DFF4E8;
  --warn: #9A6212; --warn-soft: #FCF0D6;
  --bad: #C2413A;  --bad-soft: #FDE8E5;
  --vio: #5B4BB5;  --vio-soft: #ECE9FA;
  --c-coral: #E5604D; --c-blue: #5F8FD6; --c-grey: #A3ACBA;
  --thead: transparent; --money-bg: #FFF8E4; --money-ink: #7A5A10;
  --sk-a: #E8EBEF; --sk-b: #F3F4F6; --shadow: 0 4px 20px rgba(0, 0, 0, .03);
  --r-m: 16px; --r-l: 20px; --top-h: 64px;
  --f-body: 'Inter', system-ui, -apple-system, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
  --f-display: var(--f-body);
  font-family: var(--f-body);
  font-feature-settings: 'cv11', 'ss01';
}
html, body { background: var(--mist); color: var(--ink); }
h1, h2, h3 { font-family: var(--f-body); letter-spacing: -0.01em; }
h1 { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }

/* базовые компоненты через токены */
.btn { border-color: var(--line); border-radius: 999px; }
.btn-primary { background: var(--strong); border-color: var(--strong); color: var(--on-strong); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #2A1E00; }
.btn-danger-soft { background: var(--bad-soft); color: var(--bad); }
@media (hover: hover) {
  .btn-primary:hover { background: var(--strong); border-color: var(--strong); opacity: .88; }
  .btn-gold:hover { background: var(--gold-2); border-color: var(--gold-2); }
  .btn:hover { border-color: var(--muted); }
}
.input { border-radius: 14px; background: var(--paper); border-color: var(--line); color: var(--ink); }
.chip { border-color: var(--line-soft); box-shadow: var(--shadow); }
.chip[aria-pressed="true"] { background: var(--strong); border-color: var(--strong); color: var(--on-strong); }
.seg { border-radius: 999px; background: var(--line-soft); }
.seg button { border-radius: 999px; }
.seg button[aria-pressed="true"], .tab[aria-selected="true"], .langs button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
.tabs, .langs { background: var(--line-soft); }
.seg-sm button { min-height: 32px; padding: 0 12px; font-size: 0.8125rem; }
.card, .panel, .sec, .offer, .auth-card, .wcard { background: var(--paper); border: 1px solid var(--line-soft); box-shadow: var(--shadow); }
.card, .wcard, .auth-card { border-radius: var(--r-l); }
.card { padding: 18px 20px; min-width: 0; }
.panel, .offer, .sec { border-radius: var(--r-m); }
.note { background: var(--sky-soft); color: var(--ink); }
.note-requested { background: var(--vio-soft); color: var(--ink); }
.note-pending { background: var(--warn-soft); color: var(--ink); }
.note-rejected { background: var(--bad-soft); color: var(--ink); }
.note-info { background: var(--ok-soft); color: var(--ink); }
.link-out { background: var(--gold-soft); border-color: var(--gold); color: var(--ink); }
.sec-link { border: 1px solid var(--gold); }
.model { font-family: var(--f-body); }
.model-cpa, .model-cpl, .model-cpi, .model-cps { background: var(--line-soft); color: var(--ink); }
.logo { background: var(--sky-soft); color: var(--sky); font-family: var(--f-body); }
.pay, .payout-sum, .paycard-sum { font-family: var(--f-body); }
.paycard { background: var(--night); color: #fff; background-image: none; border: 1px solid var(--line); }
.paycard-sum { color: var(--gold); }
.table thead th { background: var(--thead); }
.table tfoot th, .table tfoot td { background: var(--thead); }
.table-stats .col-money, .table-stats thead .col-money, .table-stats tfoot .col-money { background: var(--money-bg); color: var(--money-ink); }
.table-stats .sticky-col { background: var(--paper); }
.table-stats thead .sticky-col, .table-stats tfoot .sticky-col { background: var(--paper); }
.sk { background: linear-gradient(90deg, var(--sk-a) 0%, var(--sk-b) 40%, var(--sk-a) 80%); background-size: 300% 100%; }
.sk-hero { background: linear-gradient(90deg, var(--sk-a), var(--sk-b), var(--sk-a)); background-size: 300% 100%; }
.toast { background: var(--strong); color: var(--on-strong); box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
.toast .ico, .toast-info .ico { color: var(--ok); }
.toast-err { background: var(--bad); color: #fff; }
.toast-err .ico { color: #fff; }
.sheet { background: var(--mist); }
.sheet-grip { background: var(--line); }
.start { border-color: var(--line-soft); }
.start h2 { font-family: var(--f-body); }
.tabbar { background: var(--paper); border-top: 1px solid var(--line-soft); }
.tabbar .is-on { color: var(--ink); }
.tabbar .is-on::before { background: var(--c-blue); }
.mark { background: var(--paper); color: var(--ink); border-radius: 50%; box-shadow: var(--shadow); border: 1px solid var(--line-soft); font-family: var(--f-body); }
.delta.up { color: var(--ok); } .delta.down { color: var(--bad); }
.dot-a { background: var(--c-blue); } .dot-b { background: var(--c-grey); }
.split-bg { fill: var(--line-soft); } .split-a { fill: var(--c-blue); } .split-b { fill: var(--c-grey); }
.share-fg { fill: var(--c-blue); }

/* theme switch */
.theme-sw { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--line-soft); }
.theme-sw button {
  display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); cursor: pointer;
}
.theme-sw button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
.theme-sw .ico { width: 18px; height: 18px; }

/* верхняя панель: поиск, колокольчик, аватар */
.topbar {
  position: sticky; top: 0; z-index: 30; gap: 10px;
  min-height: calc(var(--top-h) + var(--safe-t)); padding-top: var(--safe-t);
  background: var(--mist); color: var(--ink);
}
.topbar .mark { width: 40px; height: 40px; }
.top-search { flex: 1; min-width: 0; max-width: 520px; }
.pill-search {
  display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px; cursor: text;
  border-radius: 9999px; background: var(--paper); box-shadow: var(--shadow); border: 1px solid var(--line-soft); color: var(--muted);
}
.pill-search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 1rem; color: var(--ink); }
.pill-search:focus-within { border-color: var(--c-blue); }
.pill-search input::-webkit-search-cancel-button { display: none; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line-soft); background: var(--paper); color: var(--ink); box-shadow: var(--shadow);
}
.avatar { background: var(--sky-soft); color: var(--sky); border: 1px solid var(--line-soft); font-size: 0.8125rem; letter-spacing: .02em; }
.demo-pill, .demo-tag { background: var(--gold-soft); color: var(--ink); border: 1px solid var(--gold); border-radius: 9999px; font-size: 0.6875rem; font-weight: 700; letter-spacing: .06em; padding: 3px 10px; }

/* сайдбар (≥768) */
.side { display: none; }
.period { background: var(--mist); border-bottom: 0; top: calc(var(--top-h) + var(--safe-t)); }
.period .chip { box-shadow: none; }

/* дашборд */
.dash, .dash-main, .dash-side { display: grid; gap: 16px; min-width: 0; }
.dash-side { align-content: start; }
.kpis { padding: 16px 18px; }
.kpi-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 14px 18px; margin: 0; }
.kpi { min-width: 0; display: grid; gap: 4px; }
.kpi dt { font-size: 0.75rem; color: var(--muted); }
.kpi dd { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; }
.kpi-v { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; }
.kpi .delta { font-size: 0.6875rem; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 6px; }
.dots { margin-left: 8px; color: var(--muted); letter-spacing: 2px; font-weight: 400; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 4px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 2px; border: 0; background: transparent; color: var(--muted); font-size: 0.8125rem; cursor: pointer; }
.legend-item[aria-pressed="false"] { opacity: .45; }
.mk { width: 10px; height: 10px; border-radius: 50%; border: 2px solid currentColor; flex: none; }
.mk-earnings { color: var(--c-coral); } .mk-clicks { color: var(--c-blue); } .mk-conversions { color: var(--c-grey); }
.chart .line { fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.line-earnings { stroke: var(--c-coral); } .line-clicks { stroke: var(--c-blue); } .line-conversions { stroke: var(--c-grey); }
.chart .end, .auth-art .end { fill: var(--paper); stroke-width: 2; }
.end-earnings { stroke: var(--c-coral); } .end-clicks { stroke: var(--c-blue); } .end-conversions { stroke: var(--c-grey); }
.chart .hit { fill: transparent; pointer-events: all; }
@media (hover: hover) { .chart .hit:hover { fill: var(--line-soft); opacity: .5; } }
.chart-note { font-size: 0.75rem; color: var(--muted); }
.chart .grid { stroke: var(--line-soft); } .chart .grid-base { stroke: var(--line); }
.chart text { font-size: 10px; }

.dtable { padding: 8px 12px 12px; }
.tabs-line { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 4px 4px 8px; }
.tline { border: 0; background: transparent; min-height: 36px; padding: 0 14px; border-radius: 9999px; color: var(--muted); font-size: 0.875rem; font-weight: 500; cursor: pointer; }
.tline[aria-selected="true"] { background: var(--mist); color: var(--ink); font-weight: 600; }
.tabs-line .link-more { margin-left: auto; color: var(--muted); }
.table-dash th, .table-dash td { padding: 10px 10px; border-bottom: 1px solid var(--line-soft); }
.table-dash thead th { font-size: 0.6875rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.table-dash tbody th { font-weight: 500; background: transparent; }
.table-dash tbody tr:last-child th, .table-dash tbody tr:last-child td { border-bottom: 0; }
.table-dash .gap-top > * { border-top: 1px solid var(--line); }
.table-dash .col-money { font-weight: 600; }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 9999px; font-size: 0.625rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.q-good { background: var(--ok-soft); color: var(--ok); }
.q-review { background: var(--bad-soft); color: var(--bad); }
.q-neutral { background: var(--warn-soft); color: var(--warn); }
.ulink { all: unset; cursor: pointer; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font-size: 0.8125rem; }
.ulink:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 4px; }
.fresh-dot { display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--c-coral); vertical-align: 2px; }

/* виджеты справа */
.wcard { padding: 16px; display: grid; gap: 12px; min-width: 0; }
.wcard-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wcard-head h2 { font-size: 0.9375rem; }
.wcard-tag { font-size: 0.75rem; color: var(--muted); }
.wcard-sub { font-size: 0.8125rem; color: var(--muted); font-weight: 600; }
.wsub { display: grid; gap: 6px; padding: 12px 14px; border-radius: 14px; background: var(--mist); min-width: 0; }
.wsub-label { font-size: 0.75rem; color: var(--muted); }
.wsub-v { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; }
.wsub-ring { grid-auto-flow: column; grid-template-columns: 1fr auto; align-items: center; }
.ring { width: 48px; height: 48px; }
.ring circle { fill: none; stroke-width: 4; }
.ring-bg { stroke: var(--line); } .ring-fg { stroke: var(--c-coral); stroke-linecap: round; }
.wsub-bars { background: var(--paper); padding: 4px 0 0; }
.minibars { width: 100%; height: auto; display: block; }
.mb { fill: var(--c-blue); opacity: .55; } .mb-zero { opacity: .25; }
.minibars .xlab { fill: var(--muted); font-size: 9px; }
.kvlist, .legend-kv { display: grid; gap: 2px; margin: 0; }
.kvlist > div, .legend-kv > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 5px 2px; font-size: 0.875rem; }
.kvlist dt, .legend-kv dt { color: var(--muted); }
.kvlist dd, .legend-kv dd { margin: 0; display: flex; gap: 6px; align-items: baseline; font-weight: 500; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tile { display: grid; gap: 4px; text-decoration: none; color: var(--ink); justify-items: center; }
.tile-img { display: grid; place-items: center; width: 100%; aspect-ratio: 1; border-radius: 12px; font-weight: 700; font-size: 0.9375rem; color: #1F2937; }
.tint-0 { background: #DCE8F8; } .tint-1 { background: #FBE0DB; } .tint-2 { background: #DDF2E6; } .tint-3 { background: #EEE6FA; }
.tile-cap { font-size: 0.6875rem; color: var(--muted); }

.notif-list { display: grid; gap: 4px; }
.notif-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 8px; border: 0; border-radius: 14px; background: transparent; text-align: left; cursor: pointer; color: var(--ink); }
.notif-text { flex: 1; min-width: 0; }
@media (hover: hover) { .notif-item:hover { background: var(--mist); } }

/* вход / регистрация */
.auth-side { background: var(--paper); color: var(--ink); background-image: none; border-radius: 0 0 24px 24px; box-shadow: var(--shadow); }
.auth-title { font-family: var(--f-body); font-weight: 600; }
.auth-sub { color: var(--muted); }
.auth-points li { color: var(--ink); }
.auth-points .ico { color: var(--c-blue); }
.pt-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--mist); }
.auth-art { width: 100%; height: 90px; }
.auth-card { box-shadow: var(--shadow); }
.avatar-lg { width: 56px; height: 56px; }
.brandmark .mark { width: 36px; height: 36px; }

/* ≥ 768: сайдбар-иконки, верхняя панель в сетке */
@media (min-width: 768px) {
  .shell { display: grid; grid-template-columns: 76px minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 100vh; min-height: 100dvh; }
  .tabbar { display: none; }
  .topbar { display: flex; grid-column: 2; grid-row: 1; padding-left: var(--gut); padding-right: var(--gut); }
  .top-logo { display: none; }
  .main { grid-column: 2; grid-row: 2; max-width: 1640px; width: 100%; padding: 4px var(--gut) 40px; }
  .period { position: static; margin: 0; padding: 0 0 4px; }
  .side {
    display: flex; flex-direction: column; gap: 14px; grid-column: 1; grid-row: 1 / span 2;
    position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; overflow-x: hidden;
    padding: 16px 12px 16px; align-items: stretch;
  }
  .side-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-height: 48px; padding: 0 4px; }
  .side-brand { display: none; font-weight: 600; font-size: 0.9375rem; }
  .rail-nav { display: grid; gap: 4px; }
  .nav-item {
    display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 44px; padding: 0 12px;
    border: 0; border-radius: 16px; background: transparent; color: var(--muted); text-decoration: none;
    font-weight: 500; font-size: 0.9375rem; cursor: pointer; width: 100%;
  }
  .nav-item .nav-label { display: none; }
  .nav-item.is-on { background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
  @media (hover: hover) { .nav-item:hover { color: var(--ink); } }
  .nav-sub { display: grid; gap: 4px; }
  .side-foot { margin-top: auto; display: grid; gap: 10px; justify-items: center; }
  .side-foot .langs-side, .side-foot .who, .side-foot .demo-tag { display: none; }
  .side-row { display: grid; gap: 8px; justify-items: center; }
  .side-row .theme-sw { flex-direction: column; border-radius: 999px; }
  .toasts { bottom: 24px; }
  .dash-side { grid-template-columns: 1fr 1fr; }
  .filters .search .input { border-radius: 9999px; }
}
/* ≥ 1100: полный сайдбар с подписями и подпунктами */
@media (min-width: 1100px) {
  .shell { grid-template-columns: 236px minmax(0, 1fr); }
  .side { padding: 20px 14px 18px; }
  .side-brand { display: inline; }
  .nav-item { justify-content: flex-start; }
  .nav-item .nav-label { display: inline; }
  .nav-subitem { min-height: 38px; padding-left: 44px; font-size: 0.875rem; color: var(--muted); opacity: .85; }
  .side-foot { justify-items: stretch; }
  .side-foot .langs-side { display: inline-flex; justify-self: start; }
  .side-foot .who { display: grid; }
  .side-foot .demo-tag { display: block; text-align: center; }
  .side-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .side-row .theme-sw { flex-direction: row; }
  .side-logout { margin-top: 4px; }
  .who-mail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-size: 0.8125rem; }
  .who-id { color: var(--muted); font-size: 0.75rem; }
  .who { min-width: 0; }
}
/* ≥ 1280: правая колонка виджетов */
@media (min-width: 1280px) {
  .dash { grid-template-columns: minmax(0, 1fr) 304px; align-items: start; gap: 18px; }
  .dash-side { grid-template-columns: 1fr; }
}
/* ≥ 1024: вход — две колонки */
@media (min-width: 1024px) {
  .auth-side { margin: 16px 0 16px 16px; border-radius: 28px; }
}
@media (max-width: 767px) {
  .topbar { padding-left: calc(var(--gut) + var(--safe-l)); padding-right: calc(var(--gut) + var(--safe-r)); }
  .kpi-strip { grid-template-columns: 1fr 1fr; }
  .main { padding-top: 4px; }
  .period { margin: 0 calc(-1 * var(--gut)); padding: 8px var(--gut); }
}

/* уточнения после визуальной проверки */
@media (min-width: 768px) {
  .rail-nav a.nav-item { color: var(--muted); background: transparent; }
  .rail-nav a.nav-item:hover { background: transparent; color: var(--ink); }
  .rail-nav a.nav-item.is-on { background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
  .rail-nav a.nav-item.is-on .ico { color: var(--c-coral); }
}
@media (min-width: 1100px) {
  .rail-nav a.nav-subitem { color: var(--muted); }
  .rail-nav a.nav-subitem.is-on { color: var(--ink); }
}
.kpi-strip { grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); }
.kpi dd { display: grid; gap: 2px; justify-items: start; }
.chart { overflow: visible; }
@media (max-width: 479px) { .demo-pill { display: none; } }
@media (min-width: 1100px) { .rail-nav a.nav-item.nav-subitem { padding-left: 26px; } }

/* подпункты меню выглядят как основные: тот же размер, цвет и иконка, лишь небольшой отступ */
@media (min-width: 1100px) {
  .rail-nav a.nav-item.nav-subitem { min-height: 44px; font-size: 0.9375rem; opacity: 1; padding-left: 12px; }
  .rail-nav a.nav-item.nav-subitem .ico { width: 20px; height: 20px; }
}

/* вход: аккуратная первая страница */
.auth-art { height: 120px; margin: 4px 0; }
.auth-art .line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.auth-copy { display: grid; gap: 12px; }
.auth-title { margin-top: 0; font-size: 1.75rem; line-height: 1.15; max-width: 16ch; }
.auth-sub { font-size: 1rem; line-height: 1.5; max-width: 42ch; }
.auth-points { gap: 10px; }
.auth-points li { padding: 10px 14px; border-radius: 16px; background: var(--mist); }
.auth-card { padding: 22px 20px; gap: 18px; }
@media (min-width: 1024px) {
  .auth-title { font-size: 2.5rem; }
  .auth-art { height: 150px; }
  .auth-main { align-content: center; }
  .auth-card { margin-top: 0; padding: 30px; }
}

/* вход: информационные блоки CPA-сети */
.auth-info { display: grid; gap: 36px; padding: 28px max(16px, var(--safe-l)) calc(40px + var(--safe-b)); max-width: 1240px; margin: 0 auto; }
.info-sec { display: grid; gap: 16px; min-width: 0; }
.info-sec h2 { font-size: 1.375rem; font-weight: 600; text-wrap: balance; }
.info-card { background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--r-l); box-shadow: var(--shadow); padding: 18px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.info-card h3 { font-size: 1rem; }
.info-card p { color: var(--muted); font-size: 0.9375rem; line-height: 1.5; }
.how, .why, .mdl { display: grid; gap: 12px; grid-template-columns: 1fr; }
.how-n { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--strong); color: var(--on-strong); font-weight: 600; font-size: 0.875rem; }
.info-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--sky-soft); color: var(--sky); }
.mdl .info-card { grid-template-columns: auto 1fr; align-items: center; gap: 12px; }
.faq { display: grid; gap: 10px; }
.faq details { padding: 0; gap: 0; }
.faq summary { cursor: pointer; font-weight: 600; padding: 16px 18px; min-height: 48px; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 1.25rem; color: var(--muted); }
.faq details[open] summary::after { content: '−'; }
.faq details p { padding: 0 18px 16px; }
@media (min-width: 640px) { .how, .mdl { grid-template-columns: 1fr 1fr; } .why { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) {
  .auth-info { padding-left: 32px; padding-right: 32px; gap: 48px; }
  .how { grid-template-columns: repeat(4, 1fr); }
  .why { grid-template-columns: repeat(3, 1fr); }
  .mdl { grid-template-columns: repeat(4, 1fr); }
  .mdl .info-card { grid-template-columns: 1fr; align-items: start; }
  .info-sec h2 { font-size: 1.75rem; }
}
.mdl .model { justify-self: start; }

/* вход: современный первый блок */
.auth-side { position: relative; overflow: hidden; }
.auth-side::before {
  content: ''; position: absolute; inset: -30% -20% auto auto; width: 70%; height: 70%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--c-blue) 22%, transparent), transparent);
}
.auth-side::after {
  content: ''; position: absolute; inset: auto auto -30% -20%; width: 60%; height: 60%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--c-coral) 16%, transparent), transparent);
}
.auth-side > * { position: relative; z-index: 1; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; justify-self: start; padding: 6px 12px; border-radius: 9999px; background: var(--mist); border: 1px solid var(--line-soft); font-size: 0.8125rem; font-weight: 600; color: var(--ink); }
.eyebrow-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.preview { position: relative; margin: 8px 0 18px; padding-bottom: 8px; }
.pcard { background: var(--paper); border: 1px solid var(--line-soft); border-radius: 18px; box-shadow: 0 12px 40px rgba(17, 24, 39, .08); }
.pcard-main { padding: 16px 18px 8px; max-width: 460px; }
.pcard-top { display: flex; justify-content: space-between; align-items: center; }
.pcard-label { font-size: 0.8125rem; color: var(--muted); }
.pcard-tag { font-size: 0.6875rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 9999px; background: var(--mist); color: var(--muted); }
.pcard-sum { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 1.625rem; font-weight: 600; letter-spacing: -0.02em; margin-top: 4px; }
.pcard-main .auth-art { height: 96px; margin: 6px 0 0; }
.pcard-float { position: absolute; display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-size: 0.8125rem; }
.pcard-float b { display: block; font-weight: 600; font-size: 0.8125rem; }
.pcard-float small { display: block; color: var(--muted); font-size: 0.6875rem; }
.pcard-float .num { font-weight: 600; margin-left: 6px; }
.pcard-a { right: 0; top: -6px; }
.pcard-b { right: 12%; bottom: -10px; }
.pcard-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.pcard-dot-ok { background: var(--ok); } .pcard-dot-blue { background: var(--c-blue); }
@media (max-width: 767px) { .pcard-a { right: 4px; top: -14px; } .pcard-b { right: 8%; bottom: -16px; } .preview { margin-bottom: 24px; } }
@media (min-width: 1024px) { .pcard-main { max-width: 520px; } .pcard-sum { font-size: 2rem; } .pcard-main .auth-art { height: 120px; } .pcard-a { right: 6%; } .pcard-b { right: 20%; } }

/* ═══ вход: полноширинный современный лендинг ═══ */
.land {
  min-height: 100vh; min-height: 100dvh; position: relative; overflow: hidden;
  background:
    radial-gradient(60% 40% at 85% -5%, color-mix(in srgb, var(--c-blue) 20%, transparent), transparent 70%),
    radial-gradient(50% 35% at 5% 10%, color-mix(in srgb, var(--c-coral) 14%, transparent), transparent 70%),
    var(--mist);
}
.land::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 620px; pointer-events: none; opacity: .55;
  background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 24px 24px;
  -webkit-mask-image: linear-gradient(#000, transparent); mask-image: linear-gradient(#000, transparent);
}
.land > * { position: relative; }
.land-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  max-width: 1240px; margin: 0 auto; padding: calc(14px + var(--safe-t)) max(16px, var(--safe-r)) 10px max(16px, var(--safe-l));
}
.land-links { display: none; gap: 4px; }
.land-link { border: 0; background: transparent; padding: 0 14px; min-height: 40px; border-radius: 9999px; color: var(--muted); font-weight: 500; font-size: 0.9375rem; cursor: pointer; }
@media (hover: hover) { .land-link:hover { background: var(--paper); color: var(--ink); } }
.land-tools { display: flex; align-items: center; gap: 8px; }
.land-hero {
  display: grid; gap: 28px; align-items: center;
  max-width: 1240px; margin: 0 auto; padding: 20px max(16px, var(--safe-r)) 8px max(16px, var(--safe-l));
}
.hero-copy { display: grid; gap: 16px; align-content: start; min-width: 0; }
.land-title {
  font-size: clamp(2.125rem, 8vw, 3.75rem); line-height: 1.05; letter-spacing: -0.035em; font-weight: 700; text-wrap: balance;
  color: var(--ink);
  background: linear-gradient(100deg, var(--ink) 40%, var(--c-blue) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.land-sub { font-size: 1.0625rem; line-height: 1.55; color: var(--muted); max-width: 46ch; }
.land-points { display: grid; gap: 10px; max-width: 460px; }
.land-points li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 9999px; background: var(--paper); border: 1px solid var(--line-soft); box-shadow: var(--shadow); font-size: 0.9375rem; }
.land .auth-card { margin: 0; max-width: 460px; width: 100%; border-radius: 28px; padding: 24px; box-shadow: 0 24px 60px rgba(17, 24, 39, .10); justify-self: center; }
.land-preview {
  display: grid; gap: 12px; grid-template-columns: 1fr 1fr; max-width: 1240px; margin: 28px auto 0;
  padding: 0 max(16px, var(--safe-r)) 8px max(16px, var(--safe-l)); position: relative;
}
.land-preview .pcard-main { grid-column: 1 / -1; max-width: none; padding: 18px 20px 10px; }
.land-preview .pcard-main .auth-art { height: 130px; }
.pcard-kpi { padding: 14px 16px; display: grid; gap: 4px; }
.pcard-kpi b { font-size: 1.375rem; font-weight: 600; letter-spacing: -0.02em; }
.pcard-kpi:nth-of-type(3) { grid-column: 1 / -1; }
.land-preview .pcard-a { right: 20px; top: -18px; }
.auth-info { padding-top: 48px; }
@media (min-width: 768px) {
  .land-links { display: flex; }
  .land-preview { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .land-preview .pcard-main { grid-column: 1; grid-row: 1; }
  .pcard-kpi:nth-of-type(3) { grid-column: auto; }
  .land-preview .pcard-main .auth-art { height: 150px; }
}
@media (min-width: 1024px) {
  .land-hero { grid-template-columns: minmax(0, 1.15fr) minmax(380px, 460px); gap: 56px; padding-top: 48px; }
  .land-preview { margin-top: 56px; }
}
.auth-info { padding-left: max(16px, var(--safe-l)); padding-right: max(16px, var(--safe-r)); }
@media (min-width: 1024px) { .auth-info { padding-left: max(16px, var(--safe-l)); padding-right: max(16px, var(--safe-r)); } }
@media (min-width: 768px) { .land-preview .pcard-a { display: none; } }
.land-preview { grid-template-columns: repeat(3, 1fr); }
.pcard-kpi:nth-of-type(3) { grid-column: auto; }
.pcard-kpi { padding: 12px 12px; } .pcard-kpi b { font-size: 1.125rem; }
@media (min-width: 768px) { .land-preview { grid-template-columns: 2fr 1fr 1fr 1fr; } .pcard-kpi { padding: 14px 16px; } .pcard-kpi b { font-size: 1.375rem; } }

/* главная: объяснение для тех, кто не знает CPA */
.plain-text { font-size: 1.0625rem; line-height: 1.6; color: var(--muted); max-width: 70ch; }
.flow { display: grid; gap: 12px; grid-template-columns: 1fr; }
.example { background: var(--sky-soft); border-color: transparent; gap: 10px; }
.ex-list { display: grid; gap: 6px; }
.ex-list li { position: relative; padding-left: 20px; }
.ex-list li::before { content: ''; position: absolute; left: 4px; top: 0.6em; width: 6px; height: 6px; border-radius: 50%; background: var(--c-blue); }
.ex-total { font-size: 1.25rem; font-weight: 700; color: var(--ink) !important; letter-spacing: -0.01em; }
.ex-note { font-size: 0.8125rem !important; }
.who { display: grid; gap: 12px; grid-template-columns: 1fr; }
.who .info-card { grid-template-columns: auto 1fr; align-items: center; gap: 12px; }
.who .info-card p { color: var(--ink); font-weight: 500; }
.gloss { display: grid; gap: 12px; grid-template-columns: 1fr; margin: 0; }
.gloss dt { font-weight: 600; font-size: 1rem; }
.gloss dd { margin: 0; color: var(--muted); font-size: 0.9375rem; line-height: 1.5; }
@media (min-width: 640px) { .who, .gloss { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .flow { grid-template-columns: repeat(3, 1fr); } .who { grid-template-columns: repeat(4, 1fr); } .gloss { grid-template-columns: repeat(3, 1fr); } }

@media (min-width: 768px) and (max-width: 1179px) { .land-links { display: none; } }
@media (min-width: 1180px) { .land-links { display: flex; } }
.side-row .who { flex: 1; min-width: 0; padding: 0 4px; }

/* логотип Teliks */
.mark, .topbar .mark, .brandmark .mark { background: none; border: 0; box-shadow: none; border-radius: 0; width: auto; height: auto; padding: 0; }
.logo-svg { display: block; width: 38px; height: 38px; }
.topbar .logo-svg { width: 40px; height: 40px; }
.brandmark, .side-logo { font-weight: 700; letter-spacing: -0.02em; font-size: 1.125rem; }
.side-brand { font-size: 1.125rem; letter-spacing: -0.02em; }
.who { grid-template-columns: minmax(0, 1fr); }
.who-mail { max-width: 100%; }

/* финансы */
.fin-kpis { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; padding: 16px 18px; }
.fin-kpi { display: grid; gap: 4px; min-width: 0; padding: 12px 14px; border-radius: 14px; background: var(--mist); }
.fin-kpi b { font-size: 1.375rem; font-weight: 600; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.fin-label { font-size: 0.8125rem; color: var(--muted); }
.fin-hint { font-size: 0.75rem; color: var(--muted); }
.fin-kpi.is-ok { background: var(--ok-soft); } .fin-kpi.is-ok b { color: var(--ok); }
.fin-kpi.is-warn { background: var(--warn-soft); } .fin-kpi.is-bad { background: var(--bad-soft); }
.fin-table { padding: 16px 12px 12px; display: grid; gap: 8px; }
.fin-table h2 { padding: 0 8px; font-size: 1rem; }
.fin-table .col-money { font-weight: 600; background: transparent; color: var(--ink); }
.fin-table tfoot th, .fin-table tfoot td { font-weight: 700; border-top: 1px solid var(--line); }
@media (min-width: 900px) { .fin-kpis { grid-template-columns: repeat(4, 1fr); } }

.fin-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
.fin-box { padding: 16px 18px; display: grid; gap: 12px; align-content: start; }
.fin-box h2 { font-size: 1rem; }
.fin-box form { display: grid; gap: 12px; }
@media (min-width: 900px) { .fin-grid { grid-template-columns: 1fr 1fr; } }
