/* =====================================================================
   OmborX · Кабинет партнёра — оформление (редизайн 12.10.2026, v16)

   Образ: «тёмный лес и бумага». Слева — постоянная тёмно-зелёная полоса
   (меню, кто вы и ваша ставка), справа — светлая «бумага» с цифрами.
   Тёмная полоса есть и в светлой теме: она держит рамку кабинета и не даёт
   ему превратиться в набор одинаковых белых карточек.

   Смелость — в одном месте: денежные суммы и названия разделов набраны
   широким Unbounded. Всё остальное — спокойный Onest, без украшений.

   Шрифты: Onest (текст и интерфейс), Unbounded (суммы, заголовки разделов,
   промокод). Оба с кириллицей. Нет связи с Google Fonts — системный шрифт,
   вёрстка от этого не ломается.

   Тёмная тема — html[data-theme="dark"], включается в профиле, системную
   настройку намеренно не слушаем (см. app.js).
   ===================================================================== */

:root{
  /* Бумага и поверхности */
  --bg:#F1F4EF;
  --bg2:#E8EDE6;
  --panel:#FFFFFF;
  --panel2:#F6F8F4;
  --panel3:#ECF0EA;
  --line:#DDE4DB;
  --line2:#C9D3C7;

  /* Текст */
  --text:#13211B;
  --dim:#56665E;
  --dim2:#84928A;

  /* Лесная полоса: меню, баланс, экран входа */
  --rail:#0F2A21;
  --rail2:#163629;
  --rail3:#1E4535;
  --rail-text:#E6F1EA;
  --rail-dim:#9DB7A9;
  --rail-line:rgba(230,241,234,.12);

  /* Деньги и бренд */
  --acc:#0B8A52;
  --acc-ink:#086B40;
  --acc-soft:#E0F2E8;
  --acc-edge:#A9D9BE;
  --acc-bright:#5BDC9E;            /* зелёный на тёмной полосе */
  --on-acc:#FFFFFF;

  /* Сигналы */
  --warn:#B4770A;
  --warn-soft:#FBF0D9;
  --bad:#C03A24;
  --bad-soft:#FBE5E0;
  --blue:#1F62A3;
  --blue-soft:#E2ECF7;
  --purple:#6A47B8;
  --purple-soft:#ECE6F7;
  --teal:#0D7F7A;
  --teal-soft:#DDF1EF;

  --f-text:"Onest",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,system-ui,sans-serif;
  --f-wide:"Unbounded","Onest",-apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,sans-serif;
  --f-mono:"SF Mono",ui-monospace,Menlo,Consolas,monospace;

  --r-xs:8px; --r-sm:10px; --r:14px; --r-lg:18px; --r-xl:22px;
  --tap:44px;
  --side:252px;
  --safe-b:min(env(safe-area-inset-bottom, 0px), 34px);
  --safe-t:min(env(safe-area-inset-top, 0px), 64px);
  --shadow:0 18px 40px -18px rgba(15,42,33,.35), 0 2px 6px rgba(15,42,33,.06);
  --shadow-sm:0 1px 2px rgba(15,42,33,.06);
  --focus:0 0 0 3px rgba(11,138,82,.28);
}

html[data-theme="dark"]{
  --bg:#0B1411;
  --bg2:#0F1A16;
  --panel:#13201B;
  --panel2:#172620;
  --panel3:#1D2F27;
  --line:#22352C;
  --line2:#2E4539;

  --text:#E7F0EA;
  --dim:#9AAEA3;
  --dim2:#6E8378;

  --rail:#07100C;
  --rail2:#0E1C16;
  --rail3:#163026;
  --rail-text:#E7F0EA;
  --rail-dim:#8CA698;
  --rail-line:rgba(231,240,234,.09);

  --acc:#3CCB8A;
  --acc-ink:#5BDC9E;
  --acc-soft:rgba(60,203,138,.14);
  --acc-edge:rgba(60,203,138,.34);
  --acc-bright:#5BDC9E;
  --on-acc:#04140C;

  --warn:#E5AE52;
  --warn-soft:rgba(229,174,82,.14);
  --bad:#EE7A63;
  --bad-soft:rgba(238,122,99,.14);
  --blue:#6AAEE6;
  --blue-soft:rgba(106,174,230,.14);
  --purple:#B49AF0;
  --purple-soft:rgba(180,154,240,.15);
  --teal:#4FCBC4;
  --teal-soft:rgba(79,203,196,.14);

  --shadow:0 18px 44px -16px rgba(0,0,0,.6);
  --shadow-sm:0 1px 2px rgba(0,0,0,.4);
  --focus:0 0 0 3px rgba(60,203,138,.32);
}

/* ---------------------------------------------------------------------
   Основа
   --------------------------------------------------------------------- */

*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
/* Прокручивается только область раздела: меню и шапка всегда на месте,
   а на телефоне не скачет адресная строка браузера. */
html,body{margin:0;padding:0;height:100%;overflow:hidden}
body{
  background:var(--bg);
  color:var(--text);
  font:400 14px/1.5 var(--f-text);
  font-feature-settings:"tnum" 0;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  overscroll-behavior-y:none;
}
button,input,select,textarea{font:inherit;color:inherit}
button{background:none;border:0;padding:0;cursor:pointer}
a{color:var(--acc-ink);text-decoration:none}
a:hover{text-decoration:underline}
h1,h2,h3,h4,p{margin:0}
[hidden]{display:none !important}
.num{font-variant-numeric:tabular-nums}
:focus-visible{outline:none;box-shadow:var(--focus);border-radius:var(--r-xs)}
::selection{background:var(--acc-soft)}

