/* MoonGarden — WEBSITE preview style */

:root {
  /* База страницы: один цвет по краям viewport — hero и боковые виньетки к нему привязаны */
  --page-bg: #02020b;
  --page-bg-image:
    radial-gradient(ellipse 90% 55% at 50% -10%, rgba(124, 58, 237, 0.16), transparent 52%),
    radial-gradient(ellipse 85% 50% at 50% 108%, rgba(76, 29, 149, 0.14), transparent 48%),
    radial-gradient(ellipse 110% 55% at 50% 38%, rgba(124, 58, 237, 0.09), transparent 60%);
  --shell-bg: #05061a;
  --glass: rgba(18, 14, 42, 0.25);
  --border: rgba(137, 111, 255, 0.2);
  --text: #ede9ff;
  --text-muted: #a79fcf;
  --accent: #7c3aed;
  --accent-2: #a78bfa;
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Inter", system-ui, sans-serif;
  --font-display: "Sora", "Inter", system-ui, sans-serif;
  /* Скролл как в лаунчере */
  --scroll-track: rgba(10, 8, 20, 0.32);
  --scroll-thumb: linear-gradient(
    180deg,
    rgba(110, 98, 150, 0.38) 0%,
    rgba(72, 64, 108, 0.34) 50%,
    rgba(48, 42, 78, 0.4) 100%
  );
  --scroll-thumb-hover: linear-gradient(
    180deg,
    rgba(128, 116, 168, 0.48) 0%,
    rgba(88, 78, 128, 0.44) 50%,
    rgba(58, 50, 92, 0.5) 100%
  );
  --scroll-border: rgba(4, 3, 12, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: auto;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* Запас под липкую шапку при переходе по якорю (в т.ч. при открытии URL с #) */
#features,
#gallery,
#news,
#start,
#info,
#about {
  scroll-margin-top: 88px;
}

html,
body {
  margin: 0;
  height: 100%;
  min-height: 100%;
}

/* Скроллбар страницы и внутренних панелей — как .main-scroll в лаунчере */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 90, 140, 0.42) var(--scroll-track);
}

*::-webkit-scrollbar {
  width: 10px;
}

*::-webkit-scrollbar-track {
  margin: 6px 0;
  background: var(--scroll-track);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

*::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  background: var(--scroll-thumb);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.06),
    inset 0 -2px 4px rgba(0, 0, 0, 0.35),
    0 1px 3px rgba(0, 0, 0, 0.25);
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.09),
    inset 0 -2px 4px rgba(0, 0, 0, 0.32),
    0 1px 4px rgba(0, 0, 0, 0.22),
    0 0 10px rgba(90, 80, 130, 0.22);
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

/* Явно для основных скролл-областей сайта */
html,
.site-scroll-area,
.site-news-article,
.site-modal__panel {
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 90, 140, 0.42) var(--scroll-track);
}

html::-webkit-scrollbar,
.site-scroll-area::-webkit-scrollbar,
.site-news-article::-webkit-scrollbar,
.site-modal__panel::-webkit-scrollbar {
  width: 10px;
}

html::-webkit-scrollbar-track,
.site-scroll-area::-webkit-scrollbar-track,
.site-news-article::-webkit-scrollbar-track,
.site-modal__panel::-webkit-scrollbar-track {
  margin: 6px 0;
  background: var(--scroll-track);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

html::-webkit-scrollbar-thumb,
.site-scroll-area::-webkit-scrollbar-thumb,
.site-news-article::-webkit-scrollbar-thumb,
.site-modal__panel::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  background: var(--scroll-thumb);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.06),
    inset 0 -2px 4px rgba(0, 0, 0, 0.35),
    0 1px 3px rgba(0, 0, 0, 0.25);
}

html::-webkit-scrollbar-thumb:hover,
.site-scroll-area::-webkit-scrollbar-thumb:hover,
.site-news-article::-webkit-scrollbar-thumb:hover,
.site-modal__panel::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.09),
    inset 0 -2px 4px rgba(0, 0, 0, 0.32),
    0 1px 4px rgba(0, 0, 0, 0.22),
    0 0 10px rgba(90, 80, 130, 0.22);
}

html::-webkit-scrollbar-corner,
.site-scroll-area::-webkit-scrollbar-corner,
.site-news-article::-webkit-scrollbar-corner,
.site-modal__panel::-webkit-scrollbar-corner {
  background: transparent;
}

body {
  overflow: hidden;
}

