:root {
  --bg: #0f0f14;
  --surface: #181822;
  --surface-2: #20202d;
  --border: #2a2a38;
  --text: #ececf1;
  --muted: #a3a3b5;
  --accent: #ff3d6e;
  --header-h: 56px;
  --titlebar-h: 44px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; overflow-wrap: anywhere; }
a { color: var(--accent); }
img { max-width: 100%; height: auto; }

/* Шапка */
.site-header { min-height: var(--header-h); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 6px 16px; border-bottom: 1px solid var(--border); direction: ltr; }
.site-header--actions { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.header-extra { display: flex; align-items: center; min-width: 0; }
.site-header .header-extra .badge-18, .site-header .header-extra .btn--small { margin: 0; }
.header-extra--cta { max-width: 16rem; }
.logo { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.125rem; flex-shrink: 0; }
.logo svg { width: 28px; height: 28px; }
.site-nav { display: flex; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: 0.9375rem; white-space: nowrap; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); background: var(--surface); }
.badge-18 { margin-inline-start: auto; flex-shrink: 0; border: 1px solid var(--accent); color: var(--accent); border-radius: 6px; padding: 1px 6px; font-size: 0.8125rem; font-weight: 700; }
.site-header .btn--small { margin-inline-start: auto; flex-shrink: 0; }

/* Трансляции */
.titlebar { min-height: var(--titlebar-h); display: flex; align-items: center; padding: 8px 16px; border-bottom: 1px solid var(--border); }
.titlebar h1 { margin: 0; font-size: 1rem; font-weight: 600; min-width: 0; }
.stream { height: calc(100vh - var(--header-h) - var(--titlebar-h)); min-height: 480px; background: #000; }
@supports (height: 100dvh) { .stream { height: calc(100dvh - var(--header-h) - var(--titlebar-h)); } }
.stream iframe { display: block; width: 100%; height: 100%; border: 0; }
.stream--inline { height: auto; min-height: 0; background: none; margin-top: 48px; }
.stream--inline iframe { height: 80vh; min-height: 480px; border-radius: 12px; background: #000; }

/* Контент */
main { max-width: 860px; margin: 0 auto; padding: 24px 16px; }
main > section, main > .cta-row { margin-top: 48px; }
.crumbs { font-size: 0.875rem; color: var(--muted); margin-bottom: 24px; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--muted); }
.crumbs .sep { opacity: .6; }
.page-title { font-size: 2.125rem; line-height: 1.2; margin: 0 0 20px; }
h2 { font-size: 1.625rem; line-height: 1.25; margin: 0 0 16px; }
h3 { font-size: 1.1875rem; line-height: 1.3; margin: 24px 0 8px; }
p { margin: 0 0 16px; }
ul, ol { padding-inline-start: 22px; margin: 0 0 16px; }
li { margin-bottom: 6px; }
.lead { font-size: 1.125rem; }
.muted { color: var(--muted); }
.note { background: var(--surface); border-inline-start: 3px solid var(--accent); border-radius: 8px; padding: 14px 16px; margin: 0 0 16px; }
.note p:last-child { margin-bottom: 0; }

table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: 0.9375rem; display: block; overflow-x: auto; }
th, td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; padding: 0; list-style: none; }
.features li { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin: 0; }
.features h3 { margin: 0 0 6px; font-size: 1.0625rem; }
.features p { margin: 0; color: var(--muted); font-size: 0.9375rem; }

.steps li::marker { color: var(--accent); font-weight: 700; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px; padding: 0; list-style: none; }
.cards li { margin: 0; }
.cards a { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text); text-decoration: none; }
.cards a:hover { border-color: var(--accent); }
.cards span { color: var(--muted); font-size: 0.875rem; line-height: 1.5; }