/* ---------------------------------------------------------------------
   Вход и заявка: слева лесная полоса с объяснением, справа форма
   --------------------------------------------------------------------- */

.auth{
  height:100%;overflow-y:auto;
  /* Центрирование через margin:auto у .auth-wrap, а не align-items:center:
     иначе длинная форма регистрации обрезается сверху без прокрутки. */
  display:flex;align-items:stretch;justify-content:center;
  background:var(--bg);
}
.auth-wrap{
  width:100%;min-height:100%;display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);
}
.auth-pitch{
  background:var(--rail);color:var(--rail-text);
  padding:calc(44px + var(--safe-t)) clamp(28px,5vw,72px) 44px;
  display:flex;flex-direction:column;justify-content:center;gap:0;
  position:relative;overflow:hidden;
}
/* Сетка-«миллиметровка» на полосе входа: ведомость, по которой считаются
   деньги партнёра. Тонко, чтобы не спорить с текстом. */
.auth-pitch::before{
  content:"";position:absolute;inset:0;pointer-events:none;opacity:.5;
  background-image:
    linear-gradient(var(--rail-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--rail-line) 1px, transparent 1px);
  background-size:44px 44px;
  mask-image:linear-gradient(120deg, transparent 10%, #000 60%);
  -webkit-mask-image:linear-gradient(120deg, transparent 10%, #000 60%);
}
.auth-pitch > *{position:relative;max-width:520px}
.auth-pitch .brand{display:flex;align-items:center;gap:12px;margin-bottom:44px}
.auth-pitch .brand-sub{color:var(--rail-dim)}
.auth-pitch h2{
  font-family:var(--f-wide);font-weight:600;font-size:clamp(26px,2.6vw,36px);
  line-height:1.16;letter-spacing:-.6px;margin-bottom:18px;
}
.auth-pitch p{color:var(--rail-dim);font-size:15px;line-height:1.6;max-width:460px}
.auth-points{margin-top:34px;display:flex;flex-direction:column;gap:0;border-top:1px solid var(--rail-line)}
.auth-point{display:flex;gap:14px;align-items:flex-start;padding:15px 0;border-bottom:1px solid var(--rail-line)}
.auth-point i{
  flex:0 0 30px;height:30px;border-radius:9px;background:var(--rail3);color:var(--acc-bright);
  display:flex;align-items:center;justify-content:center;font-style:normal;
}
.auth-point i svg{width:16px;height:16px;fill:currentColor}
.auth-point b{display:block;font-size:14px;font-weight:600;color:var(--rail-text);margin-bottom:2px}
.auth-point span{color:var(--rail-dim);font-size:13px;line-height:1.5}

.auth-box{
  align-self:center;justify-self:center;width:100%;max-width:440px;
  margin:calc(32px + var(--safe-t)) auto calc(32px + var(--safe-b));
  padding:0 28px;
}
.auth-box h1{font-family:var(--f-wide);font-weight:600;font-size:24px;letter-spacing:-.4px;line-height:1.2;margin-bottom:8px}
.auth-sub{color:var(--dim);font-size:14px;line-height:1.5;margin-bottom:26px}
.auth-note{margin-top:14px;font-size:13px;color:var(--dim);min-height:20px;text-align:center}
.auth-note.bad{color:var(--bad)}
.auth-note.ok{color:var(--acc-ink)}
.auth-switch{margin-top:14px;text-align:center;font-size:13.5px;color:var(--dim)}
.auth-switch button{color:var(--acc-ink);font-weight:600;padding:4px 2px}
.auth-switch button:hover{text-decoration:underline}
.auth-head{display:none}

.logo-badge{
  width:40px;height:40px;border-radius:12px;flex:0 0 40px;
  background:var(--acc);color:#fff;
  display:flex;align-items:center;justify-content:center;
}
.logo-badge svg{width:22px;height:22px;fill:currentColor}
.brand-name{font-family:var(--f-wide);font-weight:600;font-size:16px;letter-spacing:-.2px;line-height:1.2}
.brand-sub{color:var(--dim);font-size:12px;margin-top:1px}

/* ---------------------------------------------------------------------
   Поля и кнопки
   --------------------------------------------------------------------- */

.field{display:block;margin-bottom:14px}
.field > span{display:block;color:var(--text);font-size:13px;font-weight:500;margin-bottom:6px}
.field input,.field select,.field textarea{
  width:100%;background:var(--panel);border:1px solid var(--line2);color:var(--text);
  border-radius:var(--r-sm);padding:11px 13px;font-size:15px;min-height:var(--tap);
  transition:border-color .15s, box-shadow .15s;
}
.field select{
  -webkit-appearance:none;appearance:none;padding-right:38px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2384928A'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 10px center;background-size:20px;
}
.field textarea{min-height:92px;resize:vertical;line-height:1.5}
.field input:focus,.field select:focus,.field textarea:focus{outline:none;border-color:var(--acc);box-shadow:var(--focus)}
.field input::placeholder,.field textarea::placeholder{color:var(--dim2)}
.field .hint{color:var(--dim2);font-size:12px;margin-top:6px;display:block;line-height:1.45}
.field-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}

.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  background:var(--panel);border:1px solid var(--line2);color:var(--text);
  padding:0 16px;height:var(--tap);border-radius:var(--r-sm);font-size:14px;font-weight:600;
  white-space:nowrap;transition:background .15s, border-color .15s, color .15s;
}
.btn:hover{border-color:var(--dim2);background:var(--panel2)}
.btn:disabled{opacity:.5;cursor:default}
.btn:disabled:hover{border-color:var(--line2);background:var(--panel)}
.btn svg{width:16px;height:16px;fill:currentColor;flex:0 0 16px}
.btn-primary{background:var(--acc);border-color:var(--acc);color:var(--on-acc)}
.btn-primary:hover{background:var(--acc-ink);border-color:var(--acc-ink)}
.btn-primary:disabled:hover{background:var(--acc);border-color:var(--acc)}
html[data-theme="dark"] .btn-primary:hover{background:var(--acc-bright);border-color:var(--acc-bright)}
.btn-ghost{background:transparent;border-color:transparent}
.btn-soft{background:var(--acc-soft);border-color:transparent;color:var(--acc-ink)}
.btn-soft:hover{background:var(--acc-soft);border-color:var(--acc-edge)}
.btn-bad{background:var(--bad-soft);border-color:transparent;color:var(--bad)}
.btn-bad:hover{background:var(--bad-soft);border-color:var(--bad)}
.btn-sm{height:34px;padding:0 12px;font-size:13px;border-radius:9px}
.btn-block{width:100%}
.btn-lg{height:52px;font-size:15.5px;border-radius:12px}

