:root {
  --bg: #EEF5FF;
  --bg-2: #E3EFFF;
  --surface: #FFFFFF;
  --surface-2: #F5F9FF;
  --ink: #0E1B33;
  --ink-2: #26385A;
  --muted: #62728C;
  --line: #E2EBF7;
  --primary: #2F7BF5;
  --primary-600: #1F66DB;
  --primary-50: #EAF2FF;
  --sky: #7CC4FF;
  --accent: #FF6A4D;
  --accent-50: #FFF0EC;
  --live: #FF3B5C;
  --ok: #22A55B;
  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --shadow: 0 12px 34px rgba(31, 102, 219, .10), 0 2px 6px rgba(31, 102, 219, .06);
  --shadow-sm: 0 4px 14px rgba(31, 102, 219, .08);
  --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(900px 500px at 10% -10%, #DCEBFF 0%, rgba(220, 235, 255, 0) 60%),
    radial-gradient(800px 600px at 110% 10%, #E6F4FF 0%, rgba(230, 244, 255, 0) 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--primary-600); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 999px; padding: 12px 20px;
  font-weight: 700; font-size: 15px; line-height: 1.2; cursor: pointer; text-decoration: none;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .6; cursor: default; }
.btn-lg { padding: 16px 26px; font-size: 16px; width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #3B8BFF 0%, #2F7BF5 45%, #1F66DB 100%);
  box-shadow: 0 10px 24px rgba(47, 123, 245, .32);
}
.btn-primary:hover { box-shadow: 0 12px 28px rgba(47, 123, 245, .42); }
.btn-ghost { background: var(--primary-50); color: var(--primary-600); }
.btn-ghost:hover { background: #DDEAFF; }
.btn-glass {
  color: #fff; background: rgba(14, 27, 51, .55);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .22);
}
.btn-glass:hover { background: rgba(14, 27, 51, .68); }

input, textarea {
  width: 100%; border: 1.5px solid var(--line); background: var(--surface-2);
  border-radius: var(--r-md); padding: 14px 16px; font-size: 16px; outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
input:focus, textarea:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(47, 123, 245, .12); }
label { display: block; font-size: 14px; font-weight: 600; color: var(--ink-2); margin: 0 0 8px; }
.form-error { min-height: 20px; margin: 10px 0 0; color: #D33A3A; font-size: 14px; font-weight: 600; }
.legal-note { margin: 14px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); text-align: center; }
.legal-note a { color: var(--muted); }

/* Join */
.join, .return-page { min-height: 100%; display: grid; place-items: center; padding: 24px 16px calc(24px + var(--safe-b)); }
.join-card {
  width: 100%; max-width: 460px; background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, .9); border-radius: var(--r-xl); box-shadow: var(--shadow);
  padding: 30px 26px 24px;
}
.brand-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px;
  background: var(--primary-50); color: var(--primary-600); font-weight: 700; font-size: 13px;
}
.brand-dot { width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, var(--sky), var(--primary)); }
.join h1, .return-page h1 { font-size: 28px; line-height: 1.15; letter-spacing: -.02em; margin: 16px 0 10px; font-weight: 800; }
.j-sub { margin: 0 0 18px; color: var(--muted); font-size: 15.5px; line-height: 1.5; }
.j-when {
  display: flex; align-items: center; gap: 10px; margin: 0 0 20px; padding: 12px 14px;
  border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); font-weight: 600; font-size: 15px;
}
.j-when .live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 0 rgba(255, 59, 92, .5); animation: pulse 1.8s infinite; flex: none; }
.j-when .cal { width: 18px; height: 18px; flex: none; background: var(--primary); -webkit-mask: var(--i-cal) center/contain no-repeat; mask: var(--i-cal) center/contain no-repeat; }
#j-form .btn { margin-top: 14px; }
.return-page .btn { margin-top: 10px; }
.status-ico { width: 56px; height: 56px; border-radius: 50%; background: var(--primary-50); position: relative; }
.status-ico::after { content: ""; position: absolute; inset: 14px; background: var(--primary); -webkit-mask: var(--i-clock) center/contain no-repeat; mask: var(--i-clock) center/contain no-repeat; }
.status-ico.ok { background: #E6F7EE; }
.status-ico.ok::after { background: var(--ok); -webkit-mask-image: var(--i-check); mask-image: var(--i-check); }

@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 59, 92, .45); } 70% { box-shadow: 0 0 0 8px rgba(255, 59, 92, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 59, 92, 0); } }

