/* Панель учёта — вид по принятому макету (⚫ Михаил 23.10 «2 ок»): светлый фон, вкладки-таблетки,
   карточки с крупными цифрами, списки строками. Шрифт — Manrope (брендбук), без переносов,
   без моноширинного, без подписей вразрядку. */
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(fonts/manrope-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(fonts/manrope-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --fon: #EEF0F3; --karta: #FFFFFF; --chernila: #0B1020; --tusk: #596071; --liniya: #EEF0F3;
  --ramka: #D3D8E0; --ramka-svetl: #E1E5EB; --rost: #1F7A4D; --zaglushka: #E4E7EC;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--fon); color: var(--chernila);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--chernila); outline-offset: 2px; }

.obertka {
  max-width: 1320px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px;
  padding-block: max(20px, env(safe-area-inset-top, 0px)) max(56px, env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 900px) { .obertka { padding-left: max(40px, env(safe-area-inset-left, 0px)); padding-right: max(40px, env(safe-area-inset-right, 0px)); } }

.razdel { display: flex; flex-direction: column; gap: 24px; min-width: 0; }

/* Таблетки */
.tabletki { display: flex; flex-wrap: wrap; gap: 6px; }
.tabletki.v-ramke { gap: 4px; padding: 4px; background: var(--karta); border-radius: 999px; flex-wrap: nowrap; }
.tabletka {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border: 0;
  border-radius: 999px; background: var(--karta); color: var(--chernila); font-size: 14px; font-weight: 500;
  white-space: nowrap;
}
.v-ramke .tabletka { background: transparent; }
.tabletka[aria-pressed="true"], .tabletka[aria-current="page"] { background: var(--chernila); color: #FFFFFF; font-weight: 600; }
.tabletka .schet { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px;
  padding: 0 6px; border-radius: 999px; background: var(--fon); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tabletka[aria-current="page"] .schet, .tabletka[aria-pressed="true"] .schet { background: rgba(255, 255, 255, .2); color: #FFFFFF; }
.tabletka.s-ramkoj { border: 1px solid var(--ramka); }
.tabletka.s-ramkoj[aria-pressed="true"] { border-color: var(--chernila); }

.shapka { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; position: relative; }
.avatar { width: 52px; height: 52px; flex: none; border: 0; border-radius: 50%; background: #D9DEE6; font-size: 15px; font-weight: 600; }
.menyu { position: absolute; right: 0; top: 60px; z-index: 5; background: var(--karta); border-radius: 20px; padding: 16px;
  box-shadow: 0 8px 30px rgba(11, 16, 32, .12); display: flex; flex-direction: column; gap: 10px; min-width: 220px; }
.menyu p { margin: 0; font-size: 14px; color: var(--tusk); }

.krug { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 1px solid var(--ramka-svetl); background: var(--karta);
  display: inline-flex; align-items: center; justify-content: center; color: var(--chernila); text-decoration: none; }
.krug.bez-ramki { border: 0; }
.krug svg, .tabletka svg, .knopka svg { flex: none; }

.otrezki { display: flex; flex-direction: column; gap: 8px; }
.otrezki-ryad { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.daty { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.daty label { font-size: 14px; color: var(--tusk); }
.daty input { height: 44px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--karta); font-size: 14px; }
.obnovleno { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 13px; color: var(--tusk); }

/* Заголовки */
.zagolovok { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.zagolovok > div { display: flex; flex-direction: column; gap: 10px; flex: 1 1 320px; min-width: 0; }
h1 { margin: 0; font-size: clamp(38px, 4.6vw, 60px); font-weight: 300; line-height: 1.02; letter-spacing: -0.025em; text-wrap: balance; }
h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.podzag { margin: 0; max-width: 70ch; color: var(--tusk); text-wrap: pretty; }
.zamechanie { margin: 0; padding: 12px 16px; border-radius: 16px; background: var(--karta); font-size: 14px; font-weight: 600; }
.oshibka { margin: 0; font-size: 14px; font-weight: 600; }

/* Кнопки */
.knopka { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px;
  border-radius: 999px; border: 0; background: var(--chernila); color: #FFFFFF; font-size: 14px; font-weight: 600; white-space: nowrap; }
.knopka.kontur { background: transparent; color: var(--chernila); border: 1px solid var(--chernila); }
.knopka.seraya { background: var(--fon); color: var(--chernila); font-weight: 500; }
.knopka.belaya { background: var(--karta); color: var(--chernila); border: 1px solid var(--ramka); font-weight: 500; font-size: 13.5px; }
.knopka:disabled { opacity: .5; cursor: default; }

/* Карточки воронки: 4 в ряд на Маке, 2 на телефоне */
.karty { display: grid; grid-template-columns: repeat(auto-fit, minmax(max(150px, calc((100% - 36px) / 4)), 1fr)); gap: 12px; }
.karta-v { background: var(--karta); border-radius: 24px; padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.karta-v .verh { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; min-height: 44px; }
.karta-v .metka-k { padding-top: 4px; font-size: 14px; line-height: 1.35; font-weight: 500; color: var(--tusk); }
.chislo-ryad { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-variant-numeric: tabular-nums; }
.chislo-b { font-size: clamp(32px, 3.4vw, 46px); font-weight: 300; line-height: 1; letter-spacing: -0.02em; }
.prirost { font-weight: 600; color: var(--tusk); white-space: nowrap; }
.prirost.est { color: var(--rost); }
.chislo-ryad .prirost { font-size: 17px; }
.summa-ryad { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.summa-ryad .prirost { font-size: 14px; }
.niz { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.polosa { height: 4px; border-radius: 999px; background: var(--fon); overflow: hidden; }
.polosa > div { height: 4px; border-radius: 999px; background: var(--chernila); }
.primechanie { font-size: 13px; line-height: 1.4; color: var(--tusk); }

/* Белые блоки со строками */
.blok { background: var(--karta); border-radius: 24px; padding: 4px 0; display: flex; flex-direction: column; min-width: 0; }
.blok-shapka { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; padding: 16px 20px 12px; }
.blok-shapka span { font-size: 13px; color: var(--tusk); }
.pusto { margin: 0; padding: 24px 20px; color: var(--tusk); }

/* Таблица «Откуда пришли»: на телефоне листается вбок внутри блока */
.prokrutka { overflow-x: auto; }
.tablica { min-width: 820px; }
.tr { display: grid; grid-template-columns: minmax(200px, 2.6fr) repeat(6, minmax(76px, 1fr)); gap: 12px; align-items: center;
  padding: 14px 20px; border-top: 1px solid var(--liniya); font-variant-numeric: tabular-nums; }
.tr.zag { align-items: end; padding: 10px 20px; border-top: 0; font-size: 12.5px; line-height: 1.3; font-weight: 500; color: var(--tusk); }
.tr > .ch { text-align: right; }
.tr .ch .prirost { display: inline-block; margin-left: 6px; font-size: 12.5px; }
.istochnik { display: flex; align-items: center; gap: 14px; min-width: 0; }
.istochnik .tekst { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.istochnik .nazv { font-size: 14px; line-height: 1.35; font-weight: 500; overflow-wrap: anywhere; }
.istochnik .meta { font-size: 12.5px; line-height: 1.35; color: var(--tusk); overflow-wrap: anywhere; }
.prevyu { position: relative; width: 80px; height: 45px; flex: none; border-radius: 10px; background: var(--zaglushka);
  color: #8A91A0; display: flex; align-items: center; justify-content: center; }
.prevyu.svetl { background: var(--fon); color: var(--chernila); }
.prevyu .dlit { position: absolute; right: 4px; bottom: 4px; padding: 1px 5px; border-radius: 6px; background: var(--chernila);
  color: #FFFFFF; font-size: 11px; font-weight: 600; }

/* Строки людей и меток: на телефоне раскладываются карточкой */
.stroka { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 16px 20px; border-top: 1px solid var(--liniya); }
.stroka:first-child { border-top: 0; }
.blok-shapka + .stroka { border-top: 1px solid var(--liniya); }
.kto { display: flex; align-items: center; gap: 12px; flex: 1 1 220px; min-width: 0; }
.kruzhok { width: 44px; height: 44px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; }
.dva { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 200px; }
.kto .dva { flex: initial; }
.dva .glav { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.dva .sred { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.dva .vtor { font-size: 13px; line-height: 1.4; color: var(--tusk); overflow-wrap: anywhere; }
.kogda { flex: 0 0 110px; font-size: 13px; color: var(--tusk); font-variant-numeric: tabular-nums; }
.otmetki { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex: 1 1 330px; }
.fishka { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px; border: 1px solid var(--ramka);
  border-radius: 999px; background: var(--karta); font-size: 13.5px; font-weight: 500; }
.fishka[aria-pressed="true"] { border-color: var(--chernila); background: var(--chernila); color: #FFFFFF; font-weight: 600; }
.summa-knopka { border: 0; background: transparent; padding: 8px 4px; font-size: 14px; font-weight: 600; color: var(--rost);
  font-variant-numeric: tabular-nums; text-decoration: underline dotted; text-underline-offset: 4px; }
.summa-pole { width: 120px; height: 40px; padding: 0 12px; border: 1px solid var(--ramka); border-radius: 12px; }

.vid { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; flex: 0 0 210px; }
.pilyulya { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 999px; background: var(--fon);
  font-size: 12.5px; font-weight: 500; }
.pilyulya.temn { background: var(--chernila); color: #FFFFFF; font-weight: 600; }
.cifry { display: flex; gap: 20px; flex: 0 0 auto; }
.cifry > div { display: flex; flex-direction: column; gap: 2px; min-width: 96px; }
.cifry .podp { font-size: 12.5px; color: var(--tusk); }
.cifry .zn { font-size: 20px; font-variant-numeric: tabular-nums; }
.cifry .zn .prirost { margin-left: 6px; font-size: 13px; }
.kopir { flex: 0 0 150px; }
.vid .summa-knopka { color: var(--chernila); padding: 4px 0; font-size: 13px; font-weight: 600; }
.summa-knopka.ubrat { color: var(--tusk); font-weight: 500; font-size: 13px; }
.privyazka { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.privyazka select { height: 44px; max-width: 100%; padding: 0 14px; border: 1px solid var(--ramka); border-radius: 14px; background: var(--karta); }

/* Формы */
.forma { background: var(--karta); border-radius: 24px; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.forma h2 { font-size: 17px; }
.polya { display: flex; flex-wrap: wrap; gap: 12px; }
.pole { display: flex; flex-direction: column; gap: 6px; flex: 1 1 200px; min-width: 0; }
.pole.uzk { flex: 0 1 280px; }
.pole label, .pole .podpis { font-size: 13px; font-weight: 500; color: var(--tusk); }
.pole input, .pole select { width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--ramka); border-radius: 14px; background: var(--karta); font-size: 15px; }
.prosmotr { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 16px; background: var(--fon);
  font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.prosmotr b { font-weight: 600; }
.prosmotr span { color: var(--tusk); }
.ryad-knopok { display: flex; flex-wrap: wrap; gap: 8px; }

/* Вход */
.vhod { min-height: 70vh; display: flex; align-items: center; justify-content: center; }
.vhod-karta { width: 100%; max-width: 420px; background: var(--karta); border-radius: 28px; padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.vhod-karta h1 { font-size: 34px; }
.vhod-karta p { margin: 0; color: var(--tusk); }
.vhod-karta form { display: flex; flex-direction: column; gap: 12px; }
.vidzhet { min-height: 48px; }

@media (prefers-reduced-motion: no-preference) { .fishka, .tabletka, .knopka { transition: background-color .15s ease, color .15s ease; } }