/* ---------------------------------------------------------------------
   Оболочка: лесная полоса меню + «бумага» раздела
   --------------------------------------------------------------------- */

.shell{display:flex;height:100%}

.side{
  width:var(--side);flex:0 0 var(--side);
  background:var(--rail);color:var(--rail-text);
  padding:calc(20px + var(--safe-t)) 14px calc(16px + var(--safe-b));
  height:100%;overflow-y:auto;
  display:flex;flex-direction:column;gap:22px;
}
.side-brand{display:flex;align-items:center;gap:11px;padding:2px 8px}
.side-brand .brand-sub{color:var(--rail-dim)}
.nav{display:flex;flex-direction:column;gap:2px}
.nav button{
  position:relative;display:flex;align-items:center;gap:12px;width:100%;
  padding:11px 12px;border-radius:10px;color:var(--rail-dim);font-weight:500;font-size:14.5px;text-align:left;
  transition:background .15s, color .15s;
}
.nav button svg{width:19px;height:19px;flex:0 0 19px;fill:currentColor}
.nav button:hover{background:var(--rail2);color:var(--rail-text)}
.nav button.active{background:var(--rail3);color:var(--rail-text);font-weight:600}
.nav button.active svg{color:var(--acc-bright)}
.nav button.active::before{
  content:"";position:absolute;left:-14px;top:9px;bottom:9px;width:3px;border-radius:0 3px 3px 0;background:var(--acc-bright);
}
.nav-badge{
  margin-left:auto;min-width:22px;height:22px;padding:0 7px;border-radius:11px;
  background:#F2B33D;color:#2A1A00;font-size:11.5px;font-weight:700;
  display:flex;align-items:center;justify-content:center;
}

/* Карточка партнёра внизу меню: ставка — главное, что он о себе помнит. */
.side-card{
  margin-top:auto;border-top:1px solid var(--rail-line);padding:16px 8px 0;font-size:13px;
}
.side-card .who{font-weight:600;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--rail-text)}
.side-card .role{color:var(--rail-dim);font-size:12.5px;margin-top:2px}
.side-card .rate{margin-top:14px;display:flex;align-items:baseline;gap:9px}
.side-card .rate b{font-family:var(--f-wide);font-size:30px;font-weight:600;color:var(--acc-bright);letter-spacing:-.8px;line-height:1}
.side-card .rate span{color:var(--rail-dim);font-size:12.5px;line-height:1.3}
.side-card .btn{
  margin-top:16px;background:transparent;border-color:var(--rail-line);color:var(--rail-dim);
}
.side-card .btn:hover{background:var(--rail2);color:var(--rail-text);border-color:var(--rail-line)}

.body{flex:1;min-width:0;display:flex;flex-direction:column;height:100%;overflow:hidden}
.topbar{
  flex:0 0 auto;z-index:20;background:var(--bg);
  padding:calc(22px + var(--safe-t)) 32px 18px;
  display:flex;align-items:center;gap:14px;
  border-bottom:1px solid var(--line);
}
.topbar h1{font-family:var(--f-wide);font-size:23px;font-weight:600;letter-spacing:-.5px;line-height:1.2}
.topbar .sub{color:var(--dim);font-size:13.5px;margin-top:3px}
.topbar-actions{margin-left:auto;display:flex;align-items:center;gap:8px}
.topbar-actions .btn{width:40px;height:40px;padding:0}
.menu-btn{display:none}

.view{flex:1;min-width:0;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:24px 32px calc(48px + var(--safe-b))}
.view > *{max-width:1240px}
.view > section{margin-bottom:22px}
.view > section:last-child{margin-bottom:0}

/* ---------------------------------------------------------------------
   Сетки и карточки
   --------------------------------------------------------------------- */

.grid{display:grid;gap:16px}
.g4{grid-template-columns:repeat(4,minmax(0,1fr))}
.g3{grid-template-columns:repeat(3,minmax(0,1fr))}
.g2{grid-template-columns:repeat(2,minmax(0,1fr))}
.g21{grid-template-columns:minmax(0,2fr) minmax(0,1fr)}
.g12{grid-template-columns:minmax(0,1fr) minmax(0,2fr)}

