/**
 * Оболочка сайдбара и шапки: те же токены, что и в site.css (.ui-card, luxury-dark/light).
 */
.kosmos-body {
  --k-header-h: 0px;
  --k-sidebar-w: 272px;
  --k-accent: var(--site-accent);
  --k-accent-soft: var(--site-accent-light);
  /* Единый стиль как на референсе: глубокий синий + неоновые белые акценты */
  --k-bg: #063c85;
  --k-surface: rgba(6, 54, 122, 0.86);
  --k-surface-2: rgba(5, 45, 102, 0.9);
  --k-text: #eef6ff;
  --k-muted: rgba(230, 242, 255, 0.8);
  --k-border: rgba(176, 219, 255, 0.34);
  margin: 0;
  min-height: 100vh;
  background: var(--k-bg);
  color: var(--k-text);
  font-family: var(--site-font-sans, "Inter", system-ui, sans-serif);
}

.kosmos-body.luxury-light {
  --k-bg: var(--site-bg-light);
  --k-surface: rgba(255, 255, 255, 0.92);
  --k-surface-2: rgba(247, 248, 252, 0.96);
  --k-text: var(--site-text-light);
  --k-muted: var(--site-dimmed-light);
  --k-border: var(--site-border-light);
}

.kosmos-page.page {
  min-height: 100vh;
  position: relative;
}

.page {
  padding: 0 !important;
}

/* ——— Sidebar ——— */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 150;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

body.sidebar-open .sidebar-overlay {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

/* #site-sidebar — выше специфичности, чем body.dark .sidebar из app.min.css */
#site-sidebar.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--k-sidebar-w);
  max-width: none;
  align-items: stretch;
  z-index: 200;
  background: var(--k-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--k-border);
  box-shadow:
    4px 0 28px rgba(0, 18, 50, 0.45),
    inset -1px 0 0 rgba(255, 255, 255, 0.07),
    0 0 24px rgba(105, 190, 255, 0.12);
  display: flex;
  flex-direction: column;
  padding: 0 0 1rem;
  padding-left: 0;
  padding-right: 0;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.luxury-light #site-sidebar.sidebar {
  box-shadow:
    4px 0 24px rgba(15, 23, 42, 0.07),
    inset -1px 0 0 rgba(255, 255, 255, 0.5);
}

#site-sidebar .sidebar__close {
  display: none;
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--k-border);
  border-radius: var(--site-radius, 0.625rem);
  background: var(--k-surface-2);
  color: var(--k-text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

#site-sidebar .sidebar__close svg {
  width: 20px;
  height: 20px;
}

#site-sidebar .sidebar__logo {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 0;
  padding: 21px 77px 11px 0;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0;
  color: #ffffff;
  text-decoration: none;
  border-bottom: none;
}

#site-sidebar .sidebar__brand-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--k-text);
  opacity: 0.92;
}

#site-sidebar .sidebar__brand-text {
  display: inline-block;
  color: #ffffff;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-align: center;
}

#site-sidebar .sidebar__brand-logo {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  margin: 0;
  object-fit: contain;
}

#site-sidebar .sidebar__menu {
  flex: 1;
  padding: 0.75rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 0;
}

#site-sidebar .sidebar__logo-d-wrap {
  margin-top: 0.65rem;
  padding: 0.35rem 0.25rem 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: transparent;
  box-shadow: none;
}

#site-sidebar .sidebar__logo-d {
  width: min(240px, 100%);
  max-width: 120%;
  height: auto;
  display: block;
  object-fit: contain;
  background: transparent;
  background-color: transparent;
  opacity: 0.95;
  /* Файл рассчитан на тёмный сайдбар */
  filter: none;
}

.kosmos-body.luxury-dark #site-sidebar .sidebar__logo-d {
  filter: none;
  opacity: 0.97;
}

.kosmos-body.luxury-light #site-sidebar .sidebar__logo-d {
  filter: invert(1) brightness(1.05);
  opacity: 1;
}