/* Room */
.room { min-height: 100%; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 24px; max-width: 1360px; width: 100%; margin: 0 auto;
}
.tb-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tb-text { min-width: 0; }
.tb-title { font-weight: 800; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-sub { color: var(--muted); font-size: 13px; font-weight: 600; margin-top: 2px; }
.tb-right { display: flex; align-items: center; gap: 8px; flex: none; }
.live-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px;
  background: #fff; color: var(--live); font-weight: 800; font-size: 13px; box-shadow: var(--shadow-sm);
}
.live-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--live); animation: pulse 1.8s infinite; }
.online {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .8); color: var(--ink-2); font-weight: 700; font-size: 13px;
}
.online::before, .online-sm::before { content: ""; width: 15px; height: 15px; background: currentColor; -webkit-mask: var(--i-user) center/contain no-repeat; mask: var(--i-user) center/contain no-repeat; opacity: .7; }

.layout {
  flex: 1; width: 100%; max-width: 1360px; margin: 0 auto; padding: 0 24px 24px;
  display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start;
}
.stage { min-width: 0; display: flex; flex-direction: column; gap: 16px; }

.player {
  position: relative; aspect-ratio: 16 / 9; width: 100%; background: #0B1730;
  border-radius: var(--r-xl); overflow: hidden; box-shadow: 0 18px 48px rgba(16, 52, 120, .22);
  isolation: isolate;
}
.player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #0B1730; }
.player::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); pointer-events: none; }
.ov {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px; color: #fff; z-index: 2;
}
.ov-wait, .ov-end {
  background: radial-gradient(600px 300px at 50% 120%, rgba(124, 196, 255, .35), transparent 70%), linear-gradient(160deg, #10244A 0%, #183A73 55%, #2F7BF5 130%);
}
.ov-action { background: rgba(8, 18, 40, .25); }
/* Before the start: the «Скоро начнём» picture with the real countdown in its free bottom right corner,
   where the speaker's window stands during the broadcast. The frame keeps 16:9 in full screen too. */
.lobby { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; background: #FBF0E2; container-type: size; }
.lobby-frame { position: relative; width: 100%; width: min(100cqw, 100cqh * 16 / 9); aspect-ratio: 16 / 9; container-type: inline-size; }
.lobby-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; user-select: none; -webkit-user-drag: none; }
.lobby-count {
  position: absolute; left: 63%; right: 6.67%; top: 64.8%; bottom: 12.96%;
  display: flex; flex-direction: column; justify-content: center; gap: .5cqw;
  padding: 0 2.2cqw; border-radius: 1.5cqw; background: #1F2B4D; color: #FFFFFF; text-align: left;
}
.lobby-kicker { font-size: 12px; font-size: max(10px, 1.7cqw); font-weight: 700; line-height: 1.2; color: #F6DEC9; white-space: nowrap; }
.lobby-count b { font-size: 4.4vw; font-size: 6.6cqw; font-weight: 800; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
@container (max-width: 560px) { .lk-long { display: none; } }
.ov-soft { background: transparent; align-items: center; justify-content: center; }
.ov-kicker { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .75; }
.countdown { font-size: clamp(42px, 8vw, 84px); font-weight: 800; letter-spacing: -.03em; margin: 8px 0 6px; font-variant-numeric: tabular-nums; }
.ov-title { font-size: clamp(22px, 3.4vw, 32px); font-weight: 800; margin: 10px 0 8px; letter-spacing: -.02em; }
.ov-text { max-width: 520px; font-size: 15px; line-height: 1.5; opacity: .9; }
.play-ico, .snd-ico { width: 18px; height: 18px; background: #fff; -webkit-mask: var(--i-play) center/contain no-repeat; mask: var(--i-play) center/contain no-repeat; }
.snd-ico { -webkit-mask-image: var(--i-vol); mask-image: var(--i-vol); }
.buffering { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; pointer-events: none; }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .25); border-top-color: #fff; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.controls {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; align-items: center; gap: 8px;
  padding: 14px 16px; background: linear-gradient(to top, rgba(6, 14, 32, .55), rgba(6, 14, 32, 0));
  opacity: 0; transition: opacity .25s ease;
}
.player:hover .controls, .player.show-controls .controls { opacity: 1; }
.player.idle .controls { opacity: 0; }
.spacer { flex: 1; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: rgba(255, 255, 255, .16); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.icon-btn::before { content: ""; width: 20px; height: 20px; background: #fff; -webkit-mask: var(--ico) center/contain no-repeat; mask: var(--ico) center/contain no-repeat; }
#btn-mute { --ico: var(--i-vol); }
#btn-mute.muted { --ico: var(--i-mute); }
#btn-fs { --ico: var(--i-fs); }
.player.page-fs {
  position: fixed; inset: 0; z-index: 90; width: auto; height: auto; aspect-ratio: auto; border-radius: 0; box-shadow: none; background: #000;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
.player.page-fs video { background: #000; }
.player.page-fs .controls { padding-bottom: max(14px, env(safe-area-inset-bottom, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
html.page-fs-on, html.page-fs-on body { overflow: hidden; }

/* Slides: the picture fills the player, the speaker goes into a small window in a corner.
   A tap on the small window swaps them. */
.slide-layer { position: absolute; inset: 0; z-index: 0; background: #0B1730; overflow: hidden; }
.slide-layer img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .25s ease; user-select: none; -webkit-user-drag: none; }
.slide-layer img.on { opacity: 1; }
.player.page-fs .slide-layer { background: #000; }
.pip-hit { display: none; }
.player.has-slide { --pip-w: 26%; --pip-gap: 14px; --pip-t: auto; --pip-r: var(--pip-gap); --pip-b: var(--pip-gap); --pip-l: auto; }
.player.has-slide[data-size="s"] { --pip-w: 21%; }
.player.has-slide[data-size="l"] { --pip-w: 33%; }
.player.has-slide[data-pip="bl"] { --pip-r: auto; --pip-l: var(--pip-gap); }
.player.has-slide[data-pip="tr"] { --pip-b: auto; --pip-t: var(--pip-gap); }
.player.has-slide[data-pip="tl"] { --pip-r: auto; --pip-b: auto; --pip-t: var(--pip-gap); --pip-l: var(--pip-gap); }
.player.has-slide:not(.swapped) video,
.player.has-slide.swapped .slide-layer,
.player.has-slide .pip-hit,
.player.has-slide:not(.swapped) .buffering {
  top: var(--pip-t); right: var(--pip-r); bottom: var(--pip-b); left: var(--pip-l);
  width: var(--pip-w); height: auto; aspect-ratio: 16 / 9; border-radius: 14px;
}
.player.has-slide:not(.swapped) video { z-index: 1; object-fit: cover; box-shadow: 0 8px 24px rgba(4, 10, 24, .38), 0 0 0 1px rgba(255, 255, 255, .22); }
.player.has-slide.swapped .slide-layer { z-index: 1; box-shadow: 0 8px 24px rgba(4, 10, 24, .38), 0 0 0 1px rgba(255, 255, 255, .22); }
.player.has-slide .pip-hit { display: block; position: absolute; z-index: 2; padding: 0; border: 0; background: transparent; cursor: pointer; }
.player.has-slide .pip-hit:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.player.has-slide:not(.swapped) .buffering .spinner { width: 26px; height: 26px; }
/* With the window in a bottom corner, sound and full screen go to the top, off the slide's footer and the window. */
.player.has-slide:is([data-pip="br"], [data-pip="bl"]) .controls { top: 0; bottom: auto; background: linear-gradient(to bottom, rgba(6, 14, 32, .5), rgba(6, 14, 32, 0)); }
/* Full screen on a phone: the window and the buttons keep clear of the notch and the home bar. */
.player.page-fs.has-slide { --pip-gap: calc(10px + max(env(safe-area-inset-top, 0px), env(safe-area-inset-right, 0px), env(safe-area-inset-bottom, 0px), env(safe-area-inset-left, 0px))); }
.player.page-fs.has-slide:is([data-pip="br"], [data-pip="bl"]) .controls { padding-top: max(14px, env(safe-area-inset-top, 0px)); padding-bottom: 14px; }

.try-fab {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; border: 0; cursor: pointer;
  padding: 12px 18px; border-radius: 999px; background: #fff; color: var(--primary-600); font-weight: 800; font-size: 15px;
  box-shadow: var(--shadow-sm); transition: transform .15s;
}
.try-fab:active { transform: scale(.98); }

/* Try it yourself: a panel under the video, so the slides stay in view */
.try-panel {
  background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow); padding: 18px 22px 20px;
  border: 1px solid #fff; animation: rise .45s cubic-bezier(.2, .8, .2, 1);
}
.tp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--primary-600); }
.tp-close {
  display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer; padding: 7px 12px 7px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2); font-weight: 700; font-size: 13px;
}
.tp-close::before { content: ""; width: 14px; height: 14px; background: currentColor; -webkit-mask: var(--i-up) center/contain no-repeat; mask: var(--i-up) center/contain no-repeat; }
.tp-close:hover { background: var(--primary-50); }
.try-panel h2 { margin: 8px 0 6px; font-size: 22px; letter-spacing: -.02em; line-height: 1.2; }
.tp-sub { margin: 0 0 14px; color: var(--muted); line-height: 1.5; font-size: 15px; }
.spark { display: inline-block; width: 18px; height: 18px; background: linear-gradient(135deg, #7CC4FF, #2F7BF5); -webkit-mask: var(--i-spark) center/contain no-repeat; mask: var(--i-spark) center/contain no-repeat; }

/* Offer */
.offer {
  background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow); padding: 22px 22px 20px;
  border: 1px solid #fff; animation: rise .45s cubic-bezier(.2, .8, .2, 1);
}
.offer.no-anim { animation: none; }
/* A later cue lights the card up instead of scrolling the page */
.offer.pulse { animation: card-pulse 1.1s ease-out 2; }
@keyframes card-pulse {
  0% { box-shadow: var(--shadow), 0 0 0 0 rgba(47, 123, 245, .5); }
  70% { box-shadow: var(--shadow), 0 0 0 14px rgba(47, 123, 245, 0); }
  100% { box-shadow: var(--shadow), 0 0 0 0 rgba(47, 123, 245, 0); }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.offer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.offer-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--primary-600); }
.offer-kicker::before { content: ""; width: 16px; height: 16px; background: currentColor; -webkit-mask: var(--i-gift) center/contain no-repeat; mask: var(--i-gift) center/contain no-repeat; }
.offer-timer {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 999px;
  background: var(--accent-50); color: #C2412A; font-size: 13.5px; font-weight: 700;
}
.offer-timer b { font-variant-numeric: tabular-nums; font-size: 15px; color: #B13A24; }
.offer-timer.inline { margin: 2px 0 16px; }
.offer-title { font-size: 24px; line-height: 1.2; letter-spacing: -.02em; margin: 12px 0 6px; font-weight: 800; }
.offer-sub { margin: 0 0 14px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.offer-bonus {
  display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 12px 14px; border-radius: var(--r-md);
  background: linear-gradient(135deg, #F0F7FF, #EAF2FF); color: var(--ink-2); font-weight: 700; font-size: 14.5px;
}
.offer-bonus::before { content: ""; flex: none; width: 20px; height: 20px; background: var(--primary); -webkit-mask: var(--i-gift) center/contain no-repeat; mask: var(--i-gift) center/contain no-repeat; }
.tariffs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.tariff {
  display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: var(--r-lg);
  background: var(--surface-2); border: 1.5px solid var(--line);
}
.tariff.featured { background: linear-gradient(180deg, #F3F8FF, #FFFFFF); border-color: #CFE1FF; }
.tariff-name { font-weight: 800; font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tariff-badge { padding: 4px 10px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .01em; }
.tariff.featured { box-shadow: 0 8px 22px rgba(47, 123, 245, .12); }
.price-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.price { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.price-old { color: var(--muted); font-size: 16px; font-weight: 600; }
.price-badge { padding: 3px 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; }
.price-label { color: var(--muted); font-size: 12.5px; font-weight: 600; margin-top: -6px; }
.features { list-style: none; margin: 2px 0 4px; padding: 0; display: grid; gap: 7px; }
.features li { display: flex; gap: 9px; font-size: 14.5px; line-height: 1.4; color: var(--ink-2); }
.features li::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: 1px; background: var(--primary); -webkit-mask: var(--i-check) center/contain no-repeat; mask: var(--i-check) center/contain no-repeat; }
.tariff .btn { margin-top: auto; width: 100%; }
.inst { text-align: center; font-size: 13px; font-weight: 600; color: var(--muted); }
.inst button { border: 0; background: none; color: var(--primary-600); font-weight: 700; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.offer-toggle { display: none; }
.paid-note { padding: 14px 16px; border-radius: var(--r-md); background: #E9F8EF; color: #157341; font-weight: 700; }

/* Chat */
.chat {
  position: sticky; top: 16px; display: flex; flex-direction: column; height: calc(100vh - 110px); min-height: 460px; max-height: 860px;
  background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow); overflow: hidden; border: 1px solid #fff;
}
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); font-weight: 800; }
.online-sm { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
.chat-list { flex: 1; overflow-y: auto; padding: 14px 14px 6px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; scroll-behavior: smooth; }
.msg { display: flex; gap: 10px; align-items: flex-start; animation: fadein .25s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.avatar { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; }
.bubble { min-width: 0; }
.m-name { font-size: 13px; font-weight: 800; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.m-name .tag { padding: 2px 7px; border-radius: 999px; background: var(--primary-50); color: var(--primary-600); font-size: 11px; font-weight: 800; }
.m-quote { margin: 4px 0 2px; padding: 3px 0 3px 8px; border-left: 2px solid var(--sky); color: var(--muted); font-size: 12.5px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.m-text { font-size: 14.5px; line-height: 1.45; color: var(--ink); word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-wrap; margin-top: 2px; }
.msg.mine .m-name { color: var(--primary-600); }
.msg.moderator .bubble { background: var(--primary-50); border-radius: 14px 14px 14px 4px; padding: 9px 12px; }
.msg.moderator .avatar { background: linear-gradient(135deg, #7CC4FF, #2F7BF5); }
.msg.moderator .avatar::after { content: ""; width: 16px; height: 16px; background: #fff; -webkit-mask: var(--i-shield) center/contain no-repeat; mask: var(--i-shield) center/contain no-repeat; }
.msg.faq { display: block; padding: 10px 12px; border-radius: 14px; background: #FFF8E8; border: 1px solid #FBE7B8; }
.msg.faq .m-name { color: #946200; text-transform: uppercase; letter-spacing: .05em; font-size: 11.5px; }
.msg.gift { padding: 12px; border-radius: 16px; background: linear-gradient(135deg, #F0F7FF, #E6F0FF); border: 1px solid #CFE1FF; }
.g-ico { width: 34px; height: 34px; flex: none; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.g-ico::after { content: ""; width: 18px; height: 18px; background: var(--primary); -webkit-mask: var(--i-gift) center/contain no-repeat; mask: var(--i-gift) center/contain no-repeat; }
.g-body { min-width: 0; display: grid; gap: 3px; justify-items: start; }
.g-title { font-weight: 800; font-size: 14.5px; line-height: 1.35; }
.g-text { font-size: 13.5px; line-height: 1.4; color: var(--ink-2); }
.g-body .btn { margin-top: 6px; }
.msg.system { justify-content: center; }
.msg.system .m-text { font-size: 13px; color: var(--muted); text-align: center; }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: #fff; }
.chat-form input { padding: 12px 14px; border-radius: 999px; }
.send {
  width: 46px; height: 46px; flex: none; border: 0; border-radius: 50%; cursor: pointer;
  background: linear-gradient(135deg, #3B8BFF, #1F66DB); box-shadow: 0 6px 16px rgba(47, 123, 245, .3); display: grid; place-items: center;
}
.send::before { content: ""; width: 20px; height: 20px; background: #fff; -webkit-mask: var(--i-send) center/contain no-repeat; mask: var(--i-send) center/contain no-repeat; }
.chat-closed { padding: 14px; text-align: center; color: var(--muted); font-size: 13.5px; font-weight: 600; border-top: 1px solid var(--line); }

/* Sheets */
.backdrop { position: fixed; inset: 0; background: rgba(9, 22, 48, .38); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 40; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  position: fixed; z-index: 50; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow-y: auto;
  background: #fff; border-radius: var(--r-xl); box-shadow: 0 30px 80px rgba(9, 30, 70, .3); padding: 26px 24px 22px;
  animation: pop .28s cubic-bezier(.2, .8, .2, 1);
}
.sheet.small { width: min(420px, calc(100vw - 32px)); text-align: center; }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -46%) scale(.98); } to { opacity: 1; transform: translate(-50%, -50%); } }
.sheet h2 { margin: 8px 0 8px; font-size: 24px; letter-spacing: -.02em; line-height: 1.2; }
.sheet-sub { margin: 0 0 16px; color: var(--muted); line-height: 1.5; font-size: 15px; }
.sheet-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--primary-600); }
.sheet-close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--surface-2); cursor: pointer; display: grid; place-items: center; }
.sheet-close::before { content: ""; width: 16px; height: 16px; background: var(--ink-2); -webkit-mask: var(--i-x) center/contain no-repeat; mask: var(--i-x) center/contain no-repeat; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.chip {
  border: 1.5px solid #CFE1FF; background: var(--primary-50); color: var(--primary-600); font-weight: 700; font-size: 14px;
  padding: 9px 14px; border-radius: 999px; cursor: pointer; transition: background .15s;
}
.chip:hover { background: #DDEAFF; }
.chip[disabled] { opacity: .5; cursor: default; }
.chip-sm { font-size: 13.5px; padding: 7px 13px; }
.ta-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ta-actions .btn { margin-left: auto; }
.try-form { display: flex; gap: 10px; align-items: flex-end; }
.try-form textarea { resize: none; min-height: 52px; }
.try-form .btn { flex: none; height: 52px; }
.try-answer { margin-top: 16px; display: grid; gap: 10px; }
.ta-q { justify-self: end; max-width: 88%; padding: 10px 14px; border-radius: 16px 16px 4px 16px; background: var(--primary); color: #fff; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; }
.ta-a { max-width: 100%; padding: 12px 14px; border-radius: 16px 16px 16px 4px; background: var(--surface-2); border: 1px solid var(--line); font-size: 15px; line-height: 1.55; white-space: pre-wrap; min-height: 46px; }
.ta-a.typing::after { content: "▍"; color: var(--primary); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
#try-copy { justify-self: start; }
.try-left { margin-top: 12px; font-size: 13px; color: var(--muted); font-weight: 600; }
.pay-hint { margin: -4px 0 14px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--primary-50); color: var(--ink-2); font-size: 14px; font-weight: 600; line-height: 1.45; }
.pay-sum { display: flex; align-items: baseline; gap: 10px; margin: 2px 0 12px; }
.pay-sum span { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.pay-sum s { color: var(--muted); font-weight: 600; }
#pay-form .btn { margin-top: 12px; width: 100%; }
#yk-widget { margin-top: 10px; min-height: 120px; }
.demo-pay { margin-top: 10px; padding: 16px; border-radius: var(--r-md); background: var(--surface-2); border: 1px dashed #BFD6FF; }
.demo-pay p { margin: 0 0 12px; color: var(--muted); font-size: 14px; line-height: 1.5; }
#pay-step-done { text-align: center; display: grid; justify-items: center; }

/* Pay bar on phones: shown by the script when the card is out of view */
.cta-bar {
  position: fixed; left: 10px; right: 10px; bottom: calc(10px + var(--safe-b)); z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 16px;
  border-radius: 20px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid #fff; box-shadow: 0 14px 38px rgba(16, 52, 120, .22); animation: slideup .3s cubic-bezier(.2, .8, .2, 1);
}
.cta-text { min-width: 0; display: grid; gap: 1px; }
.cta-label { font-size: 12.5px; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cta-time { font-size: 18px; font-weight: 800; color: #B13A24; font-variant-numeric: tabular-nums; }
.cta-bar .btn { flex: none; padding: 12px 18px; }
.cta-bar.pulse::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; animation: ring 1.1s ease-out 2; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(47, 123, 245, .5); } 70% { box-shadow: 0 0 0 12px rgba(47, 123, 245, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 123, 245, 0); } }
@keyframes slideup { from { transform: translateY(100%); } to { transform: none; } }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); z-index: 60;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 700; font-size: 14px;
  box-shadow: var(--shadow); animation: fade .2s; max-width: calc(100vw - 32px); text-align: center;
}

/* Phones */
@media (max-width: 960px) {
  .topbar { padding: 10px 14px; }
  .tb-title { font-size: 15px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; }
  .layout { display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 0 12px calc(12px + var(--safe-b)); }
  .player { border-radius: var(--r-lg); }
  .player .controls { opacity: 1; padding: 10px 12px; }
  .player.has-slide { --pip-w: 34%; --pip-gap: 8px; }
  .player.has-slide[data-size="s"] { --pip-w: 28%; }
  .player.has-slide[data-size="l"] { --pip-w: 42%; }
  .player.has-slide:not(.swapped) video, .player.has-slide.swapped .slide-layer, .player.has-slide .pip-hit { border-radius: 10px; }
  .player.idle .controls { opacity: 0; }
  .stage { gap: 12px; }
  .try-fab { align-self: stretch; justify-content: center; }
  .offer { padding: 16px 16px 14px; border-radius: var(--r-lg); }
  .offer-title { font-size: 19px; margin-top: 10px; }
  .offer-sub { font-size: 14px; margin-bottom: 10px; }
  .offer:not(.expanded) .offer-sub, .offer:not(.expanded) .offer-bonus, .offer:not(.expanded) .features, .offer:not(.expanded) .price-label { display: none; }
  .offer:not(.expanded) .tariff { padding: 12px 14px; gap: 8px; }
  .offer:not(.expanded) .tariffs { grid-template-columns: 1fr; gap: 8px; }
  .offer:not(.expanded) .tariff { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .offer:not(.expanded) .tariff-name { flex: 1 1 100%; font-size: 14.5px; }
  .offer:not(.expanded) .price-row { flex: 1; }
  .offer:not(.expanded) .price { font-size: 22px; }
  .offer:not(.expanded) .price-badge { display: none; }
  .offer:not(.expanded) .tariff .btn { width: auto; margin: 0; padding: 11px 18px; }
  .offer:not(.expanded) .inst { flex: 1 1 100%; text-align: left; font-size: 12.5px; }
  body.has-cta .layout { padding-bottom: calc(92px + var(--safe-b)); }
  .try-panel { padding: 16px 16px 16px; border-radius: var(--r-lg); }
  .try-panel h2 { font-size: 20px; }
  .offer-toggle { display: block; width: 100%; margin-top: 10px; border: 0; background: none; color: var(--primary-600); font-weight: 700; font-size: 14px; cursor: pointer; padding: 6px; }
  .chat { position: static; height: auto; min-height: 380px; max-height: none; flex: 1; border-radius: var(--r-lg); }
  .chat-list { max-height: 52vh; min-height: 260px; }
  .sheet {
    left: 0; right: 0; top: auto; bottom: 0; transform: none; width: 100%; max-height: 92vh;
    border-radius: 26px 26px 0 0; padding: 22px 18px calc(18px + var(--safe-b));
    animation: slideup .3s cubic-bezier(.2, .8, .2, 1);
  }
  .sheet.small { width: 100%; }
  .try-form { flex-direction: column; align-items: stretch; }
  .try-form .btn { height: auto; }
  .join h1, .return-page h1 { font-size: 25px; }
}

@media (min-width: 961px) { .cta-bar { display: none !important; } }

/* Icons */
:root {
  --i-up: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 15l6-6 6 6'/%3E%3C/svg%3E");
  --i-spark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l2.3 6.2L20.5 10.5l-6.2 2.3L12 19l-2.3-6.2L3.5 10.5l6.2-2.3z'/%3E%3Cpath d='M19 15l.9 2.1L22 18l-2.1.9L19 21l-.9-2.1L16 18l2.1-.9z'/%3E%3C/svg%3E");
  --i-vol: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9h4l5-4v14l-5-4H4z'/%3E%3Cpath d='M16 8.5a5 5 0 010 7' stroke='%23000' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3Cpath d='M18.5 6a8.5 8.5 0 010 12' stroke='%23000' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  --i-mute: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9h4l5-4v14l-5-4H4z'/%3E%3Cpath d='M16 9l5 6M21 9l-5 6' stroke='%23000' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  --i-fs: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5'/%3E%3C/svg%3E");
  --i-play: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 4.5v15a1 1 0 001.5.86l12-7.5a1 1 0 000-1.72l-12-7.5A1 1 0 007 4.5z'/%3E%3C/svg%3E");
  --i-send: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3.4 20.4l17.5-7.5a1 1 0 000-1.8L3.4 3.6a1 1 0 00-1.4 1.1L4 11l9 1-9 1-2 6.3a1 1 0 001.4 1.1z'/%3E%3C/svg%3E");
  --i-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  --i-gift: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9h18v4H3zM5 13h6v8H5zM13 13h6v8h-6zM11 9h2v12h-2z'/%3E%3Cpath d='M12 9C10 5 6.5 4.5 6.5 7S10 9 12 9zm0 0c2-4 5.5-4.5 5.5-2S14 9 12 9z' stroke='%23000' stroke-width='1.8' fill='none'/%3E%3C/svg%3E");
  --i-user: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 20c0-4 3.6-6 8-6s8 2 8 6z'/%3E%3C/svg%3E");
  --i-cal: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3.5' y='5' width='17' height='15' rx='3'/%3E%3Cpath d='M8 3v4M16 3v4M3.5 10h17'/%3E%3C/svg%3E");
  --i-clock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 7.5V12l3 2'/%3E%3C/svg%3E");
  --i-x: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E");
  --i-shield: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l8 3v6c0 5-3.4 9.4-8 11-4.6-1.6-8-6-8-11V5z'/%3E%3C/svg%3E");
}