.card{
  background:var(--panel);border:1px solid var(--line);border-radius:var(--r);
  padding:20px 22px;min-width:0;
}
.card.card-pad0{padding:0;overflow:hidden}
.card h2{
  font-size:15.5px;font-weight:600;margin-bottom:14px;line-height:1.35;
  display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;
}
.card h2 .hint{color:var(--dim2);font-weight:400;font-size:13px}
.card h2 .right{margin-left:auto;display:flex;gap:8px;align-items:center;align-self:center}
.card-head{padding:18px 22px 4px}
.card-head h2{margin-bottom:10px}
.card-body{padding:14px 22px 18px}

/* Плитка показателя. Стоит отдельной карточкой или в полосе .stats. */
.kpi{display:flex;flex-direction:column;gap:2px;min-width:0}
.kpi .label{color:var(--dim);font-size:13px;font-weight:500}
.kpi .value{
  font-family:var(--f-wide);font-size:27px;font-weight:600;letter-spacing:-.8px;line-height:1.15;
  margin-top:6px;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.kpi .value small{font-family:var(--f-text);font-size:14px;color:var(--dim);font-weight:500;letter-spacing:0;margin-left:2px}
.kpi .foot{font-size:12.5px;color:var(--dim2);margin-top:8px;line-height:1.5}
.kpi .foot .up{color:var(--acc-ink);font-weight:600}
.kpi .foot .down{color:var(--bad);font-weight:600}
.kpi-acc .value{color:var(--acc-ink)}

/* Полоса показателей: одна рамка, ячейки разделены линиями. Так четыре
   числа читаются как одна сводка, а не как четыре разных блока. */
.stats{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));
  background:var(--panel);border:1px solid var(--line);border-radius:var(--r);overflow:hidden;
}
.stats > .kpi,.stats > .card.kpi{
  border:0;border-radius:0;background:transparent;padding:18px 22px 18px;
  border-left:1px solid var(--line);
}
.stats > .kpi:first-child{border-left:0}
.stats > .kpi-acc{background:linear-gradient(180deg,var(--acc-soft),transparent 85%)}

/* ---------------------------------------------------------------------
   Баланс на «Обзоре»: лесная полоса с суммой к выплате
   --------------------------------------------------------------------- */