/* Статус подписки: подпись слева, дата справа, одна строка */
#site-sidebar .sidebar-subscription-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.45rem 0.65rem;
  margin: 0 0 0.35rem;
  border-radius: var(--site-radius-lg, 1.125rem);
  border: 1px solid rgba(124, 108, 240, 0.38);
  background: rgba(124, 108, 240, 0.18);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(124, 108, 240, 0.12);
}

#site-sidebar .sidebar-subscription-status--inactive {
  background: rgba(0, 0, 0, 0.12);
  opacity: 0.95;
}

.kosmos-body.luxury-light #site-sidebar .sidebar-subscription-status--inactive {
  background: rgba(15, 23, 42, 0.06);
}

#site-sidebar .sidebar-subscription-status__label {
  flex: 0 1 auto;
  min-width: 0;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.88rem;
  text-align: left;
}

#site-sidebar .sidebar-subscription-status__date {
  flex: 0 1 auto;
  min-width: 0;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.92rem;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kosmos-body.luxury-light #site-sidebar .sidebar-subscription-status {
  border-color: rgba(124, 108, 240, 0.3);
  background: rgba(124, 108, 240, 0.1);
}

.kosmos-body.luxury-light #site-sidebar .sidebar-subscription-status__label {
  color: #ffffff;
}

#site-sidebar .sidebar-subscription-status--inactive .sidebar-subscription-status__date:empty {
  display: none;
}

/* Перебиваем .sidebar__item[href] из app.min (цвета, высота 48px, сужение <1260px) */
#site-sidebar .sidebar__item[href],
#site-sidebar .sidebar__item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  height: auto;
  min-height: 2.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--site-radius-lg, 1.125rem);
  color: var(--k-text);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.35;
  white-space: normal;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  text-align: left;
  width: 100%;
  max-width: none;
  font-family: inherit;
}

#site-sidebar .sidebar__item[href]:hover,
#site-sidebar .sidebar__item:hover {
  background: var(--k-accent-soft);
  color: var(--site-accent-hover, var(--k-accent));
  border-color: rgba(124, 108, 240, 0.25);
  box-shadow: 0 0 0 1px rgba(124, 108, 240, 0.12);
}

body.luxury-light #site-sidebar .sidebar__item[href]:hover,
body.luxury-light #site-sidebar .sidebar__item:hover {
  border-color: rgba(124, 108, 240, 0.35);
}

#site-sidebar .sidebar__item .sidebar__icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  opacity: 0.85;
  fill: none;
  stroke: currentColor;
}

#site-sidebar .sidebar__foot {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 1rem 0.85rem;
  margin-top: auto;
  border-top: 1px solid var(--k-border);
}

#site-sidebar .sidebar-share-btn {
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  cursor: pointer;
}

#site-sidebar .sidebar-share-btn__icon {
  flex-shrink: 0;
  opacity: 0.9;
}

.button-stroke {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--k-border);
  background: var(--k-surface-2);
  color: var(--k-text);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.button-stroke:hover {
  border-color: var(--site-accent);
  background: var(--k-accent-soft);
  color: var(--site-accent-hover, var(--site-accent));
}

#site-sidebar .sidebar-help-btn {
  width: 100%;
  box-sizing: border-box;
}

/* #site-app .header — выше, чем body.dark .header из app.min.css */
#site-app .header {
  position: fixed;
  left: var(--k-sidebar-w);
  right: 0;
  top: 0;
  height: var(--k-header-h);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 1.25rem;
  background: var(--k-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--k-border);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    inset 0 -1px 0 var(--k-border),
    0 0 24px rgba(105, 190, 255, 0.1);
  gap: 0.75rem;
}

body.luxury-light #site-app .header {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    inset 0 -1px 0 var(--k-border);
}

#site-app .header__burger {
  display: none;
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  margin-right: 0;
  flex-direction: column;
  border: 1px solid var(--k-border);
  border-radius: var(--site-radius, 0.625rem);
  background: var(--k-surface-2);
  cursor: pointer;
  padding: 0;
}

