/* The cabinet on the site (04.11.2026, leadogen.ai/cabinet): the sign-in screen and, on a computer, the menu on the left
   instead of the bottom tabs. Only under html.is-web (core.js) - the Mini App in Telegram looks as before. */

:root { --web-side: 252px; }

/* ---------- sign-in and registration: one card in the middle of the screen ---------- */

.screen.is-login { max-width: none; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.screen.is-login .screen-card { width: 100%; max-width: 520px; }
.web-auth {
  display: grid;
  gap: 14px;
  padding: 30px 30px 26px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.web-auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.01em; }
.web-auth-brand img { border-radius: 50%; }
.web-auth h2 { font-size: 26px; line-height: 1.15; letter-spacing: -0.02em; margin-top: 6px; }
.web-auth-sub { color: var(--muted); margin-top: -6px; }
.web-auth-ways { display: grid; grid-template-columns: 1fr 1fr; }
.web-auth-form { gap: 12px; }
.web-auth-alt { display: grid; gap: 8px; margin-top: 6px; padding-top: 16px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: 14px; }
/* white, over brand.css's glass buttons */
.btn.web-auth-white, .btn.web-auth-white:hover { background: #fff !important; color: #0b1020 !important; border-color: #fff !important; }
.btn.web-auth-white:hover { opacity: 0.9; }
.web-tg { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; }
.web-tg-main { display: grid; gap: 12px; }
.web-tg .btn { text-decoration: none !important; }
.web-login-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13.5px;
}
.web-login-code b { color: var(--text); font-size: 21px; letter-spacing: 0.18em; font-variant-numeric: tabular-nums; }
.web-login-qr { display: grid; justify-items: center; gap: 8px; color: var(--muted); font-size: 12px; text-align: center; }
.web-login-qr img { border-radius: 12px; background: #fff; }

@media (max-width: 720px) {
  .web-auth { padding: 22px 18px 20px; }
  .web-tg { grid-template-columns: 1fr; }
  .web-login-qr { display: none; }  /* on the phone the button opens Telegram itself */
}

/* ---------- a computer: the menu on the left ---------- */

.web-products { display: none; }  /* the products list lives in the left menu only */

@media (min-width: 960px) {
  html.is-web.in-workspace body { padding-left: var(--web-side); }

  html.is-web.in-workspace .appbar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--web-side);
    background: var(--surface);
    border-bottom: 0;
    border-right: 1px solid var(--line);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  html.is-web.in-workspace .appbar-inner {
    max-width: none;
    height: 100%;
    padding: 18px 14px 16px;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
  }
  html.is-web.in-workspace .brand { padding: 2px 6px 0; }
  html.is-web.in-workspace .appbar-end { margin-top: auto; flex-wrap: wrap; justify-content: flex-start; padding: 0 2px; }
  html.is-web.in-workspace .appbar-status { order: -1; flex-basis: 100%; justify-content: center; }
  /* 05.11.2026 (разработчик): products are switched in one place - «Продукты» on the left; the name on top is only a
     title here (the menu under it also lay under the section menu and the items showed through). A phone keeps the menu */
  html.is-web.in-workspace .brand-name { pointer-events: none; }
  html.is-web.in-workspace .brand-name .ic { display: none; }
  html.is-web.in-workspace .module-menu { display: none !important; }

  html.is-web.in-workspace .tabbar {
    flex-direction: column;
    justify-content: flex-start;
    top: 76px;
    left: 0;
    right: auto;
    bottom: auto;
    width: var(--web-side);
    transform: none;
    padding: 4px 14px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  html.is-web.in-workspace .tabbar-inner { flex-direction: column; max-width: none; gap: 2px; }
  html.is-web.in-workspace .tab,
  html.is-web.in-workspace .tabbar-inner:has(> .tab:nth-child(6)) .tab {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
    padding: 9px 10px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
  }
  html.is-web.in-workspace .tab-icon,
  html.is-web.in-workspace .tabbar-inner:has(> .tab:nth-child(6)) .tab-icon { width: auto; height: auto; background: none !important; }
  html.is-web.in-workspace .tab-icon .ic { width: 19px; height: 19px; }
  html.is-web.in-workspace .tab:hover { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
  html.is-web.in-workspace .tab.is-active { background: var(--accent-soft); }

  html.is-web.in-workspace .tab-label { font-size: 12px; letter-spacing: 0.08em; }

  html.is-web .web-products { display: grid; gap: 2px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
  html.is-web .web-nav-title { padding: 0 10px 6px; color: var(--muted); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
  html.is-web .web-product {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-2);
    font: inherit;
    font-size: 13.5px;
    text-align: left;
    cursor: pointer;
  }
  html.is-web .web-product span:not(.product-logo) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html.is-web .web-product .ic { width: 15px; height: 15px; color: var(--muted); }
  html.is-web .web-product .product-logo { width: 22px; height: 22px; }
  html.is-web .web-product:hover { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
  html.is-web .web-product.is-active { color: var(--text); background: var(--surface-2, color-mix(in srgb, var(--accent-soft) 30%, transparent)); }

  /* a sheet from below is a phone's thing: on a computer it is a window in the middle */
  html.is-web .modal-backdrop.is-sheet { padding: 24px; align-items: center; }
  html.is-web .guide-sheet { border-radius: 20px; max-height: 80vh; animation: fade-in 0.15s ease; }
  html.is-web .sheet-handle { display: none; }

  /* 05.11.2026 (разработчик): the content takes the screen right of the menu, the same gap from the menu and from the
     right edge (like the admin panel); on a very wide screen it stops at 1600 px and stands in the middle */
  html.is-web .app { max-width: 1600px; margin: 0 auto; padding: 34px calc(44px + 5%) 56px; }  /* +5% each side (05.11.2026) */
  html.is-web .view-head h1 { font-size: 30px; }
  html.is-web .screen { margin: 0 auto; padding-top: 40px; }
  html.is-web .screen.is-referral { max-width: 1100px; }
}

/* ---------- support on the site: a panel on the right, the whole screen on a phone ---------- */

.web-support {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  animation: fade-in 0.15s ease;
}
@media (min-width: 720px) {
  .web-support { inset: 16px 16px 16px auto; width: 400px; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); }
}
.ws-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.ws-head > div { display: grid; gap: 2px; }
.ws-head span { color: var(--muted); font-size: 12.5px; }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--accent-soft); color: var(--text); }
.ws-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ws-msg { display: grid; gap: 3px; max-width: 86%; }
.ws-me { align-self: flex-end; justify-items: end; }
.ws-them { align-self: flex-start; }
.ws-who { color: var(--muted); font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; }
.ws-bubble { padding: 9px 12px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.45; }
.ws-them .ws-bubble { background: var(--bg); border: 1px solid var(--line); border-top-left-radius: 4px; }
.ws-me .ws-bubble { background: var(--accent); color: #fff; border-top-right-radius: 4px; }
.ws-typing { display: flex; gap: 4px; }
.ws-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: ws-dot 1s infinite ease-in-out; }
.ws-typing i:nth-child(2) { animation-delay: 0.15s; }
.ws-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes ws-dot { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }
.ws-foot { display: grid; gap: 8px; padding: 12px 16px calc(14px + var(--safe-bottom, 0px)); border-top: 1px solid var(--line); }
.ws-form { display: flex; gap: 8px; align-items: flex-end; }
/* one line the height of the send button, the text in the middle of the frame; it grows with the text */
.ws-form textarea { flex: 1; resize: none; height: 44px; min-height: 44px; max-height: 140px; padding: 11px 12px; line-height: 20px; overflow-y: auto; }
.ws-form .btn { height: 44px; padding: 0 14px; }
.ws-waiting { display: flex; align-items: center; gap: 8px; color: var(--warning); font-size: 13px; }
.ws-waiting .ic { width: 16px; height: 16px; }

@media (min-width: 960px) {
  html.is-web .screen.is-login { margin: 0; padding: 24px 16px; }
}

/* «Профиль» on the site */
.web-profile { max-width: 460px; padding: 0; display: grid; }
.web-profile section { display: grid; gap: 10px; padding: 16px; border-top: 1px solid var(--line); }
.web-profile section h3 { font-size: 15px; }
.web-profile .ws-head { border-bottom: 0; }
.web-profile p.muted { display: flex; gap: 6px; align-items: flex-start; font-size: 14px; }
.web-profile p.muted .ic { color: var(--success, #3ecf8e); margin-top: 2px; }

/* the left menu is for a product's workspace only (04.11.2026): while the page loads, on sign-in, the product choice,
   the tariffs and the other screens there is no strip - a plain bar with the logo and the buttons, as on a phone */
html.is-web:not(.booted) .appbar { visibility: hidden; }
/* no strip, but the page's own background: the sticky bar must not show the page scrolling under it */
html.is-web:not(.in-workspace) .appbar { background: var(--bg); border-bottom: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
html.is-web body:has(.screen.is-login:not(.hidden)) .appbar { display: none; }
.web-auth-forgot { justify-self: center; font-size: 13.5px; }

/* ---------- tariffs (04.11.2026: the landing's packages) ---------- */
.tariff-card-perks { display: none; }
.tariff-key-form { display: flex; gap: 8px; }
.tariff-key-form .input { flex: 1; min-width: 0; }
@media (min-width: 960px) {
  /* a computer: a wide screen, each package with what it includes - no need to tap through them */
  html.is-web .screen.is-tariffs { max-width: 1060px; }
  html.is-web .tariff-row { gap: 16px; }
  html.is-web .tariff-card { display: flex; flex-direction: column; justify-content: flex-start; gap: 4px; padding: 20px 20px 18px; text-align: left; }
  html.is-web .tariff-card .tariff-name { font-size: 18px; }
  html.is-web .tariff-card .tariff-price { font-size: 34px; margin-top: 14px; }
  html.is-web .tariff-card-perks { display: grid; gap: 8px; margin: 14px 0 0; padding: 14px 0 0; list-style: none; border-top: 1px solid var(--line); font-size: 13.5px; line-height: 1.35; }
  html.is-web .tariff-card-perks li { display: flex; gap: 8px; align-items: flex-start; }
  html.is-web .tariff-card-perks .ic { width: 15px; height: 15px; flex: none; margin-top: 1px; }
  html.is-web .tariff-detail { display: none; }  /* the cards already say what is inside */
}
/* the site on a phone (04.11.2026): a little more air above the tariffs than in the tight Mini App */
html.is-web .screen.is-tariffs { padding-top: 22px; }
html.is-web .screen.is-tariffs .tariff-head { margin-bottom: 14px; }

/* the bonuses on a computer (04.11.2026): wider, the two cards side by side of one height */
@media (min-width: 960px) {
  html.is-web .screen.is-referral { max-width: 1060px; }
  html.is-web .referral-page { gap: 16px; align-items: stretch; }
  html.is-web .referral-card, html.is-web .referral-stats-card, html.is-web .referral-how { padding: 20px; }
}

/* «Сводка» on a computer (05.11.2026, разработчик): the two columns under the four numbers end on one line - the charts
   on the left, «Последние заявки» stretches on the right; the columns follow the four cards above (2 + 2) */
@media (min-width: 960px) {
  html.is-web .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: stretch; }
  html.is-web .dash-grid > .stack { display: flex; flex-direction: column; gap: 10px; }
  html.is-web .dash-grid > .stack > .card { margin-top: 0; }
  html.is-web .dash-grid > .stack:last-child > .card:first-child { flex: 1 1 auto; }
}

/* the site on a phone (05.11.2026): «ИИ включён» did not fit next to the icons - «● ИИ» stays in the header */
@media (max-width: 959px) {
  html.is-web .appbar-status { padding: 0 9px; gap: 5px; justify-content: center; flex: none; }
  html.is-web .appbar-status .status-text { display: none; }
  html.is-web .appbar-status .status-short { display: inline; }  /* 05.11.2026: «● ИИ» - a dot alone said nothing */
  html.is-web .appbar-end { gap: 6px; }
}

/* «Выйти» lives in «Профиль» (05.11.2026) */
.web-profile-logout { margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--line); }

/* a product not opened yet, on a computer (05.11.2026): in the content area next to the left panel, a bit lower */
@media (min-width: 960px) {
  html.is-web.in-workspace .screen.is-stub { max-width: 560px; margin: 0 auto; padding-top: 80px; }
  html.is-web.in-workspace .screen.is-stub:not(.hidden) ~ .tabbar .web-products { margin-top: 0; padding-top: 0; border-top: 0; }
}

/* the chosen section and product in the left menu (05.11.2026): the notched corner, as everything chosen */
@media (min-width: 960px) {
  html.is-web.in-workspace .tab.is-active, html.is-web .web-product.is-active {
    --notch: 9px;
    clip-path: polygon(0 0, calc(100% - var(--notch)) 0, 100% var(--notch), 100% 100%, 0 100%);
  }
}

/* «Поддержка» with two tabs (06.11.2026): «Настройка под ключ» and «Поддержка» */
.ws-tabs { margin: 10px 16px 0; }
.ws-empty { margin: auto 0; display: grid; gap: 14px; text-align: center; color: var(--muted); font-size: 14.5px; line-height: 1.5; padding: 8px 4px; }
.ws-note { align-self: center; color: var(--muted); font-size: 12.5px; margin: 0 0 4px; }
.web-support .hidden { display: none !important; }
/* the chat on a phone: the page under it stays still, the panel paints down to the keyboard (06.11.2026) */
html.ws-open, html.ws-open body { overflow: hidden; overscroll-behavior: none; }
@media (max-width: 719px) {
  .web-support { bottom: auto; height: 100dvh; box-shadow: 0 50vh 0 0 var(--surface); }
  .web-support .ws-body { overscroll-behavior: contain; }
}
/* photos in the chat (06.11.2026): the picture button, the picked photo above the field, photos in the bubbles */
.ws-attach { height: 44px; width: 44px; padding: 0; display: grid; place-items: center; cursor: pointer; flex: 0 0 auto; }
.ws-attach .ic { width: 20px; height: 20px; }
.ws-attached { position: relative; width: 76px; height: 76px; }
.ws-attached img { width: 76px; height: 76px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.ws-attached .icon-btn { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); }
.ws-attached .icon-btn .ic { width: 13px; height: 13px; }
.ws-bubble.has-photo { padding: 4px; display: grid; gap: 6px; }
.ws-bubble.has-photo > span { padding: 2px 8px 6px; }
.ws-photo { all: unset; display: block; cursor: zoom-in; border-radius: 11px; overflow: hidden; }
.ws-photo img { display: block; max-width: min(240px, 60vw); max-height: 320px; object-fit: cover; }
.ws-photo-wait { display: block; width: 180px; height: 120px; background: var(--line); }
.ws-photo-gone { display: block; padding: 10px 12px; color: var(--muted); font-size: 13px; }
.ws-photo-view { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .86); cursor: zoom-out; }
.ws-photo-view img { max-width: 100%; max-height: 100%; border-radius: 12px; }