.bal{
  background:var(--rail);color:var(--rail-text);border-radius:var(--r-lg);
  display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);overflow:hidden;
}
html[data-theme="dark"] .bal{border:1px solid var(--line)}
.bal-main{padding:26px 28px 24px;display:flex;flex-direction:column;gap:0;min-width:0}
.bal-label{color:var(--rail-dim);font-size:13.5px;font-weight:500}
.bal-sum{
  font-family:var(--f-wide);font-weight:600;font-size:clamp(32px,4vw,46px);letter-spacing:-1.4px;
  line-height:1.1;margin-top:8px;color:var(--acc-bright);font-variant-numeric:tabular-nums;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.bal-sum small{font-family:var(--f-text);font-size:17px;font-weight:500;color:var(--rail-dim);letter-spacing:0;margin-left:6px}
.bal-sub{color:var(--rail-dim);font-size:13px;margin-top:6px}
/* Линейка до минимальной выплаты: деления по четвертям, заливка — набранное */
.bal-ruler{margin-top:22px}
.bal-track{position:relative;height:10px;border-radius:99px;background:var(--rail3);overflow:hidden}
.bal-track i{position:absolute;left:0;top:0;bottom:0;border-radius:99px;background:var(--acc-bright);transition:width .5s cubic-bezier(.2,.7,.2,1)}
.bal-track::after{
  content:"";position:absolute;inset:0;pointer-events:none;
  background:linear-gradient(90deg,transparent calc(25% - 1px),var(--rail) calc(25% - 1px),var(--rail) 25%,transparent 25%,
    transparent calc(50% - 1px),var(--rail) calc(50% - 1px),var(--rail) 50%,transparent 50%,
    transparent calc(75% - 1px),var(--rail) calc(75% - 1px),var(--rail) 75%,transparent 75%);
}
.bal-ticks{display:flex;justify-content:space-between;margin-top:8px;color:var(--rail-dim);font-size:12px;font-variant-numeric:tabular-nums}
.bal-act{margin-top:20px;display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.bal-act .btn-primary{background:var(--acc-bright);border-color:var(--acc-bright);color:#04140C}
.bal-act .btn-primary:hover{background:#7EE8B5;border-color:#7EE8B5}
.bal-act .btn-primary:disabled{background:var(--rail3);border-color:var(--rail3);color:var(--rail-dim);opacity:1}
.bal-why{color:var(--rail-dim);font-size:13px;line-height:1.5;max-width:420px}
.bal-side{background:var(--rail2);padding:22px 26px;display:flex;flex-direction:column;justify-content:center;min-width:0}
.bal-line{display:flex;justify-content:space-between;align-items:baseline;gap:12px;padding:12px 0;border-bottom:1px solid var(--rail-line)}
.bal-line:last-child{border-bottom:0}
.bal-line span{color:var(--rail-dim);font-size:13.5px}
.bal-line b{font-family:var(--f-wide);font-weight:500;font-size:17px;letter-spacing:-.3px;white-space:nowrap;font-variant-numeric:tabular-nums}
.bal-line b small{font-family:var(--f-text);font-size:12.5px;color:var(--rail-dim);font-weight:500;letter-spacing:0;margin-left:3px}

/* ---------------------------------------------------------------------
   Таблицы и списки
   --------------------------------------------------------------------- */

.table-wrap{overflow-x:auto}
table.data{width:100%;border-collapse:collapse;font-size:14px}
table.data th{
  color:var(--dim);text-align:left;font-weight:500;font-size:12.5px;
  padding:10px 16px;border-bottom:1px solid var(--line);white-space:nowrap;
  position:sticky;top:0;background:var(--panel2);z-index:1;
}
table.data td{padding:13px 16px;border-bottom:1px solid var(--line);vertical-align:middle}
table.data tr:last-child td{border-bottom:0}
table.data tbody tr{cursor:default}
table.data tbody tr.clickable{cursor:pointer}
table.data tbody tr.clickable:hover td{background:var(--panel2)}
table.data td.num,table.data th.num{text-align:right;font-variant-numeric:tabular-nums}
.cell-main{font-weight:600}
.cell-sub{color:var(--dim2);font-size:12.5px;margin-top:2px}

.rows{display:flex;flex-direction:column}
.row{
  display:flex;align-items:center;gap:13px;padding:13px 18px;
  border-bottom:1px solid var(--line);min-height:58px;text-align:left;width:100%;
}
.row:last-child{border-bottom:0}
.row.tap{transition:background .12s}
.row.tap:hover,button.row:hover{background:var(--panel2)}
.row-main{min-width:0;flex:1}
.row-title{font-weight:600;font-size:14.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.row-sub{color:var(--dim2);font-size:12.5px;margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.row-right{text-align:right;flex:0 0 auto}
.row-value{font-weight:600;font-variant-numeric:tabular-nums}
.row-chev{flex:0 0 16px;color:var(--dim2)}
.row-chev svg{width:16px;height:16px;fill:currentColor}
.row-ava{
  flex:0 0 40px;height:40px;border-radius:12px;background:var(--acc-soft);color:var(--acc-ink);
  display:flex;align-items:center;justify-content:center;font-family:var(--f-wide);font-weight:600;font-size:15px;
}

/* ---------------------------------------------------------------------
   Чипы, переключатели, заметки
   --------------------------------------------------------------------- */

.chip{display:inline-flex;align-items:center;gap:6px;padding:3px 10px;border-radius:99px;font-size:12px;font-weight:600;white-space:nowrap;line-height:1.5}
.chip i{width:6px;height:6px;border-radius:99px;background:currentColor;display:block}
.chip-ok{background:var(--acc-soft);color:var(--acc-ink)}
.chip-warn{background:var(--warn-soft);color:var(--warn)}
.chip-bad{background:var(--bad-soft);color:var(--bad)}
.chip-blue{background:var(--blue-soft);color:var(--blue)}
.chip-purple{background:var(--purple-soft);color:var(--purple)}
.chip-dim{background:var(--panel3);color:var(--dim)}

/* Переключатель: выбранный пункт — тёмный, как полоса меню. */
.seg{
  display:inline-flex;background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:4px;gap:2px;
  flex-wrap:wrap;max-width:100%;
}
.seg button{padding:8px 14px;border-radius:9px;color:var(--dim);font-size:13.5px;font-weight:500;white-space:nowrap;transition:background .15s,color .15s}
.seg button:hover{color:var(--text);background:var(--panel2)}
.seg button.active{background:var(--rail);color:var(--rail-text);font-weight:600}
html[data-theme="dark"] .seg button.active{background:var(--acc-soft);color:var(--acc-ink)}

.muted{color:var(--dim)}
.muted2{color:var(--dim2)}
.small{font-size:12.5px}
.mono{font-family:var(--f-mono);font-size:.94em}
.flex{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.spread{justify-content:space-between}
.mt{margin-top:16px}
.mt-sm{margin-top:8px}

.empty{color:var(--dim);padding:44px 24px;text-align:center;font-size:14px;line-height:1.55}
.empty svg{width:36px;height:36px;fill:var(--dim2);opacity:.6;margin-bottom:12px}
.empty b{display:block;color:var(--text);font-size:15.5px;margin-bottom:6px;font-weight:600}
.empty div{max-width:420px;margin:0 auto}

.notice{
  border:1px solid transparent;background:var(--warn-soft);
  border-radius:var(--r);padding:14px 18px;font-size:14px;line-height:1.55;
  display:flex;gap:12px;align-items:flex-start;
}
.notice svg{width:19px;height:19px;fill:var(--warn);flex:0 0 19px;margin-top:2px}
.notice-ok{background:var(--acc-soft)}
.notice-ok svg{fill:var(--acc-ink)}
.notice b{display:block;margin-bottom:2px;font-weight:600}
.view > section > .notice + .notice{margin-top:10px}

.progress{background:var(--panel3);border-radius:99px;height:8px;overflow:hidden}
.progress i{display:block;height:100%;border-radius:99px;background:var(--acc);transition:width .4s}

/* Пары «название — значение» в карточке условий */
.facts{display:flex;flex-direction:column}
.facts > div{display:flex;justify-content:space-between;align-items:baseline;gap:14px;padding:11px 0;border-bottom:1px solid var(--line)}
.facts > div:last-child{border-bottom:0}
.facts span{color:var(--dim)}
.facts b{font-weight:600;text-align:right}

/* ---------------------------------------------------------------------
   Ссылка, QR, промокод
   --------------------------------------------------------------------- */

.copy-row{
  display:flex;align-items:center;gap:8px;background:var(--panel2);
  border:1px solid var(--line2);border-radius:var(--r-sm);padding:6px 6px 6px 14px;
}
.copy-row input{
  flex:1;min-width:0;background:transparent;border:0;color:var(--text);
  font-family:var(--f-mono);font-size:13.5px;padding:6px 0;
}
.copy-row input:focus{outline:none}

.qr-box{
  background:#fff;border-radius:var(--r);padding:14px;display:inline-block;line-height:0;
  border:1px solid var(--line);
}
.qr-box svg{display:block;width:176px;height:176px;shape-rendering:crispEdges}

.promo-code{
  font-family:var(--f-wide);font-size:26px;font-weight:600;letter-spacing:2px;color:var(--acc-ink);line-height:1.2;
}

/* Карточка ссылки на «Обзоре»: ссылка слева, QR справа в одной рамке */
.card.link-card{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:0;padding:0;overflow:hidden}
.link-card .lc-main{padding:22px 24px;min-width:0;display:flex;flex-direction:column}
.link-card .lc-qr{padding:20px 24px;border-left:1px solid var(--line);background:var(--panel2);text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px}
.link-card .lc-qr .qr-box svg{width:136px;height:136px}
.link-card .lc-promo{margin-top:auto;padding-top:18px;display:flex;align-items:flex-end;justify-content:space-between;gap:14px;flex-wrap:wrap}

/* ---------------------------------------------------------------------
   Графики
   --------------------------------------------------------------------- */

.chart{width:100%;height:auto;display:block;overflow:visible}
.chart .gl{stroke:var(--line);stroke-width:1}
.chart .tick{fill:var(--dim2);font-size:10.5px}
.chart .area{opacity:.16}
.chart .ln{fill:none;stroke-width:2;stroke-linejoin:round;stroke-linecap:round}
.legend{display:flex;gap:16px;margin-top:10px;flex-wrap:wrap}
.legend span{display:flex;align-items:center;gap:6px;color:var(--dim);font-size:12.5px}
.legend i{width:9px;height:9px;border-radius:3px;display:block}

.spark{display:flex;align-items:flex-end;gap:2px;height:38px}
.spark i{flex:1;background:var(--acc-soft);border-radius:2px 2px 0 0;min-height:2px;display:block}
.spark i.on{background:var(--acc)}

/* Столбики из HTML (UI.vbars): цифры не растягиваются вместе с графиком */
.vb{display:flex;align-items:flex-end;gap:3px;width:100%}
.vb-col{flex:1 1 0;min-width:0;display:flex;flex-direction:column;align-items:stretch;padding:0;border-radius:6px;cursor:pointer}
.vb-plot{display:flex;flex-direction:column;justify-content:flex-end;align-items:center;border-radius:6px 6px 0 0;border-bottom:1px solid var(--line2)}
.vb-n{font-size:11px;font-weight:600;color:var(--dim);line-height:1;margin-bottom:4px;white-space:nowrap;font-variant-numeric:tabular-nums}
.vb-bar{display:block;width:70%;max-width:36px;border-radius:5px 5px 1px 1px;opacity:.85;transition:opacity .15s}
.vb-l{height:22px;padding-top:6px;margin-top:2px;font-size:10.5px;color:var(--dim2);text-align:center;white-space:nowrap;overflow:visible;font-variant-numeric:tabular-nums;position:relative}
.vb-col:hover .vb-bar{opacity:1}
.vb-col:hover .vb-plot{background:var(--panel2)}
.vb-col.sel .vb-plot{background:var(--purple-soft)}
.vb-col.sel .vb-bar{opacity:1}
.vb-col.sel .vb-n{color:var(--text)}
.vb-col.mark .vb-l::before{
  content:"";position:absolute;left:50%;top:0;transform:translateX(-50%);
  width:6px;height:6px;border-radius:99px;background:var(--acc);
}
.chart-pair{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:28px}
.chart-cap{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin-bottom:12px}
.chart-cap b{font-weight:600;font-size:14px}
.chart-cap span{color:var(--dim);font-size:13px;font-variant-numeric:tabular-nums}
.chart-cap span em{font-style:normal;font-family:var(--f-wide);font-weight:600;color:var(--text);font-size:15px;letter-spacing:-.3px}

/* ---------------------------------------------------------------------
   Шторка
   --------------------------------------------------------------------- */

.sheet-back{
  position:fixed;inset:0;background:rgba(7,20,15,.48);z-index:60;
  opacity:0;transition:opacity .2s;backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px);
}
.sheet-back.show{opacity:1}
.sheet{
  position:fixed;z-index:61;background:var(--bg);
  box-shadow:var(--shadow);
  display:flex;flex-direction:column;
  top:0;right:0;height:100%;width:min(580px,100%);
  border-left:1px solid var(--line);
  transform:translateX(100%);transition:transform .28s cubic-bezier(.32,.72,0,1);
}
.sheet.show{transform:translateX(0)}
.sheet-head{
  display:flex;align-items:center;gap:12px;padding:calc(20px + var(--safe-t)) 24px 16px;
  border-bottom:1px solid var(--line);background:var(--panel);
}
.sheet-head h3{font-family:var(--f-wide);font-size:18px;font-weight:600;letter-spacing:-.3px;flex:1;min-width:0;line-height:1.25}
.sheet-head .sub{color:var(--dim);font-size:13px;margin-top:3px}
.sheet-x{width:38px;height:38px;border-radius:10px;background:var(--panel2);border:1px solid var(--line);display:flex;align-items:center;justify-content:center;color:var(--dim);flex:0 0 38px}
.sheet-x:hover{color:var(--text)}
.sheet-x svg{width:16px;height:16px;fill:currentColor}
.sheet-body{padding:20px 24px;overflow-y:auto;flex:1}
.sheet-body .card{padding:16px 18px}
.sheet-body .card.card-pad0{padding:0}
.sheet-foot{padding:14px 24px calc(14px + var(--safe-b));border-top:1px solid var(--line);display:flex;gap:10px;background:var(--panel)}
.sheet-foot .btn{flex:1}

/* ---------------------------------------------------------------------
   Тосты, загрузка
   --------------------------------------------------------------------- */

.toasts{position:fixed;left:0;right:0;bottom:calc(20px + var(--safe-b));z-index:90;display:flex;flex-direction:column;align-items:center;gap:8px;pointer-events:none}
.toast{
  background:var(--rail);color:var(--rail-text);
  padding:12px 18px;border-radius:12px;font-size:14px;font-weight:500;
  box-shadow:var(--shadow);max-width:min(480px,92vw);text-align:center;
  animation:toast-in .22s ease-out;
}
.toast-bad{background:var(--bad);color:#fff}
.toast-ok{background:var(--rail);color:var(--rail-text);box-shadow:var(--shadow), inset 3px 0 0 var(--acc-bright)}
@keyframes toast-in{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}

.skel{background:var(--panel2);border-radius:var(--r);height:88px;animation:pulse 1.3s ease-in-out infinite}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.55}}
.loader{display:flex;justify-content:center;padding:56px}
.loader i{
  width:28px;height:28px;border-radius:99px;display:block;
  border:2.5px solid var(--line2);border-top-color:var(--acc);
  animation:spin .8s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}

/* ---------------------------------------------------------------------
   Материалы: готовые тексты и чек-листы
   --------------------------------------------------------------------- */

.pitch{background:var(--panel);border:1px solid var(--line);border-radius:var(--r);padding:18px 20px;display:flex;flex-direction:column}
.pitch h4{margin:0 0 10px;font-size:15px;font-weight:600}
.pitch pre{
  margin:0;white-space:pre-wrap;word-break:break-word;flex:1;
  font:14px/1.6 var(--f-text);color:var(--dim);
  background:var(--panel2);border-radius:var(--r-sm);padding:12px 14px;border-left:3px solid var(--acc-edge);
}
.pitch .btn{margin-top:12px;align-self:flex-start}
.checklist{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:12px}
.checklist li{display:flex;gap:12px;font-size:14px;line-height:1.55;color:var(--dim)}
.checklist li b{color:var(--text);font-weight:600}
.checklist li::before{
  content:"";flex:0 0 20px;height:20px;margin-top:1px;border-radius:6px;
  background:var(--acc-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230B8A52'%3E%3Cpath d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center/13px no-repeat;
}
html[data-theme="dark"] .checklist li::before{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%235BDC9E'%3E%3Cpath d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------------------
   Профиль: тема и код из письма
   --------------------------------------------------------------------- */

.theme-pick{display:flex;gap:10px}
.theme-pick button{
  flex:1;height:var(--tap);border-radius:var(--r-sm);border:1px solid var(--line2);
  background:var(--panel);color:var(--dim);font-size:14px;font-weight:500;
  display:flex;align-items:center;justify-content:center;gap:8px;
}
.theme-pick button.active{border-color:var(--acc);color:var(--text);font-weight:600;box-shadow:inset 0 0 0 1px var(--acc)}
.theme-pick i{width:16px;height:16px;border-radius:99px;display:block;border:1px solid var(--line2)}
.theme-pick i.light{background:#F1F4EF}
.theme-pick i.dark{background:#0F2A21}

.code-input{
  width:100%;text-align:center;letter-spacing:12px;font-family:var(--f-wide) !important;font-size:26px !important;font-weight:600;
  padding:12px 10px;min-height:60px;
}

/* ---------------------------------------------------------------------
   Аналитика заходов (stats.js)
   --------------------------------------------------------------------- */

.vs-bar{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.vs-select{display:flex;align-items:center;gap:8px}
.vs-select select{
  height:44px;border-radius:12px;border:1px solid var(--line);background:var(--panel);
  padding:0 36px 0 14px;font-size:14px;font-weight:500;max-width:280px;
  -webkit-appearance:none;appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2384928A'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 10px center;background-size:20px;
}
.vs-select select:focus{outline:none;border-color:var(--acc);box-shadow:var(--focus)}
.vs-range{margin-left:auto}
.legend-inline{display:flex;gap:14px;flex-wrap:wrap;font-weight:400}
.legend-inline span{display:flex;align-items:center;gap:6px;color:var(--dim);font-size:12.5px}
.legend-inline i{width:9px;height:9px;border-radius:3px;display:block}
.legend-inline i.dot-acc{border-radius:99px;background:var(--acc);width:7px;height:7px}
.vs-detail{
  display:flex;flex-wrap:wrap;align-items:center;gap:6px 18px;margin-top:14px;padding:11px 14px;
  background:var(--panel2);border:1px solid var(--line);border-radius:var(--r-sm);font-size:14px;min-height:44px;
}
.vs-detail span{display:flex;align-items:center;gap:6px;color:var(--dim);font-variant-numeric:tabular-nums}
.vs-detail span i{width:9px;height:9px;border-radius:3px;display:block}
.vs-detail span.acc{color:var(--acc-ink);font-weight:600}

.share{display:flex;flex-direction:column;gap:13px}
.share-top{display:flex;justify-content:space-between;align-items:baseline;gap:10px;font-size:14px}
.share-name{display:flex;align-items:center;gap:8px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.share-name i{width:9px;height:9px;border-radius:3px;display:block;flex:0 0 9px}
.share-val{white-space:nowrap;color:var(--dim);font-variant-numeric:tabular-nums;font-size:13px}
.share-val b{color:var(--text);font-weight:600;font-size:14px}
.share-track{height:7px;border-radius:99px;background:var(--panel3);margin-top:6px;overflow:hidden}
.share-track span{display:block;height:100%;border-radius:99px;opacity:.85}

/* ---------------------------------------------------------------------
   Узкие экраны
   --------------------------------------------------------------------- */

@media(max-width:1180px){
  .g4,.stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .stats > .kpi:nth-child(3){border-left:0}
  .stats > .kpi:nth-child(n+3){border-top:1px solid var(--line)}
  .g21,.g12{grid-template-columns:minmax(0,1fr)}
  .bal{grid-template-columns:minmax(0,1fr)}
  .chart-pair{grid-template-columns:minmax(0,1fr)}
}

@media(max-width:900px){
  .auth-wrap{grid-template-columns:minmax(0,1fr)}
  /* На телефоне рассказ о программе только отодвигает форму: человек уже
     пришёл регистрироваться. Остаётся компактная шапка с логотипом. */
  .auth-pitch{display:none}
  .auth-box{margin:calc(28px + var(--safe-t)) auto calc(28px + var(--safe-b));padding:0 20px}
  .auth-box h1{font-size:21px}
  .auth-head{display:flex;align-items:center;gap:11px;margin-bottom:28px}
}

@media(max-width:820px){
  .shell{flex-direction:column}
  .side{
    position:fixed;inset:0 auto 0 0;z-index:70;width:280px;flex:none;
    transform:translateX(-100%);transition:transform .26s cubic-bezier(.32,.72,0,1);
    box-shadow:var(--shadow);
  }
  .side.open{transform:none}
  .menu-btn{display:inline-flex}
  .topbar{padding:calc(12px + var(--safe-t)) 16px 12px;gap:12px}
  .topbar h1{font-size:18px}
  .topbar .sub{font-size:12.5px;margin-top:1px}
  .topbar .btn{width:40px;height:40px;padding:0}
  .view{padding:16px 14px calc(20px + var(--safe-b))}
  .view > section{margin-bottom:16px}
  .g3{grid-template-columns:repeat(2,minmax(0,1fr))}
  .g2{grid-template-columns:minmax(0,1fr)}
  .g2-tight{grid-template-columns:repeat(2,minmax(0,1fr))}
  .card{padding:16px;border-radius:var(--r)}
  .card-head{padding:15px 16px 2px}
  .card-body{padding:12px 16px 14px}
  .stats > .kpi{padding:14px 16px}
  .kpi .value{font-size:22px;letter-spacing:-.6px}
  table.data th,table.data td{padding:11px 12px}
  .row{padding:12px 14px}
  .bal-main{padding:20px 18px}
  .bal-side{padding:6px 18px 10px}
  .card.link-card{grid-template-columns:minmax(0,1fr)}
  .link-card .lc-main{padding:18px 16px}
  .link-card .lc-qr{border-left:0;border-top:1px solid var(--line);padding:18px 16px}
  .sheet{
    top:auto;bottom:0;right:0;left:0;width:100%;height:auto;max-height:92vh;
    border-radius:var(--r-xl) var(--r-xl) 0 0;border-left:0;
    transform:translateY(100%);
  }
  .sheet-head{border-radius:var(--r-xl) var(--r-xl) 0 0;padding:18px 18px 14px}
  .sheet-body{padding:16px 18px}
  .sheet-foot{padding:12px 18px calc(12px + var(--safe-b))}
  .sheet.show{transform:translateY(0)}
  .vs-range{margin-left:0;width:100%}
  .vs-select{flex:1 1 100%;min-width:0}
  .vs-select select{flex:1;min-width:0;max-width:none;width:100%}
  .card h2 .legend-inline{display:none}
  /* Подсказка под заголовком, а не сбоку: рядом ей на телефоне тесно. */
  .card h2.vs-h2{flex-wrap:wrap;row-gap:2px}
  .card h2.vs-h2 .hint{flex-basis:100%}
  .vb{gap:2px}
  /* Месяц по дням на телефоне: 30 чисел над столбиками налезают друг на
     друга. Числа прячем — точное значение в строке под графиком. */
  .vb-dense .vb-n{display:none}
  /* Переключатель вкладок раздела прокручивается сам, а не переносится
     в две строки и не сдвигает страницу. */
  .view > section > .seg{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;width:100%}
  .view > section > .seg::-webkit-scrollbar{display:none}
}

@media(max-width:520px){
  .g4,.g3{grid-template-columns:repeat(2,minmax(0,1fr))}
  .g2{grid-template-columns:minmax(0,1fr)}
  .field-row{grid-template-columns:minmax(0,1fr)}
  .kpi .value{font-size:19px;letter-spacing:-.5px;white-space:normal;overflow:visible}
  .kpi .value small{font-size:12.5px}
  #st-q{flex:1 1 100%;width:100%}
  .view > section.flex > .flex{width:100%}
  .qr-box svg{width:156px;height:156px}
  .bal-sum{font-size:32px}
}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{transition:none !important;animation:none !important}
}

/* Ссылка-кнопка внутри текста плитки («подробнее») */
.link-btn{color:var(--acc-ink);font-weight:600;font-size:inherit;padding:0;text-decoration:underline;text-underline-offset:2px;text-decoration-thickness:1px}
.link-btn:hover{text-decoration-thickness:2px}
.checklist.mt{margin-top:18px}

/* Ссылка на витрину программы с экрана входа (12.10.2026: кабинет теперь
   живёт в корне сайта, витрина — на /programma). */
.auth-more{display:inline-block;margin-top:26px;color:var(--acc-bright);font-weight:600;font-size:14px;text-decoration:underline;text-underline-offset:3px}
.auth-more-mobile{display:none}
@media(max-width:900px){.auth-more-mobile{display:block}}