#site-app .header__burger::before,
#site-app .header__burger::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: var(--k-text);
  margin: 0 auto 5px;
  border-radius: 1px;
}

#site-app .header__burger::after {
  margin-bottom: 0;
  box-shadow: 0 -7px 0 var(--k-text);
}

#site-app .header__control {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 100%;
  min-width: 0;
}

#site-app .header__button.button-stroke {
  white-space: nowrap;
}

#site-app .header .header-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

#site-app .header .header-action__icon {
  flex-shrink: 0;
  display: block;
}

#site-app .header .theme-toggle-btn,
#site-app .header .header-logout-btn,
#site-app .header .header-link-tg-btn {
  padding: 0.45rem 0.85rem;
  font-size: 0.8125rem;
  border-radius: 10px;
  white-space: nowrap;
}

/* Узкая шапка: короче подписи, меньше отступов */
@media (max-width: 640px) {
  #site-app .header__control {
    gap: 0.4rem;
  }

  #site-app .header .theme-toggle-btn,
  #site-app .header .header-logout-btn,
  #site-app .header .header-link-tg-btn {
    padding: 0.4rem 0.55rem;
    font-size: 0.75rem;
  }
}

/*
 * Узкий экран: только иконки у «Привязать» / «Выйти» (тема и так без текста).
 * Порог с запасом под длинные строки ru/en.
 */
@media (max-width: 520px) {
  #site-app .header .header-action__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  #site-app .header .header-action-btn {
    position: relative;
    padding: 0.45rem;
    min-width: 2.5rem;
    min-height: 2.5rem;
    box-sizing: border-box;
  }

  #site-app .header .theme-toggle-btn {
    padding: 0.45rem;
    min-width: 2.5rem;
    min-height: 2.5rem;
    box-sizing: border-box;
  }
}

/* Кнопка «Привязать Telegram» — фирменный синий Telegram (#229ED9 / #2AABEE) */
#site-app .header .header-link-tg-btn.ui-btn-secondary {
  background: linear-gradient(180deg, #2aabee 0%, #229ed9 100%);
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14);
}

#site-app .header .header-link-tg-btn.ui-btn-secondary:hover {
  background: linear-gradient(180deg, #3eb8f5 0%, #2aa6e8 100%);
  border-color: rgba(0, 0, 0, 0.14);
  color: #ffffff;
  filter: none;
}

#site-app .header .header-link-tg-btn.ui-btn-secondary:focus-visible {
  outline: none;
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 0 3px rgba(34, 158, 217, 0.45), 0 1px 2px rgba(0, 0, 0, 0.14);
}

/* Модалка «Привязать Telegram» (классы download-modal из site.css) */
.link-telegram-modal__box {
  max-width: min(440px, calc(100vw - 2rem)) !important;
}

.link-telegram-modal__head {
  text-align: center;
  margin-bottom: 0.25rem;
}