body {
  background-color: var(--page-bg);
  /* Радиальный фон страницы (при необходимости зона под main — прозрачность в самой картинке героя) */
  background-image: var(--page-bg-image);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.site-root {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.site-shell {
  height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100%;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
}

.site-scroll-area {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.site-header {
  position: relative;
  z-index: 40;
  border-bottom: 1px solid rgba(136, 112, 255, 0.16);
  background: rgba(10, 10, 30, 0.8);
  backdrop-filter: blur(10px);
}

.site-header__inner {
  min-height: 64px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: 16px;
  row-gap: 10px;
}

.site-header__inner > .brand {
  justify-self: start;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
  justify-content: flex-end;
  flex-wrap: nowrap;
  min-width: 0;
}

.site-header__auth {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-header__auth .is-auth-loading {
  opacity: 0.85;
  cursor: default;
  pointer-events: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
}

.product-mark.product-mark--brand {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  flex-shrink: 0;
  object-fit: contain;
}

.product-mark--feature {
  width: 22px;
  height: 22px;
}

.site-header nav {
  justify-self: center;
  max-width: 100%;
}

.nav-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a.is-active {
  color: var(--text);
  text-shadow: 0 0 16px rgba(167, 139, 250, 0.45);
}

.btn {
  height: 38px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  transition: filter 0.18s ease, box-shadow 0.18s ease;
}

.btn--primary {
  color: #fff;
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  border-color: rgba(167, 139, 250, 0.4);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35);
}

.btn--ghost {
  color: #ebe4ff;
  background: rgba(16, 14, 34, 0.74);
  border-color: var(--border);
}

.btn:hover {
  filter: brightness(1.08);
}

main {
  --main-hero-overlap: 64px;
  position: relative;
  z-index: 2;
  margin-top: calc(-1 * var(--main-hero-overlap));
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 24px 28px;
}

.hero {
  margin-top: 0;
  width: 100%;
  border: none;
  border-radius: 0;
  position: sticky;
  top: 0;
  z-index: 1;
  margin-bottom: 0;
  /* при скролле задаётся из JS: --hero-opacity (1 → прозрачнее), фон страницы проступает */
  opacity: var(--hero-opacity, 1);
}

.hero__bg {
  position: relative;
  z-index: 0;
  overflow: hidden;
  min-height: clamp(560px, 88vh, 880px);
  /* Только картинка — без общего тинта (убирает расхождение оттенка слева с фоном сайта) */
  background: url("site/site-hero-bg.png") center / cover no-repeat;
}

/* Низ героя: оба нижних угла и вся нижняя кромка плавно уходят в фон страницы */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse min(108vw, 1120px) min(82vh, 580px) at 0% 100%,
      var(--page-bg) 0%,
      color-mix(in srgb, var(--page-bg) 90%, transparent) 12%,
      color-mix(in srgb, var(--page-bg) 62%, transparent) 28%,
      color-mix(in srgb, var(--page-bg) 36%, transparent) 44%,
      color-mix(in srgb, var(--page-bg) 16%, transparent) 58%,
      color-mix(in srgb, var(--page-bg) 6%, transparent) 70%,
      transparent 86%
    ),
    radial-gradient(
      ellipse min(108vw, 1120px) min(82vh, 580px) at 100% 100%,
      var(--page-bg) 0%,
      color-mix(in srgb, var(--page-bg) 90%, transparent) 12%,
      color-mix(in srgb, var(--page-bg) 62%, transparent) 28%,
      color-mix(in srgb, var(--page-bg) 36%, transparent) 44%,
      color-mix(in srgb, var(--page-bg) 16%, transparent) 58%,
      color-mix(in srgb, var(--page-bg) 6%, transparent) 70%,
      transparent 86%
    ),
    linear-gradient(
      to bottom,
      transparent 0%,
      transparent 50%,
      color-mix(in srgb, var(--page-bg) 8%, transparent) 62%,
      color-mix(in srgb, var(--page-bg) 28%, transparent) 74%,
      color-mix(in srgb, var(--page-bg) 55%, transparent) 84%,
      color-mix(in srgb, var(--page-bg) 82%, transparent) 93%,
      var(--page-bg) 100%
    );
}

.hero__content {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 36px 36px;
}

.hero__logo {
  width: min(640px, 86%);
  height: auto;
  /* Двойной drop-shadow: свечение + глубина (как у лого в лаунчере, без артефактов на PNG) */
  filter: drop-shadow(0 0 24px rgba(124, 58, 237, 0.45)) drop-shadow(0 10px 28px rgba(0, 0, 0, 0.55));
}

.hero__tagline {
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.8rem);
  font-family: var(--font-display);
  font-weight: 600;
}