.btn { display: inline-block; max-width: 100%; text-align: center; padding: 12px 20px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 700; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn--small { padding: 7px 14px; font-size: 0.875rem; }
.cta-row { margin: 8px 0 16px; }

.promo { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.promo-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 12px; background: linear-gradient(135deg, #2a1420, var(--surface)); border: 1px solid #4a2234; color: var(--text); text-decoration: none; }
.promo-card strong { font-size: 1.125rem; }
.promo-card span { color: var(--muted); font-size: 0.9375rem; }
.promo-card:hover { border-color: var(--accent); }

.cta-final { background: linear-gradient(135deg, #2a1420, var(--surface)); border: 1px solid #4a2234; border-radius: 16px; padding: 24px; }
.cta-final h2 { margin-bottom: 8px; }
.cta-final p { color: var(--muted); }

.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; }
.faq summary { cursor: pointer; padding: 14px 16px; font-weight: 600; }
.faq details p { padding: 0 16px 14px; margin: 0; color: var(--muted); }

.site-footer { border-top: 1px solid var(--border); margin-top: 48px; padding: 24px 16px 32px; text-align: center; font-size: 0.875rem; color: var(--muted); }
.site-footer p { max-width: 760px; margin: 0 auto 8px; }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; margin-bottom: 16px; }
.footer-nav a { color: var(--text); text-decoration: none; }

@media (max-width: 700px) {
  :root { --header-h: 96px; }
  .site-header { grid-template-columns: minmax(0, 1fr) auto; height: auto; min-height: var(--header-h); padding: 8px 12px; gap: 6px 8px; align-content: center; }
  .site-header--actions { grid-template-columns: minmax(0, 1fr) auto auto; }
  .site-header > .logo { grid-column: 1; grid-row: 1; }
  .site-header > .language-switcher { grid-column: -2; grid-row: 1; }
  .site-header > .header-extra { grid-column: 2; grid-row: 1; }
  .site-header > .header-extra--cta { grid-column: 1 / -1; grid-row: 3; max-width: none; }
  .header-extra--cta .btn { width: 100%; }
  .site-header > .site-nav { grid-column: 1 / -1; grid-row: 2; width: 100%; margin: 0; }
  .page-title { font-size: 1.75rem; }
  h2 { font-size: 1.375rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.hero-img { margin: 0 0 24px; }
.hero-img img { display: block; width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); }
.footer-nav--info { margin: 16px 0 8px; font-size: 0.8125rem; }
.footer-nav--info a { color: var(--muted); }

/* A physical top-right language button, including on RTL pages. */
.language-switcher { position: relative; justify-self: end; min-width: 0; z-index: 30; }
.language-toggle { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); font-size: .875rem; line-height: 1.3; cursor: pointer; list-style: none; white-space: nowrap; user-select: none; }
.language-toggle::-webkit-details-marker { display: none; }
.language-toggle:hover, .language-switcher[open] .language-toggle { border-color: var(--accent); background: var(--surface-2); }
.language-toggle svg { flex-shrink: 0; }
.language-code { display: none; }
.language-switcher[open] .language-chevron { transform: rotate(180deg); }
.language-switcher > .language-nav { position: absolute; top: calc(100% + 8px); right: 0; width: 270px; max-width: calc(100vw - 24px); max-height: min(70vh, 25rem); overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: 8px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 12px 36px #0009; }
.language-switcher:not([open]) > .language-nav { display: none; }
.language-nav a { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-height: 44px; min-width: 0; border: 1px solid transparent; border-radius: 7px; padding: 8px; color: var(--muted); font-size: .875rem; line-height: 1.4; text-decoration: none; }
.language-nav a:hover { color: var(--text); background: var(--surface-2); }
.language-nav a[aria-current] { color: var(--text); border-color: var(--accent); background: var(--surface-2); }
.language-check { color: var(--accent); }
:is(a, button, input, summary):focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (max-width: 450px) {
  .language-current { display: none; }
  .language-code { display: inline; }
  .language-toggle { gap: 5px; padding-inline: 8px; }
}
[dir=rtl] .sep { transform: scaleX(-1); }
[dir=rtl] main { line-height: 1.8; }

html[dir=rtl] .badge-18 { margin-left: 0; margin-right: auto; }