.link-telegram-modal__subtitle {
  margin: 0.35rem 0 0;
  text-align: center;
  color: var(--k-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.link-telegram-modal__steps {
  margin-top: 1rem;
}

.link-telegram-modal__widget {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1.25rem 0 0;
  min-height: 48px;
}

.link-telegram-modal__note {
  margin-top: 1.35rem;
  padding: 1rem 1rem 1.1rem;
  border-radius: 12px;
  background: var(--k-accent-soft);
  border: 1px solid var(--k-border);
}

.link-telegram-modal__note-title {
  margin: 0 0 0.45rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--k-text);
}

.link-telegram-modal__note-text {
  margin: 0;
  line-height: 1.5;
  color: var(--k-muted);
}

.link-telegram-modal__status {
  text-align: center;
  margin: 1rem 0 0;
  min-height: 1.25em;
}

/* ——— Main ——— */
/* Перекрываем legacy .site-main из site.css */
.kosmos-body main.page__inner.site-main {
  max-width: none !important;
  margin-left: var(--k-sidebar-w) !important;
  margin-right: 0 !important;
  padding: 0 !important;
  padding-top: 0 !important;
  min-height: 100vh;
  box-sizing: border-box;
}

.sidebar-floating-toggle {
  display: none;
  position: fixed;
  top: max(0.9rem, env(safe-area-inset-top, 0px));
  left: max(0.9rem, env(safe-area-inset-left, 0px));
  z-index: 10003;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgba(181, 223, 255, 0.5);
  border-radius: 0.6rem;
  background: rgba(7, 58, 130, 0.88);
  color: #eef7ff;
  box-shadow: 0 0 18px rgba(110, 194, 255, 0.24);
}

.sidebar-floating-toggle::before,
.sidebar-floating-toggle::after {
  content: "";
  position: absolute;
  left: 0.65rem;
  right: 0.65rem;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

.sidebar-floating-toggle::before {
  top: 1.05rem;
  box-shadow: 0 0.42rem 0 currentColor;
}

.sidebar-floating-toggle::after {
  top: 1.47rem;
}

.page__container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.kosmos-body .page__title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 1.25rem;
  color: var(--k-text);
}

.kosmos-body .page__container .ui-title,
.kosmos-body .page__container .page-title {
  color: var(--k-text);
}

.kosmos-body .page__container .ui-subtitle {
  color: var(--k-muted);
}

/* Footer */
.kosmos-body .site-footer {
  border-top: 1px solid var(--k-border);
  background: var(--k-surface-2);
  margin-top: 0;
}

.kosmos-body .site-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem;
  padding-bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
}

/* === Force neon-blue style for shell chrome (header + sidebar) === */
body#site-body.kosmos-body #site-sidebar.sidebar {
  background: linear-gradient(180deg, rgba(6, 54, 122, 0.94), rgba(4, 42, 96, 0.96)) !important;
  border-right: 1px solid rgba(181, 223, 255, 0.42) !important;
  box-shadow:
    8px 0 30px rgba(0, 16, 48, 0.5),
    inset -1px 0 0 rgba(221, 242, 255, 0.12),
    0 0 32px rgba(114, 196, 255, 0.2) !important;
}

body#site-body.kosmos-body #site-sidebar .sidebar__logo {
  color: #f4faff !important;
  border-bottom-color: rgba(181, 223, 255, 0.36) !important;
}

body#site-body.kosmos-body #site-sidebar .sidebar__item[href],
body#site-body.kosmos-body #site-sidebar .sidebar__item {
  color: #eaf6ff !important;
  border-color: transparent !important;
  background: transparent !important;
}

body#site-body.kosmos-body #site-sidebar .sidebar__item[href]:hover,
body#site-body.kosmos-body #site-sidebar .sidebar__item:hover {
  color: #ffffff !important;
  background: rgba(146, 212, 255, 0.2) !important;
  border-color: rgba(198, 233, 255, 0.58) !important;
  box-shadow: 0 0 18px rgba(142, 210, 255, 0.28) !important;
}

body#site-body.kosmos-body #site-sidebar .sidebar__foot {
  border-top-color: rgba(181, 223, 255, 0.3) !important;
}

body#site-body.kosmos-body #site-sidebar .button-stroke {
  background: rgba(9, 66, 143, 0.44) !important;
  border-color: rgba(181, 223, 255, 0.42) !important;
  color: #edf7ff !important;
}

body#site-body.kosmos-body #site-sidebar .button-stroke:hover {
  background: rgba(146, 212, 255, 0.2) !important;
  border-color: rgba(211, 239, 255, 0.7) !important;
  color: #ffffff !important;
}

body#site-body.kosmos-body #site-app .header {
  background: linear-gradient(180deg, rgba(7, 58, 130, 0.9), rgba(5, 49, 111, 0.94)) !important;
  border-bottom: 1px solid rgba(181, 223, 255, 0.4) !important;
  box-shadow:
    0 1px 0 rgba(226, 244, 255, 0.12) inset,
    0 10px 24px rgba(0, 20, 55, 0.28),
    0 0 26px rgba(110, 194, 255, 0.16) !important;
}