.hero__text {
  margin: 0;
  max-width: 640px;
  color: #d3caef;
  font-size: 16px;
  line-height: 1.65;
}

.hero__actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.content-section {
  margin-top: 16px;
  border: 1px solid rgba(137, 111, 255, 0.16);
  border-radius: var(--radius);
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 20px;
}

/* Стрелки слайдера — по центру левого/правого рёбра карточки, наполовину снаружи секции */
.content-section--slider {
  position: relative;
}

.content-section--slider > .gallery-wrap,
.content-section--slider > .news-wrap {
  min-width: 0;
}

.content-section--slider .content-section__slider-nav {
  position: absolute;
  top: 50%;
  z-index: 4;
  margin-top: 0;
}

.content-section--slider .content-section__slider-nav--prev {
  left: 0;
  transform: translate(-50%, -50%);
}

.content-section--slider .content-section__slider-nav--next {
  right: 0;
  transform: translate(50%, -50%);
}

/* Новости: одна рамка секции; карточка внутри без второго «стекла» */
.content-section--news .section-title {
  margin-bottom: 0;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.content-section--news.content-section--slider .news-wrap {
  margin-top: 14px;
}

.news-wrap {
  position: relative;
}

.news-coldstart-box {
  display: grid;
  gap: 10px;
  justify-items: start;
  padding: 12px 0 4px;
}

.news-fetch-substatus {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.news-slider-viewport {
  width: 100%;
  overflow: hidden;
  height: clamp(460px, 56vh, 640px);
  position: relative;
  z-index: 0;
  /* Только вертикаль отдаём браузеру (скролл текста внутри слайда); горизонталь остаётся для pointer-свайпа в JS. */
  touch-action: pan-y;
  cursor: grab;
}

.news-slider-viewport.is-dragging {
  cursor: grabbing;
}

/* Над текстом новости не показываем "руку"/grab */
.news-slider-viewport .site-news-title,
.news-slider-viewport .site-news-prose,
.news-slider-viewport .site-news-prose p,
.news-slider-viewport .site-news-lead,
.news-slider-viewport .site-news-published,
.news-slider-viewport time {
  cursor: text;
}

.news-track {
  display: flex;
  height: 100%;
  width: calc(100% * var(--news-slides, 3));
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.32, 1);
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .news-track {
    transition: none;
  }
}

.site-news-article {
  flex: 0 0 calc(100% / var(--news-slides, 3));
  width: calc(100% / var(--news-slides, 3));
  min-width: 0;
  height: 100%;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: auto;
  touch-action: pan-y;
  padding-right: 6px;
  box-sizing: border-box;
}

.site-news-card {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
}

/* Тело новости: тёмная панель как meta в лаунчере */
.server-meta-panel.site-news-meta {
  margin-top: 12px;
  margin-bottom: 0;
}

.server-meta-panel.site-news-meta .site-news-prose {
  margin-top: 0;
}

/* Обтекание: картинки в углах / сбоку */
.site-news-prose::after {
  content: "";
  display: table;
  clear: both;
}

.server-meta-panel.site-news-meta .site-news__hero {
  display: block;
  object-fit: cover;
  object-position: center;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

/* Первая новость: превью в левом верхнем углу текстового блока */
.site-news__hero--tl {
  float: left;
  width: min(40%, 210px);
  max-height: 150px;
  margin: 0 14px 10px 0;
}

.site-news__hero--lc {
  float: left;
  width: min(40%, 210px);
  max-height: 150px;
  margin: 0.35rem 14px 12px 0;
  margin-top: clamp(1.5rem, 4vh, 2.75rem);
}

.site-news__hero--br {
  float: right;
  width: min(40%, 210px);
  max-height: 150px;
  margin: 12px 0 8px 14px;
  clear: right;
}

.site-news-published {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.site-news-published time {
  font-variant-numeric: tabular-nums;
}

/* Как в лаунчере: server-card-inner (подвал) + server-meta-panel */
.server-card-inner {
  padding: 22px 22px 18px;
  border-radius: var(--radius);
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.server-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.server-card-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.server-card-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.product-mark-box--site {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 16px;
  padding: 8px;
  background: linear-gradient(
    168deg,
    rgba(150, 130, 220, 0.16) 0%,
    rgba(118, 100, 190, 0.14) 22%,
    rgba(72, 58, 130, 0.16) 48%,
    rgba(36, 28, 72, 0.2) 72%,
    rgba(14, 10, 32, 0.28) 100%
  );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(20px) saturate(1.35);
  -webkit-backdrop-filter: blur(20px) saturate(1.35);
}

.product-mark--site {
  width: 44px;
  height: 44px;
  margin: 0;
  object-fit: contain;
}

.server-meta-panel {
  margin-top: 18px;
  padding: 12px 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(3, 2, 12, 0.54);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 4px 20px rgba(0, 0, 0, 0.35);
}

.server-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 0;
}

.server-meta > div {
  padding: 2px 12px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.server-meta > div:not(:first-child) {
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.server-meta dt {
  margin: 0;
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(155, 146, 196, 0.85);
}

.server-meta dd {
  margin: 5px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.site-news-head {
  margin-bottom: 10px;
  justify-content: space-between;
  align-items: center;
}

.site-news-head .server-card-main {
  flex: 1;
}

.site-news-head-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
}

.site-news-head-nav .gallery-nav {
  position: static;
  transform: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.site-news-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.site-news-prose {
  margin-top: 0;
}

.site-news-prose .site-news-lead {
  margin: 0 0 14px;
  color: rgba(220, 214, 250, 0.95);
  font-size: 15px;
  line-height: 1.65;
}

.site-news-prose p {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.65;
}

.site-news-prose p:last-child {
  margin-bottom: 0;
}

#features {
  position: relative;
  z-index: 2;
}

.section-title {
  margin: 0 0 14px;
  font-size: 24px;
  font-family: var(--font-display);
  font-weight: 600;
}

.feature-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.feature-card {
  border: 1px solid rgba(137, 111, 255, 0.2);
  border-radius: var(--radius-sm);
  background: var(--glass);
  padding: 18px;
}

.feature-card__icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(124, 58, 237, 0.16);
  border: 1px solid rgba(167, 139, 250, 0.3);
  margin-bottom: 10px;
  color: #cabaff;
}

.feature-card__icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.feature-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.feature-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.gallery-wrap {
  position: relative;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.gallery-shot {
  border: 1px solid rgba(137, 111, 255, 0.22);
  border-radius: 9px;
  overflow: hidden;
  padding: 0;
  background: rgba(13, 11, 30, 0.6);
  cursor: pointer;
}

.gallery-shot img {
  width: 100%;
  height: 156px;
  object-fit: cover;
}

.gallery-shot.is-active {
  border-color: rgba(167, 139, 250, 0.62);
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.3);
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-58%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(137, 111, 255, 0.3);
  background: rgba(10, 8, 26, 0.9);
  color: var(--text);
  display: grid;
  place-items: center;
}

.gallery-nav--prev {
  left: -20px;
}

.gallery-nav--next {
  right: -20px;
}

.gallery-dots {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.gallery-dots button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.25);
  padding: 0;
}

.gallery-dots button.is-active {
  background: var(--accent-2);
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.step-card {
  border: 1px solid rgba(137, 111, 255, 0.2);
  border-radius: var(--radius-sm);
  background: var(--glass);
  padding: 18px;
}

.step-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  border: 1px solid rgba(167, 139, 250, 0.45);
  font-weight: 700;
  margin-bottom: 10px;
}

.step-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.step-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.site-modal-open {
  overflow: hidden;
}

.site-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
}

.site-modal[hidden] {
  display: none;
}

.site-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 2, 12, 0.48);
  backdrop-filter: blur(14px);
  border: none;
  cursor: pointer;
}

.site-modal__panel {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  max-height: min(90vh, 720px);
  overflow-y: auto;
  padding: 22px 22px 20px;
  border-radius: var(--radius);
  border: 1px solid rgba(137, 111, 255, 0.28);
  background: rgba(14, 12, 32, 0.96);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  outline: none;
}

.site-modal__panel.site-modal__panel--loading {
  min-height: 280px;
}

.site-modal__panel.site-modal__panel--loading .account-panel {
  display: none !important;
}

.site-modal__panel.site-modal__panel--loading::after {
  content: "Загрузка профиля.";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 14px;
  letter-spacing: 0.03em;
  animation: mg-loading-text-dots 1.1s steps(1, end) infinite;
}

@keyframes mg-loading-text-dots {
  0%,
  24% {
    content: "Загрузка профиля.";
  }
  25%,
  49% {
    content: "Загрузка профиля..";
  }
  50%,
  74% {
    content: "Загрузка профиля...";
  }
  75%,
  100% {
    content: "Загрузка профиля";
  }
}

.site-modal__panel--auth {
  width: min(420px, 100%);
}

.site-modal__panel--cabinet {
  width: min(860px, 100%);
  max-height: min(92vh, 880px);
  padding: 26px 28px 24px;
}

.site-modal__head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.site-modal__title {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
}