body#site-body.kosmos-body #site-app .header .ui-btn-secondary,
body#site-body.kosmos-body #site-app .header .theme-toggle-btn,
body#site-body.kosmos-body #site-app .header .header-logout-btn {
  background: rgba(9, 66, 143, 0.42) !important;
  border: 1px solid rgba(181, 223, 255, 0.42) !important;
  color: #eef7ff !important;
}

body#site-body.kosmos-body #site-app .header .ui-btn-secondary:hover,
body#site-body.kosmos-body #site-app .header .theme-toggle-btn:hover,
body#site-body.kosmos-body #site-app .header .header-logout-btn:hover {
  background: rgba(146, 212, 255, 0.2) !important;
  border-color: rgba(211, 239, 255, 0.7) !important;
  color: #ffffff !important;
}

/* Узкие экраны: плотнее контент, без лишних полей */
@media (max-width: 480px) {
  .page__container {
    padding-left: max(0.875rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.875rem, env(safe-area-inset-right, 0px));
    padding-top: 1.125rem;
    padding-bottom: max(2rem, env(safe-area-inset-bottom, 0px));
  }

  .kosmos-body .page__title {
    font-size: 1.35rem;
    margin-bottom: 1rem;
  }

  .kosmos-body .site-footer-inner {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    gap: 0.65rem;
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
  }

  body.guest-kosmos-body .page_simple .entry {
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
  }

  .guest-entry__title {
    font-size: clamp(1.4rem, 6.5vw, 1.85rem);
    margin-bottom: 2px;
  }

  body.guest-kosmos-body .guest-login-hero {
    margin-bottom: 0.45rem;
  }

  body.guest-kosmos-body .guest-login-hero__lead {
    font-size: 1.02rem;
  }

  body.guest-kosmos-body .guest-login-hero__devices {
    font-size: 0.95rem;
  }

  .guest-entry__lead {
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
  }
}

/* Mobile / tablet */
@media (max-width: 1023px) {
  #site-sidebar.sidebar {
    transform: translateX(-102%);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.2);
    padding-top: env(safe-area-inset-top, 0px);
    padding-left: 0;
    padding-right: 0;
    width: min(100%, var(--k-sidebar-w)) !important;
  }

  body.sidebar-open #site-sidebar.sidebar {
    transform: translateX(0);
  }

  #site-sidebar .sidebar__close {
    display: flex;
  }

  .sidebar-floating-toggle {
    display: block;
  }

  .kosmos-body main.page__inner.site-main {
    margin-left: 0 !important;
    width: 100%;
    max-width: 100%;
    padding-top: 0 !important;
  }
}

@media (min-width: 1024px) {
  body.sidebar-open .sidebar-overlay {
    display: none !important;
    pointer-events: none !important;
  }
}

/*
 * Гостевой экран входа.
 * В app.min.css у .page задано padding: 96px 0 0 340px (под сайдбар) — из‑за каскада/медиа контент
 * уезжает вправо и вниз. Сбрасываем явно (см. .page в app.min.css ~3964).
 */
body.guest-kosmos-body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
}

body.guest-kosmos-body #site-app.kosmos-page.page {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  max-width: none;
}

body.guest-kosmos-body .kosmos-page.page.page_simple,
body.guest-kosmos-body #page.page.page_simple {
  padding: 0 !important;
  margin: 0 !important;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

body.guest-kosmos-body .page_simple .entry {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
}

body.guest-kosmos-body .guest-login-hero {
  text-align: center;
  margin: 0 auto 0.55rem;
  max-width: min(26rem, 100%);
}

body.guest-kosmos-body .guest-login-hero__lead {
  margin: 0 0 0.4rem;
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.38;
  color: var(--k-text);
  letter-spacing: -0.01em;
}

body.guest-kosmos-body .guest-login-hero__devices {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.42;
  color: var(--k-muted);
}

.guest-entry__title {
  font-size: clamp(1.5rem, 6.5vw, 2rem);
  margin-bottom: 4px;
  line-height: 1.15;
  text-align: center;
}