.site-modal__x {
  flex-shrink: 0;
  margin-left: auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid rgba(137, 111, 255, 0.25);
  background: rgba(10, 8, 26, 0.85);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
}

.site-modal__x:hover {
  color: var(--text);
  border-color: rgba(167, 139, 250, 0.45);
}

.auth-segmented {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(137, 111, 255, 0.22);
  background: rgba(8, 6, 22, 0.65);
}

#auth-segmented-head {
  flex: 0 1 320px;
  margin-left: auto;
}

.site-modal__panel--cabinet #auth-segmented-head {
  display: none;
}

.auth-segment {
  flex: 1;
  height: 40px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 0 12px;
  font-family: inherit;
}

.auth-segment:hover {
  color: var(--text);
}

.auth-segment.is-active {
  color: var(--text);
  background: rgba(124, 58, 237, 0.32);
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.35);
}

.account-lead {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
}

.account-auth-switch {
  margin: 18px 0 0;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

.account-link {
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent-2);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.account-link:hover {
  color: #ddd6fe;
}

.auth-view[hidden] {
  display: none !important;
}

.account-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.account-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.account-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.account-input {
  height: 42px;
  border-radius: 9px;
  border: 1px solid rgba(137, 111, 255, 0.28);
  background: rgba(8, 6, 22, 0.85);
  color: var(--text);
  padding: 0 12px;
  font-size: 15px;
}

.account-input:focus {
  outline: none;
  border-color: rgba(167, 139, 250, 0.65);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

.account-hint {
  margin: 0;
  min-height: 1.25em;
  font-size: 13px;
  color: #f0abfc;
}

.account-submit {
  width: 100%;
  margin-top: 4px;
}

.cabinet-layout {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: 28px;
  align-items: stretch;
}

.cabinet-aside {
  position: relative;
  top: auto;
  height: 100%;
}

.cabinet-main {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.cabinet-server-tag {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c4b5fd;
  border: 1px solid rgba(167, 139, 250, 0.35);
  background: rgba(124, 58, 237, 0.15);
}

.cabinet-server-tag-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.cabinet-server-tag-wrap .cabinet-server-tag {
  margin-bottom: 0;
}

.cabinet-admin-tag {
  display: inline-block;
  position: absolute;
  right: 0;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7dd3fc;
  border: 1px solid rgba(125, 211, 252, 0.45);
  background: rgba(14, 116, 144, 0.2);
}

.cabinet-profile-head {
  margin-bottom: 16px;
}

.cabinet-nick-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.cabinet-nick-line {
  margin: 0;
  font-size: 15px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.cabinet-nick-line strong {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.cabinet-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cabinet-profile-actions .btn {
  min-width: 138px;
}

.cabinet-inline-label {
  color: var(--text-muted);
  font-size: 14px;
}

.cabinet-model-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.cabinet-model-picker {
  width: fit-content;
  max-width: 100%;
  position: relative;
}

.cabinet-model-picker__trigger {
  width: 100%;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(137, 111, 255, 0.28);
  background: rgba(10, 8, 26, 0.85);
  color: var(--text);
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font: inherit;
  cursor: pointer;
}

.cabinet-model-picker__menu {
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  display: none;
  position: absolute;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(16, 12, 32, 0.92);
  backdrop-filter: blur(12px);
  z-index: 25;
}

.cabinet-model-picker__menu.is-open {
  display: block;
}

.cabinet-model-picker__menu button {
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
}

.cabinet-model-picker__menu button:hover,
.cabinet-model-picker__menu button.is-selected {
  color: var(--text);
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(167, 139, 250, 0.3);
}

.cabinet-section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.cabinet-section-title--spaced {
  margin-top: 22px;
}

.cabinet-skin-section {
  margin-top: auto;
  padding-top: 20px;
}

.cabinet-section-desc {
  margin: 8px 0 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

.cabinet-meta {
  margin: 0;
  display: grid;
  gap: 12px;
}

.cabinet-meta > div {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  align-items: baseline;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cabinet-meta > div:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.cabinet-meta dt {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.cabinet-meta dd {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.cabinet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(137, 111, 255, 0.18);
}

.cabinet-actions .btn {
  flex: 1 1 auto;
  min-width: 140px;
}

.cabinet-actions--aside {
  margin-top: 14px;
  padding-top: 14px;
}

.cabinet-actions--aside .btn {
  width: 100%;
}

.skin-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(137, 111, 255, 0.18);
  background: rgba(8, 6, 22, 0.5);
}

.skin-preview--mc {
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(45, 212, 191, 0.22);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.4),
    0 12px 32px rgba(0, 0, 0, 0.35);
}

.skin-preview__checker {
  position: absolute;
  inset: 0;
  opacity: 0.38;
  background-color: #1a1528;
  background-image:
    linear-gradient(45deg, #2a2438 25%, transparent 25%),
    linear-gradient(-45deg, #2a2438 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #2a2438 75%),
    linear-gradient(-45deg, transparent 75%, #2a2438 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
  pointer-events: none;
}

.skin-preview--mc .skin-preview__figure-wrap {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
}

.skin-preview__figure {
  width: 112px;
  height: 152px;
  border-radius: 4px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.35);
  image-rendering: pixelated;
}

.skin-preview--mc .skin-preview__figure {
  border-radius: 6px;
  border: 3px solid rgba(20, 16, 40, 0.9);
}

.skin-preview__caption {
  position: relative;
  z-index: 1;
  width: 100%;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.skin-preview__hint {
  position: relative;
  z-index: 1;
  margin: 14px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}

.skin-grid {
  margin: 0;
  padding: 0;
  border: none;
}

.skin-grid__inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.skin-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-height: 118px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(137, 111, 255, 0.2);
  background: rgba(12, 10, 28, 0.65);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.skin-option:hover {
  border-color: rgba(167, 139, 250, 0.4);
}

.skin-option.is-selected {
  border-color: rgba(196, 181, 253, 0.75);
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.3);
}

.skin-option.is-active {
  border-color: rgba(167, 139, 250, 0.85);
  box-shadow:
    0 0 0 1px rgba(124, 58, 237, 0.35),
    0 0 16px rgba(124, 58, 237, 0.18);
}

.skin-option__preview {
  width: 100%;
  height: 70px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(45deg, rgba(40, 34, 60, 0.8) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(40, 34, 60, 0.8) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(40, 34, 60, 0.8) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(40, 34, 60, 0.8) 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.skin-option__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.skin-option__placeholder {
  font-size: 11px;
  color: rgba(196, 181, 253, 0.75);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.skin-option__label {
  text-align: left;
  line-height: 1.2;
  color: var(--text-muted);
}

.skin-option__download {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 7px;
  border: 1px solid rgba(137, 111, 255, 0.26);
  background: rgba(10, 8, 26, 0.72);
  color: var(--text-muted);
  line-height: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.skin-option__download svg {
  display: block;
}

.skin-option:hover .skin-option__download,
.skin-option.is-selected .skin-option__download {
  opacity: 1;
  pointer-events: auto;
}

.skin-option__download:hover {
  color: var(--text);
  border-color: rgba(167, 139, 250, 0.45);
  background: rgba(124, 58, 237, 0.22);
}

.skin-slot-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.skin-slot-actions .btn {
  min-width: 140px;
}

#skin-slot-remove:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}

.cabinet-mini-modal {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: grid;
  place-items: center;
  padding: 20px;
}

.cabinet-mini-modal[hidden] {
  display: none;
}

.cabinet-mini-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 2, 12, 0.45);
  backdrop-filter: blur(10px);
}

.cabinet-mini-modal__panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid rgba(137, 111, 255, 0.28);
  background: rgba(14, 12, 32, 0.96);
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.45);
}

.cabinet-mini-modal__panel .account-field + .account-field {
  margin-top: 12px;
}

.cabinet-mini-modal__panel .account-label {
  display: block;
  margin-bottom: 6px;
}

.cabinet-mini-modal__title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.cabinet-mini-modal__actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.site-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 320;
  max-width: min(420px, calc(100% - 24px));
}

.site-toast[hidden] {
  display: none;
}

.site-toast__body {
  border-radius: 12px;
  border: 1px solid rgba(137, 111, 255, 0.28);
  background: rgba(18, 14, 40, 0.94);
  color: var(--text);
  padding: 11px 14px;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
}

.site-toast__body.is-success {
  border-color: rgba(52, 211, 153, 0.4);
  box-shadow:
    0 12px 34px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(52, 211, 153, 0.16);
}

.site-toast__body.is-error {
  border-color: rgba(251, 113, 133, 0.45);
  box-shadow:
    0 12px 34px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(251, 113, 133, 0.16);
}

.skin-preview__figure-wrap--3d {
  width: 220px;
  height: 300px;
}

.skin-preview__canvas {
  width: 100%;
  height: 100%;
  display: block;
}

@media (max-width: 720px) {
  .cabinet-layout {
    grid-template-columns: 1fr;
  }

  .cabinet-aside {
    position: static;
  }

  .cabinet-meta > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .cabinet-model-picker {
    width: 100%;
  }

  .skin-preview__figure-wrap--3d {
    width: min(220px, 100%);
    height: clamp(220px, 55vw, 300px);
  }
}

.site-footer {
  position: relative;
  z-index: 3;
  margin-top: 8px;
  padding: 0 24px 32px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.site-footer__wrap {
  width: 100%;
}

.site-footer-card {
  margin: 0;
}

.site-footer-head {
  margin-bottom: 14px;
}

.site-footer-brand {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}

.site-footer-tagline {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.site-footer-meta dd {
  font-weight: 500;
}

.site-footer-links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.site-footer-links-row a {
  font-size: 12px;
  font-weight: 600;
  color: rgba(167, 159, 207, 0.95);
  transition: color 0.15s ease;
}

.site-footer-links-row .account-link {
  font-size: 12px;
  font-weight: 600;
  color: rgba(167, 159, 207, 0.95);
  text-decoration: none;
}

.site-footer-links-row .account-link:hover {
  color: var(--text);
}

.docs-modal__panel {
  width: min(720px, 100%);
}

.docs-modal__content {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.docs-modal__content h3 {
  margin: 0 0 10px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.docs-modal__content p {
  margin: 0 0 10px;
}

.docs-modal__content ul {
  margin: 0 0 10px;
  padding-left: 18px;
}

.site-footer-links-row a:hover {
  color: var(--text);
}

.site-footer-cta {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-2);
}

.site-footer-cta:hover {
  color: #c4b5fd;
}

@media (max-width: 900px) {
  .site-header__inner {
    min-height: 62px;
    display: flex;
    flex-wrap: wrap;
    padding: 8px 16px;
    column-gap: 12px;
  }

  .site-header__inner > .brand {
    justify-self: unset;
  }

  .site-header nav {
    order: 3;
    width: 100%;
    justify-self: unset;
    max-width: none;
  }

  .site-header__actions {
    margin-left: auto;
    justify-self: unset;
  }

  .nav-links {
    justify-content: flex-start;
    gap: 10px;
  }

  .feature-grid,
  .steps,
  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-section--slider .content-section__slider-nav {
    display: none;
  }

  .site-footer {
    padding: 0 16px calc(20px + env(safe-area-inset-bottom, 0px));
  }

  .site-footer .server-meta {
    grid-template-columns: 1fr;
  }

  .site-footer .server-meta > div:not(:first-child) {
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 12px;
    margin-top: 4px;
  }
}

@media (max-width: 560px) {
  .site-header__inner {
    padding: 10px 12px;
    gap: 8px;
  }

  .site-header nav {
    order: 4;
  }

  .nav-links {
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
    gap: 14px;
    justify-content: center;
    width: max-content;
    margin-left: auto;
    margin-right: auto;
    padding-left: 12px;
    padding-right: 12px;
    padding-bottom: 2px;
  }

  .nav-links li {
    flex: 0 0 auto;
  }

  .site-header__actions {
    width: 100%;
    margin-left: 0;
    justify-content: stretch;
    gap: 8px;
  }

  .site-header__auth,
  .site-header__actions > a.btn {
    flex: 1 1 0;
  }

  .site-header__auth .btn,
  .site-header__actions > a.btn {
    width: 100%;
    min-height: 42px;
  }

  main {
    --main-hero-overlap: 48px;
    padding: 0 12px 20px;
  }

  .feature-grid,
  .steps,
  .gallery {
    grid-template-columns: 1fr;
  }

  .hero__tagline {
    font-size: 20px;
  }

  .hero__actions {
    width: 100%;
    flex-direction: column;
  }

  .hero__actions .btn {
    width: 100%;
    min-height: 42px;
  }

  .news-slider-viewport {
    height: clamp(460px, 65vh, 700px);
  }

  .site-news-title {
    font-size: 1.1rem;
  }

  .site-news-prose p,
  .site-news-prose .site-news-lead {
    font-size: 14px;
    line-height: 1.55;
  }

  .site-news__hero--tl,
  .site-news__hero--lc,
  .site-news__hero--br {
    float: none;
    width: 100%;
    max-width: none;
    max-height: 160px;
    margin: 0 0 12px;
  }

  .site-footer {
    padding-left: 12px;
    padding-right: 12px;
    /* Базовые 32px как у .site-footer + safe-area. */
    padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
  }

  .server-card-inner {
    padding: 18px 16px 16px;
  }

  .server-meta {
    grid-template-columns: 1fr;
  }

  .server-meta > div:not(:first-child) {
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 12px;
    margin-top: 4px;
  }

  .site-modal {
    padding: 0;
  }

  .site-modal__panel {
    width: 92%;
    max-height: 100vh;
    min-height: 100vh;
    border-radius: 0;
    padding: 14px 12px 16px;
    border-left: none;
    border-right: none;
  }

  .site-modal__panel--auth {
    min-height: auto;
    max-height: min(90dvh, 720px);
    border-radius: var(--radius);
    border-left: 1px solid rgba(137, 111, 255, 0.28);
    border-right: 1px solid rgba(137, 111, 255, 0.28);
  }

  .cabinet-layout {
    gap: 14px;
  }

  .cabinet-actions .btn,
  .cabinet-actions--aside .btn {
    min-height: 42px;
  }
}

@media (hover: none) and (pointer: coarse) {
  .nav-links a:hover:not(.is-active) {
    color: var(--text-muted);
  }

  .nav-links a.is-active,
  .nav-links a.is-active:hover {
    color: var(--text);
  }
}

/* --- Themed file & checkbox (site + admin) --- */
.mg-file {
  position: relative;
  display: block;
  width: 100%;
  cursor: pointer;
}

.mg-file__input {
  position: absolute;
  width: 0.01px;
  height: 0.01px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}

.mg-file__input:focus-visible + .mg-file__row .mg-file__btn {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.mg-file__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.mg-file__name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mg-check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  margin-bottom: 14px;
  font-size: 14px;
  color: var(--text);
}

.mg-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.admin-field--check {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.admin-field--check span {
  margin: 0;
}

.btn--sm {
  padding: 6px 12px;
  font-size: 13px;
}

html[data-theme="light"] .mg-file__name {
  color: rgba(60, 50, 90, 0.75);
}

/* --- Image lightbox (news + gallery) --- */
.site-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  visibility: hidden;
  pointer-events: none;
}

.site-lightbox[hidden] {
  display: none !important;
}

.site-lightbox.is-open {
  visibility: visible;
  pointer-events: auto;
}

.site-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 2, 12, 0.72);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.site-lightbox.is-open .site-lightbox__backdrop {
  opacity: 1;
}

.site-lightbox__dialog {
  position: relative;
  z-index: 1;
  max-width: min(96vw, 1100px);
  max-height: min(88vh, 900px);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transform: scale(0.96) translateY(8px);
  opacity: 0;
  transition:
    transform 0.24s ease,
    opacity 0.24s ease;
}

.site-lightbox.is-open .site-lightbox__dialog {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.site-lightbox__img {
  max-width: 100%;
  max-height: min(78vh, 820px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  background: rgba(0, 0, 0, 0.35);
}

.site-lightbox__caption {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  max-width: 42rem;
}

.site-lightbox__close {
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.site-lightbox__close:hover {
  background: rgba(124, 58, 237, 0.25);
}

.site-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.site-lightbox__nav:hover {
  background: rgba(124, 58, 237, 0.22);
}

.site-lightbox__nav--prev {
  left: 8px;
}

.site-lightbox__nav--next {
  right: 8px;
}

.site-lightbox__nav[hidden] {
  display: none !important;
}

@media (max-width: 640px) {
  .site-lightbox__nav {
    width: 40px;
    height: 40px;
  }

  .site-lightbox__nav--prev {
    left: 4px;
  }

  .site-lightbox__nav--next {
    right: 4px;
  }

  .site-lightbox__img {
    max-height: min(70vh, 640px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-lightbox__backdrop,
  .site-lightbox__dialog {
    transition: none;
  }

  .site-lightbox.is-open .site-lightbox__dialog {
    transform: none;
  }
}