.guest-entry__lead {
  margin-bottom: 32px;
  text-align: center;
  color: var(--k-muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.guest-entry__or {
  text-align: center;
  margin-top: 0.65rem;
}

.tg-bt-cnt {
  display: flex;
  justify-content: center;
  margin-top: 0.65rem;
}

.guest-login-status {
  text-align: center;
  margin-top: 0.4rem;
}

body.guest-kosmos-body .guest-email-step,
body.guest-kosmos-body .guest-email-code-step {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
}

body.guest-kosmos-body .guest-email-sent-notice {
  margin: 0;
  line-height: 1.55;
  text-align: center;
  color: var(--k-text);
}

body.guest-kosmos-body .guest-email-code-step .field {
  margin-top: 0;
}

body.guest-kosmos-body .entry__button--secondary {
  background: var(--k-surface) !important;
  color: var(--k-text) !important;
  border: 1px solid var(--k-border) !important;
}

body.guest-kosmos-body .entry__button--outline {
  background: transparent !important;
  color: var(--k-muted) !important;
  border: 1px solid var(--k-border) !important;
}

body.guest-kosmos-body .entry__button--secondary:hover,
body.guest-kosmos-body .entry__button--outline:hover {
  filter: brightness(1.05);
}

.guest-theme-toggle {
  margin-top: 1rem;
}

/* Гостевой экран: поля и кнопки (раньше в app.min Kosmos) */
body.guest-kosmos-body .entry__wrapper {
  margin: 0 auto;
  max-width: 310px;
  width: 100%;
}

body.guest-kosmos-body .entry__fieldset {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  border: none;
  min-width: 0;
}

body.guest-kosmos-body .field {
  margin: 0;
}

/* Поле ввода и иконка — из app.min.css (.field_icon .field__input { padding-left: 48px }, .field__icon { width: 48px }).
   Не переопределять padding/позицию иконки, иначе текст наезжает на иконку. */

body.guest-kosmos-body .guest-entry__email-hint {
  margin: 0 0 0.15rem;
  line-height: 1.35;
  text-align: center;
}

body.guest-kosmos-body .entry__button.button,
body.guest-kosmos-body button.entry__button {
  width: 100%;
  padding: 0.72rem 0.9rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #8fd3ff, #d8f1ff);
  color: #063c85;
  border: 1px solid rgba(255, 255, 255, 0.86);
  box-shadow: 0 0 20px rgba(169, 227, 255, 0.4);
  transition: filter 0.15s ease, transform 0.05s ease;
}

body.guest-kosmos-body .entry__button.button:hover,
body.guest-kosmos-body button.entry__button:hover {
  filter: brightness(1.06);
}

body.guest-kosmos-body .entry__button.button:active,
body.guest-kosmos-body button.entry__button:active {
  transform: scale(0.99);
}

body.guest-kosmos-body .guest-theme-toggle.theme {
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

body.guest-kosmos-body .guest-theme-toggle .theme__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}

body.guest-kosmos-body .guest-theme-toggle .theme__inner {
  display: inline-flex;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--k-border);
  background: var(--k-surface);
}

body.guest-kosmos-body .guest-theme-toggle .theme__box {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.42rem 0.72rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--k-muted);
  background: transparent;
  transition: background 0.15s ease, color 0.15s ease;
}

body.guest-kosmos-body .guest-theme-toggle .theme__input:checked + .theme__inner .theme__box:last-child,
body.guest-kosmos-body .guest-theme-toggle .theme__input:not(:checked) + .theme__inner .theme__box:first-child {
  background: var(--k-accent-soft);
  color: var(--k-accent);
}

body.guest-kosmos-body .guest-notify-block {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 300;
  pointer-events: none;
}

body.guest-kosmos-body .guest-notify-block .hide-all-notify {
  pointer-events: auto;
}

body.guest-kosmos-body .h2.entry__title,
body.guest-kosmos-body .entry__title {
  margin-top: 0;
}

body.guest-kosmos-body .entry__note {
  margin: 0;
  font-size: 0.9rem;
  color: var(--k-muted);
}
