/* Fonts loaded via index.html for performance (no bundler) */

:root {
  color-scheme: light;
  font-family: "Onest", "Manrope", "Segoe UI", system-ui, sans-serif;
  --font-display: "Unbounded", "Onest", "Manrope", sans-serif;
  /* Paratype Golos Text — first-class Cyrillic, readable display headlines */
  --font-headline: "Golos Text", "Onest", "Manrope", sans-serif;
  color: #2b2735;
  background: #f6f3fa;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;

  /* Wellness palette: фон / лиловый / зелёный / текст */
  --bg: #f6f3fa;
  --bg-deep: #ebe6f2;
  --ink: #2b2735;
  --muted: #6b6578;

  /* Dusty lilac #A78BC7 — borders, soft fills, brand tint */
  --plum-rgb: 167, 139, 199;
  /* Lavender #B39DDB — soft washes */
  --plum-soft-rgb: 179, 157, 219;

  --line: rgba(var(--plum-rgb), 0.14);
  --glass: rgba(255, 255, 255, 0.74);
  --glass-strong: rgba(255, 255, 255, 0.92);

  /* Brand lilac (legacy --olive* names kept for existing selectors) */
  --olive: #a78bc7;
  --olive-dark: #8f7aae;
  --brand-deep: #2b2735;
  --brand-hover: #9c7ac7;

  --action: #2b2735;
  --action-hover: #3f3a4a;
  --btn-surface: rgba(255, 255, 255, 0.96);
  --btn-surface-hover: #ffffff;

  /* Vine green — secondary / nature accent */
  --sage: #7b9270;
  --green: #7b9270;
  --green-soft: #a1b18a;
  --eucalyptus: #6f8f72;
  --moss: #879b78;

  --sand: #e4e0d8;
  --rose: #d9cbe4;
  --shadow: 0 24px 70px rgba(var(--plum-rgb), 0.12);
  --btn-primary-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 12px 28px rgba(var(--plum-rgb), 0.12),
    0 4px 10px rgba(var(--plum-rgb), 0.06);
  --radius-xl: 34px;
  --radius-lg: 26px;
  --radius-md: 18px;
  --topbar-height: 58px;
  --bottom-nav-height: 64px;
  --topbar-offset: calc(var(--topbar-height) + env(safe-area-inset-top, 0px));
}

* {
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

html {
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  background: #f6f3fa;
  height: 100%;
  overscroll-behavior: none;
}

body {
  margin: 0;
  min-width: 320px;
  height: 100%;
  overflow: hidden;
  touch-action: manipulation;
  background: #f6f3fa;
  overscroll-behavior: none;
}

#root,
#app {
  height: 100%;
  overflow: hidden;
}

img,
video,
iframe {
  max-width: 100%;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  overscroll-behavior: none;
  touch-action: pan-x pan-y;
}

.app::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(145deg, #f6f3fa 0%, var(--bg) 48%, var(--bg-deep) 100%);
}

.ambient { display: none; }

.ambient-one {
  right: -12rem;
  top: -14rem;
  background: rgba(115, 80, 200, 0.38);
}

.ambient-two {
  left: -14rem;
  bottom: -18rem;
  background: rgba(231, 191, 211, 0.32);
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 10px 8px;
  background: color-mix(in srgb, var(--bg) 88%, #fff);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  border-bottom: 1px solid rgba(var(--plum-rgb), 0.08);
}

.topbar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: env(safe-area-inset-top, 0px);
  background: var(--bg);
  pointer-events: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-right: auto;
  color: var(--ink);
  background: transparent;
  font-size: 20px;
  font-weight: 850;
  letter-spacing: -0.04em;
}

.brand img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: 0 14px 38px rgba(var(--plum-rgb), 0.08);
  backdrop-filter: blur(22px);
}

.desktop-nav button {
  position: relative;
  padding: 10px 14px;
  border-radius: 999px;
  color: #6b6578;
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  transition: 0.2s ease;
}

.nav-unread-badge {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  margin-left: 6px;
  padding: 0 5px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  color: #fff;
  background: #dc3f55;
  box-shadow: 0 3px 10px rgba(173, 36, 62, 0.28);
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
  vertical-align: middle;
}

.desktop-nav button.active,
.desktop-nav button:hover {
  color: var(--ink);
  background: var(--glass-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.icon-button,
.profile-pill {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.54);
  box-shadow: 0 14px 30px rgba(var(--plum-rgb), 0.09);
  backdrop-filter: blur(18px);
}

.profile-pill {
  color: var(--ink);
  background: rgba(255, 252, 250, 0.88);
  font-weight: 800;
}

.profile-pill.ios-profile {
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: linear-gradient(145deg, #3f3a4a, #2b2735);
  box-shadow:
    0 4px 14px rgba(43, 39, 53, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.profile-pill-inner {
  color: #f6f3fa;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.profile-pill-inner.has-avatar {
  overflow: hidden;
}

.profile-pill-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: var(--topbar-offset) 12px 0;
}

.page-shell {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 0 calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px) + 8px);
  -webkit-overflow-scrolling: touch;
}

.page-shell-media {
  overflow: hidden;
  padding: 8px 0 0;
}

.page-shell-feed {
  padding-inline: 0;
  padding-top: 8px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.page-shell-movies {
  padding-top: 8px;
}

.page-shell-chat {
  overflow: hidden;
  padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
}

.page-shell-chat .telegram-chat-layout {
  height: 100%;
  min-height: 0;
}

.page-shell-ai,
.app.immersive-ai .page-shell {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  padding: 0 0 calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
}

.app.immersive-ai .pwa-install-banner {
  display: none;
}

.app.immersive-ai .topbar {
  display: none;
}

.app.immersive-ai .shell {
  max-width: none;
  flex: 1;
  min-height: 0;
  padding: 0;
}

@media (min-width: 981px) {
  html:not(.is-compact) .app.immersive-ai .topbar {
    display: flex;
  }

  html:not(.is-compact) .app.immersive-ai .shell {
    max-width: 1180px;
    padding: var(--topbar-offset) 12px 0;
  }

  html:not(.is-compact) .app.immersive-ai .page-shell {
    padding-bottom: 8px;
  }

  html:not(.is-compact) .app.immersive-ai .ai-inner-header {
    display: none;
  }
}

.stack {
  display: grid;
  gap: 24px;
  max-width: 100%;
}

.narrow {
  max-width: 760px;
  margin: 0 auto;
}

.glass-panel,
.glass-card,
.library-card,
.feed-card,
.practice-card,
.movie-detail {
  border: 1px solid rgba(255, 255, 255, 0.82);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.34)),
    var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(26px);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: clamp(20px, 3vw, 36px);
  align-items: center;
  min-height: 520px;
  padding: clamp(28px, 5vw, 58px);
  border-radius: 44px;
  overflow: hidden;
}

.hero.glass-panel {
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.hero::after { content: none; }

.hero-copy {
  position: relative;
  z-index: 2;
  align-self: center;
  min-width: 0;
  max-width: 100%;
}

.eyebrow,
.section-header span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--olive-dark);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-hero h1,
.material-page-immersive h1,
.movie-detail-body h1 {
  font-family: var(--font-display);
}

.hero h1,
.profile-hero h1 {
  margin: 14px 0;
  color: var(--ink);
  font-size: clamp(32px, 3.6vw, 50px);
  line-height: 1.06;
  letter-spacing: -0.04em;
  font-weight: 800;
}

.section-header h2 {
  margin: 10px 0 0;
  color: var(--ink);
  font-size: clamp(22px, 4.2vw, 32px);
  line-height: 1.22;
  letter-spacing: -0.02em;
  font-weight: 700;
  font-family: var(--font-headline);
}

/* Home hero + materials: Golos Text — top Cyrillic, easier to read than Unbounded */
.hero h1 {
  font-family: var(--font-headline);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.12;
  max-width: 16ch;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
}

#app-toast-host {
  position: fixed;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px) + var(--bottom-nav-height));
  z-index: 240;
  width: min(420px, calc(100vw - 24px));
  transform: translateX(-50%);
  pointer-events: none;
}

.app-toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 16px 14px;
  border-radius: 18px;
  background: rgba(255, 252, 250, 0.96);
  border: 1px solid rgba(var(--plum-rgb), 0.12);
  box-shadow: 0 18px 40px rgba(43, 39, 53, 0.16);
  pointer-events: auto;
}

.app-toast-copy {
  flex: 1;
  min-width: 0;
}

.app-toast-copy strong {
  display: block;
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 800;
}

.app-toast-copy p {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.4;
}

.app-toast-close {
  flex-shrink: 0;
  margin-top: 2px;
  padding: 6px 10px;
  border: 0;
  border-radius: 999px;
  color: var(--olive-dark);
  background: rgba(var(--plum-rgb), 0.08);
  font-size: 13px;
  font-weight: 700;
}

/* Chat banner variant: the whole copy opens the room. */
.app-toast.is-clickable .app-toast-copy {
  cursor: pointer;
}

.app-toast.is-clickable .app-toast-copy strong {
  color: var(--olive-dark);
}

.app-toast.is-clickable .app-toast-copy p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.app-toast.is-clickable .app-toast-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
}

.hero p,
.section-header p,
.glass-card p,
.library-card p,
.feed-card p,
.practice-card p,
.movie-detail p,
.profile-hero p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.hero-copy > p {
  max-width: 610px;
  font-size: 20px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 850;
  text-decoration: none;
}

.primary-button {
  color: var(--ink);
  background: var(--btn-surface);
  border: 1px solid rgba(var(--plum-rgb), 0.14);
  box-shadow: var(--btn-primary-shadow);
}

.primary-button:hover {
  background: var(--btn-surface-hover);
  border-color: rgba(var(--plum-rgb), 0.22);
}

.secondary-button {
  color: var(--muted);
  background: transparent;
  border: 1px solid rgba(var(--plum-rgb), 0.18);
  box-shadow: none;
}

.secondary-button:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.45);
  border-color: rgba(var(--plum-rgb), 0.24);
}

.yandex-button {
  margin-top: 18px;
}

.yandex-button-wrap {
  display: grid;
  gap: 8px;
}

.yandex-button-error {
  margin: 0;
  color: #b42318;
  font-size: 13px;
  line-height: 1.4;
}

.hero-art {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 320px;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
}

.hero-art img {
  display: block;
  width: min(100%, 360px);
  max-width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 30px 50px rgba(var(--plum-rgb), 0.16));
}

.hero-note {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 999px;
  color: var(--olive-dark);
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 800;
}

.grid-three,
.content-grid,
.practice-track,
.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

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

.editorial-rail-featured {
  margin-top: 4px;
}

.editorial-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-content: stretch;
  height: 100%;
  min-height: 0;
  overflow: visible;
  border-radius: 24px;
  background: #f3edf8;
  border: 1px solid rgba(var(--plum-rgb), 0.08);
  box-shadow: 0 18px 42px rgba(var(--plum-rgb), 0.08);
}

.editorial-card-art {
  height: 188px;
  overflow: hidden;
  border-radius: 24px 24px 0 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.editorial-card-body {
  display: grid;
  align-content: start;
  gap: 0;
  padding: 18px 18px 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), #ebe2f4 100%);
}

.editorial-kicker {
  color: rgba(var(--plum-rgb), 0.55);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.editorial-card-body h3 {
  margin: 10px 0 8px;
  color: var(--ink);
  font-size: clamp(21px, 3.6vw, 28px);
  line-height: 1.08;
  letter-spacing: -0.04em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.editorial-card-body p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.editorial-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 12px 12px 14px;
  border-top: 1px solid rgba(var(--plum-rgb), 0.08);
  border-radius: 0 0 24px 24px;
  background: rgba(237, 229, 248, 0.92);
}

.editorial-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  padding: 4px;
  border-radius: 11px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.88);
}

.editorial-meta {
  min-width: 0;
  flex: 1;
}

.editorial-meta strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editorial-meta span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editorial-cta {
  flex-shrink: 0;
  min-width: 64px;
  padding: 8px 12px;
  border: 1px solid rgba(var(--plum-rgb), 0.1);
  border-radius: 999px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 4px 14px rgba(var(--plum-rgb), 0.08);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.glass-card,
.library-card,
.practice-card,
.stat-card {
  border-radius: var(--radius-lg);
  padding: 22px;
}

.glass-card h3,
.library-card h3,
.feed-card h3,
.practice-card h3 {
  margin: 12px 0 8px;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.soft-dot { display: none; }

.section {
  display: grid;
  gap: 18px;
  /* Match hero inner padding so left edges align on desktop */
  padding-inline: clamp(28px, 5vw, 58px);
}

.section-header {
  max-width: 760px;
}

.section-header h2 {
  font-size: clamp(22px, 4.2vw, 32px);
}

.library-card {
  display: grid;
  min-height: 250px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.42)),
    linear-gradient(145deg, rgba(var(--plum-soft-rgb), 0.26), rgba(217, 206, 190, 0.14));
}

.card-topline,
.library-card footer,
.feed-head,
.feed-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-topline span,
.card-topline small,
.movie-info span,
.movie-detail > span {
  color: var(--olive-dark);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.library-card footer {
  align-self: end;
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
}

.library-card footer button,
.library-card footer a {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: white;
  background: var(--action);
  text-decoration: none;
}

.library-card footer button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.library-card-button {
  width: 100%;
  padding: 26px;
  border-radius: 32px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.library-card-button:hover {
  transform: translateY(-1px);
}

.library-card-button:focus-visible {
  outline: 2px solid rgba(167, 139, 199, 0.45);
  outline-offset: 2px;
}

.library-card h3,
.library-card p {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.access-badge {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.access-badge.free {
  color: #4f6548;
  background: rgba(123, 146, 112, 0.22);
}

.access-badge.locked {
  color: #8f7aae;
  background: rgba(167, 139, 199, 0.22);
}

.library-card footer .footer-meta {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-card footer .footer-kind {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.library-card footer .footer-play {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: white;
  background: var(--action);
}

.player-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(43, 32, 55, 0.38);
  backdrop-filter: blur(18px);
}

.player-modal {
  display: grid;
  gap: 18px;
  width: min(1040px, 100%);
  max-height: min(88vh, 920px);
  padding: clamp(18px, 3vw, 28px);
  border-radius: 34px;
  overflow: auto;
}

.player-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.player-head span {
  color: var(--olive-dark);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.player-head h2 {
  max-width: 780px;
  margin: 8px 0 0;
  color: var(--ink);
  font-size: clamp(24px, 4vw, 42px);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.player-close {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 850;
}

.video-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 18px;
  background: #19111f;
  box-shadow: 0 22px 70px rgba(25, 17, 31, 0.24);
}

.video-frame::before {
  display: block;
  padding-top: 56.25%;
  content: "";
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #19111f;
}

.audio-frame,
.media-placeholder,
.player-transcript {
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.48);
}

.audio-frame {
  padding: 18px;
}

.audio-frame audio {
  width: 100%;
}

/* ── Compact music card ────────────────────────────────── */

.music-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(var(--plum-rgb), 0.12);
  border-radius: 20px;
  cursor: pointer;
  color: inherit;
  background: linear-gradient(135deg, #2a1638 0%, #160d20 100%);
  text-align: left;
  transition: opacity 0.15s;
}

.music-card:active {
  opacity: 0.82;
}

.music-card-art {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.12);
}

.music-card-info {
  display: grid;
  flex: 1;
  gap: 3px;
  min-width: 0;
}

.music-card-info strong {
  overflow: hidden;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-card-info span {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  white-space: nowrap;
}

.music-card-play-btn {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #2b2735;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

.music-card-play-btn.playing {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* ── Full-screen audio modal ───────────────────────────── */

@keyframes audio-modal-in {
  from {
    transform: translateY(100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.audio-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

.audio-modal {
  position: absolute;
  inset: 0;
  overflow: hidden;
  animation: audio-modal-in 0.38s cubic-bezier(0.32, 0.72, 0, 1) both;
}

.audio-modal-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.06);
}

.audio-modal-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(20, 10, 32, 0.62) 0%,
    rgba(20, 10, 32, 0.85) 50%,
    rgba(20, 10, 32, 0.95) 100%
  );
  backdrop-filter: blur(24px);
}

.audio-modal-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: calc(env(safe-area-inset-top, 0px) + 64px) 28px calc(env(safe-area-inset-bottom, 0px) + 40px);
  gap: 0;
  color: #fff;
}

.audio-modal-close {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  left: 50%;
  display: grid;
  place-items: center;
  padding: 6px;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.12);
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}

.audio-modal-art {
  display: grid;
  place-items: center;
  width: min(58vw, 240px);
  aspect-ratio: 1;
  margin-bottom: 28px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 36px;
  color: rgba(255, 255, 255, 0.9);
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.28), transparent 40%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.05));
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(20px);
}

.audio-modal-art img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.audio-modal-info {
  display: grid;
  gap: 6px;
  width: 100%;
  margin-bottom: 28px;
  text-align: left;
}

.audio-modal-info span {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.audio-modal-info h2 {
  margin: 0;
  font-size: clamp(22px, 6vw, 38px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.audio-modal-info p {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
}

.audio-modal-controls {
  display: grid;
  gap: 10px;
  width: 100%;
}

.audio-modal-seek {
  width: 100%;
  height: 6px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.25);
  outline: none;
  touch-action: none;
}

.audio-modal-seek::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.audio-modal-seek::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.audio-modal-times {
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
}

.audio-modal-play-btn {
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  margin: 14px auto 0;
  border-radius: 50%;
  color: #2b2735;
  background: #fff;
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: transform 0.12s, opacity 0.12s;
}

.audio-modal-play-btn:active {
  opacity: 0.85;
  transform: scale(0.94);
}

.audio-modal-error {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 18px;
  border-radius: 16px;
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
}

.audio-modal-error p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

.audio-modal-error a {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.media-placeholder {
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 28px;
  text-align: center;
}

.media-placeholder svg {
  color: var(--olive-dark);
}

.media-placeholder h3 {
  margin: 12px 0 8px;
  color: var(--ink);
  font-size: 24px;
  letter-spacing: -0.04em;
}

.media-placeholder p,
.player-transcript p {
  color: var(--muted);
  line-height: 1.65;
}

.player-transcript {
  padding: 20px;
}

.player-transcript strong {
  color: var(--ink);
}

.player-transcript p {
  margin: 10px 0 0;
  white-space: pre-wrap;
}

.paywall-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: min(88dvh, 820px);
  min-height: 0;
  padding: clamp(20px, 4vw, 36px);
  border-radius: 28px;
  text-align: left;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* Close sits inside the sheet, clear of the rounded corner. */
.paywall-modal > .paywall-close {
  position: absolute;
  top: 18px;
  right: 16px;
  z-index: 4;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 4px rgba(43, 39, 53, 0.16);
  backdrop-filter: none;
}

.paywall-modal > .paywall-close svg {
  display: block;
  width: 16px;
  height: 16px;
}

.paywall-modal:has(> .paywall-close) {
  padding-right: clamp(20px, 4vw, 36px);
}

.paywall-modal > .paywall-kicker,
.paywall-modal > h2 {
  padding-right: 40px;
}

.paywall-modal > .paywall-kicker {
  display: inline-flex;
  max-width: calc(100% - 8px);
}

.paywall-close {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(var(--plum-rgb), 0.1);
  border-radius: 50%;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 12px rgba(43, 39, 53, 0.06);
}

.paywall-later {
  width: 100%;
  margin-top: 12px;
  padding: 12px 14px;
  border: 0;
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-weight: 700;
}

body.paywall-open,
body.rules-open {
  overflow: hidden;
}

.media-feed-card-visual {
  position: relative;
}

.media-lock-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  justify-items: center;
  color: #fff;
  background: linear-gradient(180deg, rgba(42, 11, 61, 0.18), rgba(42, 11, 61, 0.62));
  pointer-events: none;
}

.media-lock-overlay em {
  font-style: normal;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.media-feed-card-actions button.media-cta-locked {
  gap: 8px;
  min-height: 42px;
  padding: 0 18px 0 14px;
  border: 1px solid rgba(122, 86, 150, 0.18);
  border-radius: 999px;
  color: #4a2d63 !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.55)),
    linear-gradient(135deg, #efe4f8 0%, #f3e8ef 55%, #ebe6f4 100%) !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 8px 18px rgba(122, 86, 150, 0.12);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1;
  transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.media-feed-card-actions button.media-cta-locked svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.media-feed-card-actions button.media-cta-locked:active {
  transform: scale(0.97);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 4px 12px rgba(122, 86, 150, 0.12);
}

.media-feed-card-actions button.media-cta-open {
  gap: 8px;
  min-height: 42px;
  padding: 0 16px 0 14px;
  border: 1px solid rgba(var(--plum-rgb), 0.12);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 6px 16px rgba(var(--plum-rgb), 0.08);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1;
}

.chat-rules-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 18px;
}

.chat-rules-list p {
  margin: 0;
  font-size: 15px;
}

.club-rules-modal h2 {
  font-size: clamp(19px, 3.4vw, 24px);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.club-rules-list {
  display: grid;
  gap: 14px;
  margin: 18px 0;
  padding: 0;
  list-style: none;
}

.club-rule {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.club-rule-num {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(180deg, #b39ddb 0%, #8f7aae 100%);
  font-size: 13px;
  font-weight: 800;
}

.club-rule-copy strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.club-rule-copy p {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
}

.club-rule-copy ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.club-rules-outro {
  margin: 4px 0 0;
  font-size: 15px !important;
}

.club-rules-sign {
  margin: 10px 0 4px;
  color: var(--olive-dark) !important;
  font-size: 14px !important;
  font-weight: 700;
}

.club-intro-list {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  padding-left: 20px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}

.club-intro-tag {
  margin: 0 0 6px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(201, 167, 255, 0.22);
  color: var(--olive-dark) !important;
  font-size: 15px !important;
}

.club-intro-welcome {
  margin: 0 0 18px;
  font-weight: 700;
}

.club-intro-actions {
  display: grid;
  gap: 8px;
}

/* Auth-screen consent uses white text on a dark photo; here the panel is light. */
.consent-modal .auth-consent {
  width: 100%;
  margin: 10px 0;
  color: var(--ink);
  text-shadow: none;
}

.consent-modal .auth-consent span {
  color: var(--ink);
}

.consent-modal .auth-consent a {
  color: var(--olive-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.consent-modal .auth-consent input {
  accent-color: var(--olive-dark);
}

.paywall-kicker {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--olive-dark);
  background: rgba(var(--plum-rgb), 0.18);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.paywall-modal h2 {
  margin: 10px 0 10px;
  color: var(--ink);
  font-size: clamp(22px, 4.5vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

@media (max-width: 680px) {
  .paywall-backdrop {
    align-items: flex-end;
    padding: 0;
    overflow: hidden;
  }

  .paywall-modal {
    width: 100%;
    max-height: calc(100dvh - 10px);
    border-radius: 22px 22px 0 0;
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  }

  body.paywall-open .mobile-nav {
    visibility: hidden;
  }
}

.paywall-modal p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.paywall-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0;
}

.paywall-benefits span {
  padding: 9px 12px;
  border-radius: 999px;
  color: var(--olive-dark);
  background: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 800;
}

.paywall-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.feed-list {
  display: grid;
  gap: 18px;
}

.feed-card {
  border-radius: 32px;
  padding: 22px;
}

.feed-card.olive {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(var(--plum-soft-rgb), 0.28));
}

.feed-card.sand {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(217, 206, 190, 0.32));
}

.feed-card.sage {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(var(--plum-soft-rgb), 0.24));
}

.avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: var(--ink);
  background: rgba(var(--plum-soft-rgb), 0.32);
  border: 1px solid rgba(var(--plum-rgb), 0.1);
  font-weight: 800;
}

.avatar.small {
  width: 38px;
  height: 38px;
}

.avatar.large {
  width: 82px;
  height: 82px;
  font-size: 30px;
}

.feed-head {
  justify-content: flex-start;
}

.feed-head h3 {
  margin: 0;
}

.feed-head span,
.message span,
.chat-rooms small {
  color: var(--muted);
  font-size: 13px;
}

.ghost-icon {
  margin-left: auto;
  color: var(--muted);
  background: transparent;
}

.feed-actions {
  justify-content: flex-start;
  margin: 16px 0;
}

.feed-actions span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--olive-dark);
  font-weight: 800;
}

.comment-box,
.composer {
  display: flex;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
}

.comment-box input,
.composer input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  padding: 0 10px;
}

.comment-box button,
.composer button {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  border-radius: 999px;
  color: white;
  background: var(--action);
  font-weight: 800;
}

.media-group {
  display: grid;
  gap: 14px;
}

.media-group > h3 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.telegram-chat-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 0;
  min-height: min(78vh, 760px);
  overflow: hidden;
  border: 1px solid rgba(var(--plum-rgb), 0.1);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(var(--plum-rgb), 0.08);
}

.telegram-room-list {
  display: grid;
  align-content: start;
  gap: 0;
  padding: 0;
  border-right: 1px solid rgba(var(--plum-rgb), 0.08);
  background: #fff;
}

.telegram-room-list-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(var(--plum-rgb), 0.08);
  background: var(--bg);
}

.telegram-room-list-logo {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.telegram-room-list h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.telegram-room-group {
  display: flex;
  flex-direction: column;
}

.telegram-room-group-title {
  padding: 16px 16px 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.telegram-room-list button {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid rgba(var(--plum-rgb), 0.06);
  border-radius: 0;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.telegram-room-list button:hover {
  background: #f4f4f5;
}

.telegram-room-list button.active {
  background: #eef6ea;
}

.telegram-room-avatar {
  display: block;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background-color: #ddd;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  box-shadow: inset 0 0 0 1px rgba(var(--plum-rgb), 0.08);
}

.telegram-room-copy {
  min-width: 0;
}

.telegram-room-copy strong {
  display: block;
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.telegram-room-copy small {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.telegram-room-list time {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 12px;
}

/* Right rail of a room card: timestamp on top, unread counter under it. */
.telegram-room-side {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  align-items: flex-end;
  gap: 5px;
  min-height: 36px;
}

.chat-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  border-radius: 999px;
  color: #fff;
  background: var(--olive-dark, #5f7048);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
}

.chat-unread-pill {
  color: #fff;
  background: rgba(var(--plum-rgb), 0.55);
  font-weight: 700;
}

.telegram-thread {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  background-color: var(--chat-bg-b, #eef4ec);
  background-repeat: repeat;
}

.chat-pinned-bar {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 8px 14px;
  border: 0;
  border-bottom: 1px solid rgba(var(--plum-rgb), 0.08);
  color: var(--ink);
  background: rgba(255, 252, 250, 0.94);
  text-align: left;
}

.chat-pinned-label {
  color: var(--olive-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chat-pinned-text {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-history-hint {
  align-self: center;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  margin: 8px 0 4px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.chat-history-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  animation: chat-attach-spin 0.7s linear infinite;
}

.chat-rooms-skeleton {
  display: grid;
  gap: 4px;
  padding: 8px;
}

.chat-room-skeleton {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 8px;
}

.chat-room-skeleton-avatar {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(var(--plum-rgb), 0.12);
}

.chat-room-skeleton-lines {
  display: grid;
  gap: 7px;
  flex: 1 1 auto;
}

.chat-room-skeleton-lines i {
  display: block;
  height: 11px;
  border-radius: 6px;
  background: rgba(var(--plum-rgb), 0.12);
}

.chat-room-skeleton-lines i:first-child { width: 45%; }
.chat-room-skeleton-lines i:last-child { width: 78%; }

.chat-room-skeleton-avatar,
.chat-room-skeleton-lines i {
  animation: chat-skeleton-pulse 1.4s ease-in-out infinite;
}

@keyframes chat-skeleton-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .chat-room-skeleton-avatar,
  .chat-room-skeleton-lines i { animation: none; }
}

.chat-bubble.is-failed .bubble-body {
  opacity: 0.88;
}

.bubble-retry {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-left: 4px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: #c23b3b;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.telegram-header {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: rgba(255, 252, 250, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(var(--plum-rgb), 0.08);
}

.telegram-header::after {
  content: "";
  display: none;
  grid-column: 3;
  width: 38px;
  height: 38px;
}

.app.immersive-chat .mobile-nav {
  display: none;
}

.app.immersive-chat .shell {
  max-width: none;
  flex: 1;
  min-height: 0;
  height: 100%;
  padding: var(--topbar-offset) 0 0;
}

@media (max-width: 980px) {
  .app.immersive-chat .topbar {
    display: none;
  }

  .app.immersive-chat .shell {
    padding: 0;
  }

  .app.immersive-chat .telegram-header {
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
  }
}

.app.immersive-chat.immersive-ai .shell {
  height: 100dvh;
  padding: 0;
}

.app.immersive-chat .page-shell,
.app.immersive-chat .page-shell-chat {
  flex: 1;
  gap: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding: 0;
}

.app.immersive-chat.immersive-ai .page-shell {
  height: 100%;
}

.app.immersive-chat .telegram-chat-layout {
  min-height: 0;
  height: 100%;
  max-height: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.app.immersive-chat .telegram-thread {
  position: relative;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

.app.immersive-chat .telegram-messages {
  flex: 1 1 0;
  min-height: 0;
  height: auto;
  overscroll-behavior-y: none;
}

.app.immersive-chat .telegram-header {
  position: relative;
  z-index: 3;
  flex-shrink: 0;
}

.telegram-header-back {
  display: none;
  place-items: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  line-height: 0;
}

.telegram-header-back svg {
  display: block;
}

.telegram-header-settings {
  display: grid;
  grid-column: 3;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 22px rgba(43, 39, 53, 0.06);
}

.telegram-header-settings svg {
  display: block;
}

.telegram-header-pill {
  grid-column: 2;
  justify-self: stretch;
  min-width: 0;
  max-width: 100%;
  padding: 2px 4px;
  border-radius: 0;
  text-align: left;
  background: transparent;
  box-shadow: none;
}

.telegram-header-pill strong {
  display: block;
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.telegram-header-pill span {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.telegram-header-avatar {
  display: none;
}

.telegram-error {
  margin: 0;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.72);
}

.chat-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
}

.chat-rooms {
  align-self: start;
}

.chat-rooms h2 {
  margin: 0 0 14px;
}

.chat-rooms button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding: 14px;
  border-radius: 18px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.48);
  text-align: left;
}

.chat-rooms button span {
  flex: 0 0 auto;
  max-width: 135px;
}

.chat-rooms button small {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-rooms button.active {
  color: white;
  background: var(--action);
}

.chat-rooms button.active small {
  color: rgba(255, 255, 255, 0.72);
}

.chat-window {
  display: grid;
  grid-template-rows: auto auto minmax(420px, 1fr) auto;
  border-radius: 34px;
  padding: 24px;
}

.chat-muted,
.chat-error {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.chat-error {
  color: #8a3f6d;
}

.messages {
  display: grid;
  gap: 14px;
  margin: 22px 0;
}

.message {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.52);
}

.message p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.chat-jump {
  position: absolute;
  right: 14px;
  bottom: 76px;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.chat-jump-btn {
  pointer-events: auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 252, 250, 0.96);
  box-shadow: 0 6px 18px rgba(40, 24, 32, 0.16);
  color: var(--olive-dark, #3f5c46);
  font-size: 18px;
  font-weight: 800;
}

.chat-jump-btn[hidden] {
  display: none;
}

.telegram-messages {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: touch;
  background: transparent;
}

.telegram-header,
.chat-pinned-bar,
#chat-compose-slot,
.telegram-composer,
.chat-readonly-note {
  flex-shrink: 0;
}

#chat-compose-slot:empty {
  display: none;
}

.telegram-messages-canvas {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  padding: 12px 0 32px;
  background: transparent;
}

.telegram-messages-canvas > * {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  margin-inline: 12px;
}

.telegram-messages-canvas > .telegram-date-pill {
  margin-inline: auto;
}

/* Keep swatches in the bg picker working. */
.chat-background,
.chat-bg-swatch {
  background-color: var(--chat-bg-b, #eef4ec);
  background-repeat: repeat;
}

.chat-bg-aurora,
.chat-background-aurora,
.chat-bg-swatch-aurora {
  background-color: #eef4ec;
  background-image: radial-gradient(rgba(94, 139, 90, 0.24) 1.2px, transparent 1.4px);
  background-size: 24px 24px;
}

.chat-bg-dark,
.chat-background-dark,
.chat-bg-swatch-dark {
  background-color: #17141e;
  background-image:
    linear-gradient(45deg, rgba(162, 121, 221, 0.18) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(162, 121, 221, 0.12) 25%, transparent 25%),
    linear-gradient(135deg, #17141e 0%, #201a2b 100%);
  background-size: 18px 18px, 18px 18px, auto;
  background-position: 0 0, 9px 9px, 0 0;
}

.chat-bg-plum,
.chat-background-plum,
.chat-bg-swatch-plum {
  background-color: #f5ecf5;
  background-image:
    linear-gradient(rgba(132, 83, 128, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(132, 83, 128, 0.12) 1px, transparent 1px);
  background-size: 28px 28px;
}

.chat-bg-sunset,
.chat-background-sunset,
.chat-bg-swatch-sunset {
  background-color: #fff2e5;
  background-image:
    repeating-radial-gradient(ellipse at 50% 130%, transparent 0 12px, rgba(234, 123, 102, 0.18) 13px 15px, transparent 16px 28px),
    linear-gradient(180deg, #fff2e5, #fdd8cc);
  background-size: 100% 60px, auto;
}

.chat-bg-ocean,
.chat-background-ocean,
.chat-bg-swatch-ocean {
  background-color: #eaf7fb;
  background-image: repeating-linear-gradient(135deg, rgba(43, 137, 174, 0.16) 0 1px, transparent 1px 12px);
}

.chat-bg-forest,
.chat-background-forest,
.chat-bg-swatch-forest {
  background-color: #eef5e9;
  background-image:
    radial-gradient(ellipse 8px 4px at 8px 12px, rgba(67, 124, 72, 0.22) 45%, transparent 48%),
    radial-gradient(ellipse 8px 4px at 20px 24px, rgba(67, 124, 72, 0.16) 45%, transparent 48%);
  background-size: 32px 32px;
}

.telegram-date-pill {
  align-self: center;
  flex: 0 0 auto;
  width: max-content;
  max-width: calc(100% - 24px);
  margin: 6px auto;
  padding: 5px 12px;
  border-radius: 999px;
  color: #fff;
  background: rgba(43, 39, 53, 0.45);
  font-size: 12px;
  font-weight: 700;
}

html.chat-no-select,
html.chat-no-select body,
html.chat-no-select body * {
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
}

.telegram-messages,
.telegram-messages *,
.chat-bubble,
.chat-bubble *,
.chat-msg-menu-backdrop,
.chat-msg-menu-backdrop * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.chat-bubble {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: min(78%, 420px);
  transition: background-color 0.25s ease, transform 0.12s ease;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.chat-bubble.is-pressing .bubble-body {
  transform: scale(0.98);
  filter: brightness(0.97);
}

.chat-bubble.is-flash .bubble-body {
  box-shadow: 0 0 0 2px rgba(79, 143, 208, 0.55);
}

.bubble-body {
  position: relative;
  min-width: 72px;
  padding: 7px 10px 5px;
  border-radius: 14px;
  box-shadow: 0 1px 0 rgba(43, 39, 53, 0.06);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

/* Text itself must not be a selection target on iOS long-press. */
.bubble-body > p,
.bubble-author,
.bubble-meta,
.bubble-meta *,
.chat-hashtag,
.bubble-edited {
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.bubble-body > p a.chat-link {
  pointer-events: auto;
  color: #2f7cc0;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}

button.chat-hashtag {
  pointer-events: auto;
  text-decoration: none;
}

.chat-bubble.mine .bubble-body > p a.chat-link {
  color: #2f7a28;
}

.chat-meeting-card {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  width: 100%;
  min-width: 0;
  min-height: 168px;
  margin: 10px 0 4px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  text-decoration: none;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 12px 24px rgba(43, 39, 53, 0.14);
  pointer-events: auto;
  isolation: isolate;
}

.chat-meeting-art,
.chat-meeting-veil {
  position: absolute;
  inset: 0;
}

.chat-meeting-art {
  z-index: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.chat-meeting-veil {
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(255, 248, 255, 0.2) 0%, rgba(143, 122, 174, 0.18) 42%, rgba(43, 39, 53, 0.78) 100%),
    linear-gradient(135deg, rgba(201, 167, 255, 0.26), rgba(212, 192, 204, 0.1));
}

.chat-meeting-icon {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 22px auto 0;
  border-radius: 15px;
  color: #fff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.45) inset,
    0 10px 22px rgba(18, 14, 24, 0.28);
}

.chat-meeting-icon svg {
  width: 28px;
  height: 28px;
}

.chat-meeting-zoom .chat-meeting-icon {
  background: linear-gradient(180deg, #5b9dff 0%, #2f6df0 100%);
}

.chat-meeting-telemost .chat-meeting-icon {
  background: linear-gradient(180deg, #ff6a45 0%, #e02f10 100%);
}

.chat-meeting-footer {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: auto;
  padding: 16px 12px 12px;
}

.chat-meeting-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.chat-meeting-copy strong {
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 8px rgba(18, 14, 24, 0.35);
}

.chat-meeting-copy span {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-shadow: 0 1px 6px rgba(18, 14, 24, 0.28);
}

.chat-meeting-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 82px;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 6px 14px rgba(18, 14, 24, 0.18);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.chat-meeting-card:active .chat-meeting-cta {
  background: rgba(255, 255, 255, 0.34);
}

.chat-bubble.is-meeting-only {
  max-width: min(92%, 320px);
}

.chat-bubble:has(.chat-meeting-card) {
  max-width: min(92%, 320px);
}

.chat-bubble.is-meeting-only .bubble-body {
  width: 100%;
  padding: 4px;
  background: transparent;
  box-shadow: none;
}

.chat-bubble:has(.chat-meeting-card) .bubble-body {
  max-width: 100%;
  overflow: visible;
}

.chat-bubble.is-meeting-only .bubble-meta {
  float: none;
  display: flex;
  justify-content: flex-end;
  width: 100%;
  margin: 4px 2px 0 0;
  color: rgba(43, 39, 53, 0.45);
}

.intro-badge {
  display: inline-flex;
  align-items: center;
  margin: 0 0 6px;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--olive-dark);
  background: linear-gradient(120deg, rgba(201, 167, 255, 0.45), rgba(255, 214, 232, 0.5));
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: none;
}

.chat-bubble.is-intro .bubble-body {
  background-image: linear-gradient(135deg, rgba(201, 167, 255, 0.22), rgba(255, 255, 255, 0));
  box-shadow:
    0 1px 0 rgba(43, 39, 53, 0.06),
    0 0 0 1px rgba(201, 167, 255, 0.45);
}

.chat-bubble.is-intro-new .bubble-body {
  animation: intro-pop 900ms cubic-bezier(0.22, 1, 0.36, 1);
}

.chat-bubble.is-intro-new .bubble-body::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 16px;
  pointer-events: none;
  /* Must stay invisible at rest: once the shine ends, this layer still sits over the text. */
  opacity: 0;
  background: linear-gradient(
    110deg,
    rgba(255, 255, 255, 0) 20%,
    rgba(255, 255, 255, 0.75) 46%,
    rgba(255, 255, 255, 0) 72%
  );
  background-size: 220% 100%;
  background-repeat: no-repeat;
  animation: intro-shine 1500ms ease-out 120ms 2;
}

.chat-bubble.is-intro-new .intro-badge {
  animation: intro-badge-pop 700ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes intro-pop {
  0% {
    transform: scale(0.94);
    box-shadow: 0 0 0 0 rgba(201, 167, 255, 0.7);
  }
  55% {
    transform: scale(1.015);
  }
  100% {
    transform: scale(1);
    box-shadow:
      0 1px 0 rgba(43, 39, 53, 0.06),
      0 0 0 1px rgba(201, 167, 255, 0.45);
  }
}

@keyframes intro-shine {
  from {
    background-position: 180% 0;
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  to {
    background-position: -60% 0;
    opacity: 0;
  }
}

@keyframes intro-badge-pop {
  0% {
    transform: scale(0.6) rotate(-6deg);
    opacity: 0;
  }
  70% {
    transform: scale(1.08) rotate(2deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-bubble.is-intro-new .bubble-body,
  .chat-bubble.is-intro-new .bubble-body::after,
  .chat-bubble.is-intro-new .intro-badge {
    animation: none;
  }
}

.bubble-reply {
  display: grid;
  gap: 2px;
  width: 100%;
  margin: 0 0 6px;
  padding: 6px 8px;
  border: 0;
  border-left: 3px solid #4f8fd0;
  border-radius: 8px;
  text-align: left;
  background: rgba(0, 0, 0, 0.05);
  cursor: pointer;
}

.chat-bubble.mine .bubble-reply {
  border-left-color: #5fae4d;
  background: rgba(46, 92, 32, 0.08);
}

.bubble-reply strong {
  color: #4f8fd0;
  font-size: 12px;
  font-weight: 800;
}

.chat-bubble.mine .bubble-reply strong {
  color: #3f8a36;
}

.bubble-reply span {
  display: -webkit-box;
  overflow: hidden;
  color: rgba(17, 17, 17, 0.72);
  font-size: 12px;
  line-height: 1.3;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.chat-hashtag {
  padding: 0;
  border: 0;
  color: #2f7cc0;
  background: transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.chat-tag-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px 4px;
}

.chat-tag-chip,
.chat-tag-clear {
  padding: 6px 10px;
  border: 1px solid rgba(var(--plum-rgb), 0.16);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 800;
}

.chat-tag-chip.is-active {
  color: #fff;
  background: #5f4b78;
  border-color: transparent;
}

.material-video-file {
  display: block;
  width: 100%;
  max-height: 70vh;
  background: #111;
}

.material-meeting-link {
  margin: 12px 16px;
}

.edge-swipe-guard {
  position: fixed;
  top: 0;
  bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
  width: 18px;
  z-index: 45;
  touch-action: pan-y;
}

.edge-swipe-guard.is-left { left: 0; }
.edge-swipe-guard.is-right { right: 0; }

.care-links {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.care-link {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 16px;
  color: var(--ink);
  background: rgba(var(--plum-rgb), 0.1);
  font-weight: 800;
  text-decoration: none;
}

.chat-bubble.mine .chat-hashtag {
  color: #2f7a28;
}

.bubble-edited {
  margin-right: 2px;
  font-size: 11px;
  opacity: 0.85;
}

.chat-reaction-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 100%;
}

.chat-bubble.mine .chat-reaction-row {
  justify-content: flex-end;
}

.chat-reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 2px 8px;
  border: 1px solid rgba(43, 39, 53, 0.08);
  border-radius: 999px;
  color: #2b2735;
  background: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(43, 39, 53, 0.06);
}

.chat-reaction-chip.is-mine {
  border-color: rgba(79, 143, 208, 0.45);
  background: #e8f3ff;
}

.chat-reaction-chip small {
  color: rgba(43, 39, 53, 0.62);
  font-size: 12px;
  font-weight: 700;
}

.telegram-compose-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 0 12px;
  padding: 8px 10px;
  border-radius: 14px 14px 0 0;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(43, 39, 53, 0.06);
  border-bottom: 0;
}

.app.immersive-chat .telegram-compose-bar {
  margin: 0;
  border-radius: 0;
  border: 0;
  border-top: 1px solid rgba(var(--plum-rgb), 0.08);
  background: #eef1f4;
}

.telegram-compose-bar-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding-left: 10px;
  border-left: 3px solid var(--olive);
}

.telegram-compose-bar-copy strong {
  color: var(--olive-dark);
  font-size: 13px;
}

.telegram-compose-bar-copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.telegram-compose-bar button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
}

.chat-msg-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
  background: rgba(18, 14, 24, 0.45);
  backdrop-filter: blur(4px);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.chat-msg-menu {
  width: min(100%, 420px);
  padding: 14px;
  border-radius: 22px 22px 18px 18px;
  background: #f4f5f7;
  box-shadow: 0 18px 40px rgba(18, 14, 24, 0.28);
  margin-bottom: env(safe-area-inset-bottom, 0px);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.chat-msg-menu button,
.chat-msg-menu span,
.chat-msg-menu strong {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.chat-msg-menu-emojis {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 18px;
  background: #fff;
}

.chat-emoji-pick {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.chat-emoji-pick:active {
  transform: scale(1.12);
}

.chat-msg-menu-actions {
  display: grid;
  gap: 6px;
  padding: 6px;
  border-radius: 18px;
  background: #fff;
}

.chat-msg-menu-actions button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  color: #2b2735;
  background: transparent;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.chat-msg-menu-actions button.is-danger {
  color: #c0392b;
}

.chat-msg-menu-cancel {
  width: 100%;
  min-height: 46px;
  margin-top: 10px;
  border: 0;
  border-radius: 14px;
  color: #2b2735;
  background: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.chat-bubble.incoming .bubble-body {
  border-bottom-left-radius: 4px;
  background: #fff;
}

.chat-bubble.mine .bubble-body {
  border-bottom-right-radius: 4px;
  background: #d9fdd3;
}

.chat-bubble.incoming {
  align-self: flex-start;
}

.chat-bubble.mine {
  align-self: flex-end;
}

.bubble-author {
  display: block;
  margin-bottom: 2px;
  color: #4f8fd0;
  font-size: 13px;
  font-weight: 800;
}

/* Аватарка слева от чужого сообщения, как в Telegram. */
.chat-bubble.has-avatar {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  column-gap: 6px;
  row-gap: 4px;
  max-width: min(88%, 456px);
}

.chat-bubble.has-avatar > .bubble-avatar {
  grid-column: 1;
  grid-row: 1;
  align-self: end;
}

.chat-bubble.has-avatar > .bubble-body {
  grid-column: 2;
  grid-row: 1;
}

.chat-bubble.has-avatar > .chat-reaction-row {
  grid-column: 2;
  grid-row: 2;
}

.chat-bubble.has-avatar.is-meeting-only,
.chat-bubble.has-avatar:has(.chat-meeting-card) {
  max-width: min(94%, 356px);
}

.bubble-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  overflow: hidden;
  border-radius: 50%;
  color: #fff;
  background: hsl(var(--av-hue, 270) 42% 60%);
  font-size: 13px;
  font-weight: 800;
  pointer-events: none;
}

.bubble-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bubble-avatar.is-spacer {
  background: none;
}

.bubble-author-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-bottom: 2px;
}

.bubble-author-row .bubble-author {
  margin-bottom: 0;
}

/* Подпись команды рядом с именем, например «Психолог Лозы». */
.bubble-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  color: #6d3f94;
  background: rgba(201, 167, 255, 0.28);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.3;
  pointer-events: none;
}

.bubble-body p {
  margin: 0;
  color: #111;
  font-size: 17px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.bubble-meta {
  display: inline-flex;
  float: right;
  align-items: center;
  gap: 4px;
  margin: 4px 0 0 12px;
  color: rgba(43, 39, 53, 0.45);
  font-size: 11px;
  line-height: 1;
}

.bubble-meta time {
  font-size: 11px;
}

.chat-bubble.mine .bubble-meta {
  color: rgba(46, 92, 32, 0.62);
}

.chat-bubble.mine .bubble-meta svg {
  color: #5fae4d;
}

.chat-bubble.is-pending {
  opacity: 0.72;
}

.bubble-sending {
  width: 11px;
  height: 11px;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  opacity: 0.7;
  animation: bubble-sending-spin 0.7s linear infinite;
}

@keyframes bubble-sending-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .bubble-sending { animation-duration: 2s; }
}

.empty-chat {
  margin: auto;
  padding: 12px 16px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.composer.telegram-composer,
.telegram-composer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: end;
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  gap: 8px;
  margin: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  padding: 6px 8px;
  border: 0;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 24px rgba(43, 39, 53, 0.08);
  backdrop-filter: blur(12px);
}

.app.immersive-chat .telegram-composer {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
  border-radius: 0;
  border-top: 1px solid rgba(var(--plum-rgb), 0.08);
  background: #f0f2f5;
  box-shadow: none;
  backdrop-filter: none;
  box-sizing: border-box;
}

.composer.telegram-composer input:not([type="file"]),
.telegram-composer input:not([type="file"]),
.composer.telegram-composer textarea,
.telegram-composer textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 42px;
  min-height: 42px;
  max-height: 34vh;
  flex: none;
  margin: 0;
  padding: 10px 14px;
  border: 0;
  outline: 0;
  border-radius: 22px;
  font: inherit;
  font-size: 16px;
  line-height: 1.35;
  color: var(--ink);
  background: #fff;
  resize: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  field-sizing: content;
}

.telegram-composer textarea.is-expanded {
  border-radius: 18px;
}

.app.immersive-chat .telegram-composer input:not([type="file"]),
.app.immersive-chat .telegram-composer textarea {
  padding: 10px 14px;
  background: #fff;
}

.telegram-composer-icon,
.telegram-composer-attach,
.telegram-composer-send {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  line-height: 0;
}

.telegram-composer-attach {
  color: rgba(var(--plum-rgb), 0.55);
  transition: color 0.15s ease, background-color 0.15s ease, transform 0.1s ease;
}

.telegram-composer-attach:active {
  color: var(--olive-dark);
  background: rgba(var(--plum-rgb), 0.08);
  transform: scale(0.94);
}

/* Attachment tray between compose bar and composer */
.chat-attach-tray {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
  padding: 8px 12px 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.chat-attach-tray::-webkit-scrollbar {
  display: none;
}

.chat-attach-chip {
  position: relative;
  flex: 0 0 auto;
  width: 68px;
  height: 68px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(var(--plum-rgb), 0.08);
  box-shadow: 0 4px 14px rgba(43, 39, 53, 0.12);
}

.chat-attach-chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-attach-chip.is-uploading img {
  opacity: 0.55;
}

.chat-attach-chip.is-error img {
  opacity: 0.4;
}

.chat-attach-spinner {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: chat-attach-spin 0.7s linear infinite;
}

@keyframes chat-attach-spin {
  to { transform: rotate(360deg); }
}

.chat-attach-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(196, 62, 62, 0.55);
}

.chat-attach-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(20, 14, 26, 0.66);
  line-height: 0;
}

/* Photos inside chat bubbles */
.bubble-photos {
  display: grid;
  gap: 3px;
  margin: 2px 0 6px;
  border-radius: 14px;
  overflow: hidden;
}

.bubble-photos.is-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bubble-photo {
  display: block;
  padding: 0;
  border: 0;
  background: rgba(var(--plum-rgb), 0.06);
  line-height: 0;
  cursor: zoom-in;
}

/* A single photo reserves its slot via inline aspect-ratio so the thread does
   not jump when the image decodes. The grid keeps square tiles. */
.bubble-photos:not(.is-grid) .bubble-photo {
  width: min(260px, 72vw);
  max-height: 340px;
}

.bubble-photos:not(.is-grid) .bubble-photo[style*="aspect-ratio"] img {
  max-height: none;
  height: 100%;
}

.bubble-photo img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  opacity: 1;
}

.bubble-photo[style*="aspect-ratio"] { background: rgba(var(--plum-rgb), 0.1); }

.bubble-photos.is-grid .bubble-photo img {
  aspect-ratio: 1 / 1;
  max-height: none;
}

.chat-bubble.has-photos .bubble-body {
  padding-top: 6px;
}

/* Photos and link cards are their own surface — a coloured bubble around them
   only adds a box. Declared last so it wins over .mine / .incoming fills. */
.chat-bubble.is-media-only .bubble-body {
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.chat-bubble.is-media-only .bubble-photos,
.chat-bubble.is-media-only .chat-meeting-card {
  margin: 0;
}

.chat-bubble.is-photo-only .bubble-photos {
  border-radius: 16px;
}

/* Author and timestamp ride on top of the photo instead of a bubble strip. */
.chat-bubble.is-photo-only .bubble-author,
.chat-bubble.is-photo-only .bubble-meta {
  position: absolute;
  z-index: 2;
  margin: 0;
  padding: 3px 9px;
  border-radius: 999px;
  color: #fff;
  background: rgba(12, 8, 16, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Keep the bubbles readable on photos: text stays above media */
.chat-bubble.is-photo-only .bubble-author-row {
  margin: 0;
  height: 0;
}

.chat-bubble.is-photo-only .bubble-status {
  display: none;
}

.chat-bubble.is-photo-only .bubble-author {
  top: 8px;
  left: 8px;
  font-size: 12px;
}

.chat-bubble.is-photo-only .bubble-meta {
  right: 8px;
  bottom: 8px;
  float: none;
}

.chat-bubble.is-photo-only .bubble-meta,
.chat-bubble.is-photo-only .bubble-meta svg {
  color: #fff;
}

.photo-viewer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(12, 8, 16, 0.94);
  backdrop-filter: blur(6px);
}

.photo-viewer-image {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  object-fit: contain;
}

.photo-viewer-close {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top, 0px));
  right: 14px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  line-height: 0;
}

.telegram-composer-send {
  color: #fff;
  background: linear-gradient(180deg, #879b78 0%, var(--sage) 100%);
  box-shadow: 0 8px 18px rgba(123, 146, 112, 0.28);
}

.telegram-composer-send svg {
  display: block;
  /* optical center for the up-arrow in a circle */
  transform: translateY(-0.5px);
}

.telegram-composer-send:disabled {
  opacity: 0.45;
  box-shadow: none;
}

.chat-bg-picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 190;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(24, 16, 32, 0.42);
  backdrop-filter: blur(4px);
}

.chat-bg-picker {
  width: min(560px, 100%);
  max-height: min(78vh, 620px);
  overflow-y: auto;
  border-radius: 28px 28px 0 0;
  padding: 10px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  box-shadow: 0 -18px 58px rgba(43, 39, 53, 0.18);
  animation: sheet-up 0.28s cubic-bezier(0.32, 0.72, 0, 1) both;
}

.chat-bg-picker-handle {
  width: 42px;
  height: 4px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: rgba(var(--plum-rgb), 0.18);
}

.chat-bg-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.chat-bg-picker-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.chat-bg-picker-head h2 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 22px;
  letter-spacing: -0.04em;
}

.chat-bg-picker-head button {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: rgba(var(--plum-rgb), 0.08);
}

.chat-bg-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.chat-settings-block {
  margin-top: 22px;
}

.chat-settings-label {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.chat-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(var(--plum-rgb), 0.035);
}

.chat-settings-row-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.chat-settings-row-copy strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
}

.chat-settings-row-copy span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

/* Toggle switch */
.chat-settings-toggle {
  position: relative;
  flex-shrink: 0;
  width: 52px;
  height: 30px;
  cursor: pointer;
}

.chat-settings-toggle.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.chat-settings-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.chat-settings-toggle span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(var(--plum-rgb), 0.18);
  transition: background-color 0.2s ease;
}

.chat-settings-toggle span::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(43, 39, 53, 0.16);
  transition: transform 0.2s cubic-bezier(0.33, 1, 0.68, 1);
}

.chat-settings-toggle input:checked + span {
  background: var(--olive);
}

.chat-settings-toggle input:checked + span::before {
  transform: translateX(22px);
}

.chat-settings-test {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
  padding: 12px 16px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(180deg, var(--olive) 0%, var(--olive-dark) 100%);
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(var(--plum-rgb), 0.22);
  transition: transform 0.1s ease, opacity 0.2s ease;
}

.chat-settings-test:active {
  transform: scale(0.98);
}

.chat-settings-test:disabled {
  opacity: 0.5;
}

.chat-bg-grid button {
  display: grid;
  gap: 9px;
  padding: 8px;
  border: 2px solid transparent;
  border-radius: 20px;
  color: var(--ink);
  background: rgba(var(--plum-rgb), 0.035);
  text-align: left;
}

.chat-bg-grid button.active {
  border-color: var(--action);
  background: rgba(95, 142, 75, 0.1);
}

.chat-bg-grid strong {
  padding: 0 4px 2px;
  font-size: 14px;
}

.chat-bg-swatch {
  position: relative;
  display: block;
  height: 86px;
  overflow: hidden;
  border-radius: 15px;
  background-color: var(--chat-bg-b);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

.chat-bg-swatch::before,
.chat-bg-swatch::after {
  content: "";
  position: absolute;
  border-radius: 12px;
}

.chat-bg-swatch::before {
  left: 12px;
  bottom: 13px;
  width: 46%;
  height: 18px;
  background: rgba(255, 255, 255, 0.86);
}

.chat-bg-swatch::after {
  right: 12px;
  top: 15px;
  width: 38%;
  height: 18px;
  background: rgba(217, 253, 211, 0.9);
}

.chat-bg-swatch-dark::before {
  background: rgba(255, 255, 255, 0.82);
}

.chat-bg-swatch-dark::after {
  background: rgba(118, 210, 106, 0.88);
}

.chat-bg-swatch-aurora {
  background-image: radial-gradient(rgba(94, 139, 90, 0.38) 1.5px, transparent 1.7px);
  background-size: 15px 15px;
}

.chat-bg-swatch-dark {
  background-color: #17141e;
  background-image:
    linear-gradient(45deg, rgba(162, 121, 221, 0.3) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(162, 121, 221, 0.18) 25%, transparent 25%);
  background-size: 12px 12px;
}

.chat-bg-swatch-plum {
  background-image:
    linear-gradient(rgba(132, 83, 128, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(132, 83, 128, 0.2) 1px, transparent 1px);
  background-size: 18px 18px;
}

.chat-bg-swatch-sunset {
  background-color: #fff2e5;
  background-image: repeating-radial-gradient(ellipse at 50% 130%, transparent 0 9px, rgba(234, 123, 102, 0.32) 10px 12px, transparent 13px 20px);
  background-size: 100% 40px;
}

.chat-bg-swatch-ocean {
  background-image: repeating-linear-gradient(135deg, rgba(43, 137, 174, 0.25) 0 1px, transparent 1px 8px);
}

.chat-bg-swatch-forest {
  background-image:
    radial-gradient(ellipse 7px 3px at 8px 12px, rgba(67, 124, 72, 0.32) 45%, transparent 48%),
    radial-gradient(ellipse 7px 3px at 19px 23px, rgba(67, 124, 72, 0.24) 45%, transparent 48%);
  background-size: 22px 22px;
}

@media (max-width: 980px) {
  .shell:has(.page-shell-chat),
  .shell:has(.page-shell-ai) {
    padding-inline: 0;
  }

  .page-shell-chat {
    padding-top: 0;
    padding-inline: 0;
  }

  .telegram-chat-layout {
    grid-template-columns: 1fr;
    min-height: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .telegram-chat-layout.thread-open .telegram-room-list {
    display: none;
  }

  .telegram-chat-layout.rooms-open .telegram-thread {
    display: none;
  }

  .telegram-header-back {
    display: grid;
  }

  .telegram-header-pill {
    justify-self: stretch;
  }
}

@media (min-width: 981px) {
  .app.immersive-chat .shell {
    max-width: none;
    padding: var(--topbar-offset) 0 0;
  }

  .app.immersive-chat .telegram-chat-layout {
    min-height: 0;
    height: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  /* No back button on desktop — don't reserve an empty 38px column. */
  .telegram-header {
    grid-template-columns: minmax(0, 1fr) 38px;
    padding: 12px 16px;
    background: #fff;
  }

  .telegram-header-pill {
    grid-column: 1;
  }

  .telegram-header-settings {
    grid-column: 2;
    background: rgba(var(--plum-rgb), 0.06);
    box-shadow: none;
  }

  .telegram-header::after {
    display: none;
  }

  /* Dock the composer to the panel edge — no floating pill / white gap. */
  .app.immersive-chat .telegram-composer,
  .telegram-composer {
    width: 100%;
    margin: 0;
    padding: 10px 14px;
    border-radius: 0;
    border-top: 1px solid rgba(var(--plum-rgb), 0.08);
    background: #f0f2f5;
    box-shadow: none;
    backdrop-filter: none;
    box-sizing: border-box;
  }

  .telegram-composer textarea,
  .telegram-composer input:not([type="file"]) {
    width: 100%;
    min-width: 0;
  }

  .telegram-thread {
    min-height: 0;
    height: 100%;
  }

  .telegram-room-list {
    min-height: 0;
    height: 100%;
    overflow-y: auto;
  }
}

.composer button:disabled,
.composer input:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.practice-track {
  align-items: stretch;
}

.practice-card {
  position: relative;
  min-height: 300px;
  overflow: hidden;
}

.practice-card svg { display: none; }

.step-number {
  position: absolute;
  right: 18px;
  top: 10px;
  color: rgba(var(--plum-rgb), 0.12);
  font-size: 76px;
  font-weight: 900;
  letter-spacing: -0.08em;
}

.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.movie-card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 22px;
  color: white;
  background: var(--action);
  background-position: center;
  background-size: cover;
  box-shadow: 0 16px 36px rgba(43, 39, 53, 0.14);
  text-align: left;
}

.movie-card img,
.poster-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster-fallback {
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.35), transparent 32%),
    linear-gradient(180deg, #4a4152, var(--action));
}

.movie-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(25, 17, 31, 0.78));
}

.movie-info {
  position: absolute;
  z-index: 1;
  inset: auto 16px 16px;
}

.movie-info span {
  color: rgba(255, 255, 255, 0.78);
}

.movie-info h3 {
  margin: 6px 0 0;
  font-size: clamp(16px, 3.5vw, 22px);
  line-height: 1.05;
}

.movie-info p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  line-height: 1.3;
}

.movie-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: stretch;
  padding: 0;
  background: rgba(25, 15, 35, 0.72);
  backdrop-filter: blur(16px);
}

.movie-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  height: 92dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 22px 22px 0 0;
  background: transparent;
  animation: movie-sheet-in 0.28s ease-out;
}

@keyframes movie-sheet-in {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

.movie-modal-close {
  position: sticky;
  top: 14px;
  z-index: 6;
  align-self: flex-end;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin: -52px 14px 0;
  padding: 0;
  border-radius: 50%;
  color: white;
  background: rgba(25, 17, 31, 0.55);
  backdrop-filter: blur(8px);
}

.movie-modal-hero {
  position: sticky;
  top: 0;
  z-index: 0;
  flex: 0 0 auto;
  height: clamp(240px, 44vh, 380px);
  overflow: hidden;
}

.movie-modal-hero img,
.movie-modal-hero .poster-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.movie-modal-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 20%, rgba(25, 17, 31, 0.88));
}

.movie-modal-head {
  position: absolute;
  z-index: 1;
  inset: auto 20px 40px;
  color: white;
}

.movie-modal-head span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.movie-modal-head h2 {
  margin: 8px 0 0;
  color: white;
  font-size: clamp(28px, 6vw, 38px);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.movie-modal-body {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
  margin-top: -28px;
  border-radius: 28px 28px 0 0;
  padding: 28px 20px calc(40px + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
}

.movie-modal-body > p {
  margin: 0;
  color: rgba(43, 39, 53, 0.88);
  font-size: 17px;
  line-height: 1.68;
}

.movie-modal-prompt {
  margin: 0;
}

.movie-modal-prompt p {
  font-size: 16px;
  line-height: 1.55;
}

.ai-coach-page {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  background: #f7f4fb;
}

.ai-coach-scroll {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 8px 16px 20px;
}

.ai-coach-hero,
.ai-coach-locked {
  position: relative;
  overflow: visible;
  border-radius: 28px;
  padding: 16px 4px 8px;
}

.ai-fullscreen-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: auto;
  margin: calc(-1 * (env(safe-area-inset-top, 0px) + 6px)) -8px 6px;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px;
  background: linear-gradient(135deg, #7a9a5d 0%, #5f8e4b 100%);
  color: #fff;
}

.ai-fullscreen-head button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: none;
}

.ai-fullscreen-head strong,
.ai-fullscreen-head span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-fullscreen-head strong {
  color: #fff;
  font-size: 17px;
  letter-spacing: -0.03em;
}

.ai-fullscreen-head span {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  font-weight: 700;
}

.ai-coach-hero::after,
.ai-coach-locked::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -100px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(149, 213, 178, 0.38), transparent 68%);
  pointer-events: none;
}

.ai-coach-page h1 {
  max-width: 640px;
  margin: 10px 0;
  color: var(--ink);
  font-size: clamp(26px, 6vw, 36px);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

html.is-compact .ai-starters {
  grid-template-columns: 1fr;
}

.ai-coach-page p {
  max-width: 640px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.ai-chat-window {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(560px, 100%);
  margin: 0 auto;
  min-width: 0;
  padding: 6px 0 12px;
}

.ai-message {
  width: min(86%, 420px);
  max-width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(var(--plum-rgb), 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 22px rgba(var(--plum-rgb), 0.05);
}

.ai-message.user {
  align-self: flex-end;
  margin-left: auto;
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #7a9a5d, #5f8e4b);
}

.ai-message.assistant {
  justify-self: start;
  background: rgba(255, 255, 255, 0.94);
}

.ai-message span {
  display: block;
  margin-bottom: 6px;
  color: inherit;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.05em;
  opacity: 0.72;
  text-transform: uppercase;
}

.ai-message p {
  margin: 0;
  color: inherit;
  font-size: 16px;
  line-height: 1.58;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ai-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.ai-link-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(var(--plum-rgb), 0.14);
  border-radius: 14px;
  background: rgba(var(--plum-rgb), 0.05);
  color: var(--plum);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}

.ai-link-chip:hover {
  background: rgba(var(--plum-rgb), 0.1);
  border-color: rgba(var(--plum-rgb), 0.24);
}

.ai-link-chip:active {
  transform: scale(0.985);
}

.ai-link-chip > svg:first-child {
  flex: 0 0 auto;
  color: #5f8e4b;
}

.ai-link-chip > span {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  color: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  /* Long titles wrap to multiple lines instead of forcing the layout wide. */
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  opacity: 1;
}

.ai-link-chip > svg:last-child {
  flex: 0 0 auto;
  opacity: 0.5;
}

.ai-starters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 2px 0 8px;
}

.ai-starters::-webkit-scrollbar {
  display: none;
}

.ai-starters button {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 76px;
  padding: 12px;
  border: 1px solid rgba(var(--plum-rgb), 0.1);
  border-radius: 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  text-align: left;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  box-shadow: 0 6px 18px rgba(var(--plum-rgb), 0.05);
}

.ai-starters button span {
  color: var(--olive-dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ai-starters button:active {
  transform: scale(0.98);
  background: rgba(var(--plum-rgb), 0.05);
}

.ai-error {
  margin: 0;
  padding: 12px 14px;
  border-radius: 18px;
  color: #8a3f6d;
  background: rgba(138, 63, 109, 0.08);
  font-size: 14px;
}

.ai-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: end;
  position: relative;
  z-index: 3;
  width: auto;
  margin: 0 12px 10px;
  padding: 8px 8px 8px 12px;
  border: 1px solid rgba(var(--plum-rgb), 0.08);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(var(--plum-rgb), 0.08);
}

.ai-composer textarea {
  width: 100%;
  min-width: 0;
  max-height: 130px;
  min-height: 24px;
  resize: none;
  border: 0;
  outline: 0;
  border-radius: 0;
  padding: 8px 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-size: 16px;
  line-height: 1.45;
}

.ai-composer button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--action);
}

.ai-composer button:disabled,
.ai-starters button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.movie-modal-cta {
  width: 100%;
}

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #f6f3fa 0%, #f0ecf6 48%, #ebe6f2 100%);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.splash-brand {
  display: grid;
  justify-items: center;
  gap: 12px;
  animation: splash-enter 0.65s cubic-bezier(0.22, 0.85, 0.32, 1) both;
}

.splash-brand span {
  color: var(--ink);
  font-size: 24px;
  font-weight: 850;
  letter-spacing: -0.06em;
}

.splash-screen-hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-logo {
  width: min(96px, 26vw);
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 14px 28px rgba(167, 139, 199, 0.1));
  animation: splash-pulse 1.6s ease-in-out infinite;
}

@keyframes splash-enter {
  from { opacity: 0; transform: translateY(12px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes splash-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.04);
    opacity: 0.9;
  }
}

.prompt {
  margin: 20px 0;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.54);
}

.prompt p {
  margin: 8px 0 0;
}

.profile-grid {
  grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr));
}

.profile-hero {
  border-radius: 38px;
  padding: 32px;
}

.profile-hero h1 {
  overflow-wrap: anywhere;
  font-size: clamp(28px, 6vw, 46px);
  line-height: 1;
}

.stat-card strong {
  display: block;
  color: var(--olive-dark);
  font-size: 48px;
  letter-spacing: -0.06em;
}

.stat-card span {
  color: var(--muted);
}

.mobile-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: none;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  border: 0;
  border-top: 1px solid rgba(var(--plum-rgb), 0.12);
  border-radius: 0;
  background: color-mix(in srgb, var(--bg) 82%, #fff);
  box-shadow: none;
  backdrop-filter: blur(20px) saturate(1.12);
  -webkit-backdrop-filter: blur(20px) saturate(1.12);
}

.mobile-nav button {
  position: relative;
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 48px;
  border-radius: 14px;
  color: #6b6578;
  background: transparent;
  font-size: 10px;
  font-weight: 700;
}

.mobile-nav .nav-unread-badge {
  position: absolute;
  top: 2px;
  left: calc(50% + 5px);
  min-width: 18px;
  height: 18px;
  margin: 0;
  padding: 0 4px;
  font-size: 9px;
}

.mobile-nav button.active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: none;
}

@media (max-width: 980px) {
  .desktop-nav {
    display: none;
  }

  .topbar {
    padding-inline: 8px;
    padding-top: calc(8px + env(safe-area-inset-top, 0px));
    justify-content: space-between;
  }

  .brand {
    flex-shrink: 0;
    font-size: 18px;
  }

  .brand img {
    width: 30px;
    height: 30px;
  }

  .shell {
    padding-inline: 10px;
  }

  .app.immersive-chat .shell {
    padding-inline: 0;
  }

  .hero,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .grid-three,
  .content-grid,
  .practice-track,
  .editorial-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-nav {
    display: grid;
  }

  .movie-modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .movie-modal {
    border-radius: 22px 22px 0 0;
  }
}

/* After Yandex return iOS often reports a desktop viewport (~980–1200).
   Screen size + this class keep the phone chrome even when matchMedia lies. */
html.is-compact .desktop-nav {
  display: none !important;
}

html.is-compact .mobile-nav {
  display: grid !important;
}

html.is-compact .app.immersive-ai .mobile-nav {
  display: grid !important;
}

/* Inside an open chat thread the composer must stay reachable: no tab bar. */
html.is-compact .app.immersive-chat .mobile-nav,
.app.immersive-chat .mobile-nav {
  display: none !important;
}

html.is-compact .hero,
html.is-compact .profile-grid {
  grid-template-columns: 1fr !important;
}

html.is-compact .hero {
  min-height: auto !important;
  padding: 8px 0 18px;
  border-radius: 0;
}

html.is-compact .hero-art {
  min-height: 220px;
}

html.is-compact .hero-note {
  display: none;
}

html.is-compact .hero h1 {
  font-size: clamp(26px, 6.6vw, 34px);
  max-width: none;
}

html.is-compact .hero-copy > p {
  font-size: 17px;
}

html.is-compact .hero-actions {
  flex-direction: column;
  align-items: stretch;
  margin-top: 20px;
}

@media (max-device-width: 900px) {
  .desktop-nav {
    display: none !important;
  }

  .mobile-nav {
    display: grid !important;
  }

  .app.immersive-chat .mobile-nav {
    display: none !important;
  }

  .hero,
  .profile-grid {
    grid-template-columns: 1fr !important;
  }

  .hero {
    min-height: auto !important;
  }
}

@media (max-width: 680px) {
  .header-actions .icon-button {
    display: none;
  }

  .shell {
    padding: var(--topbar-offset) 12px 0;
  }

  .app.immersive-chat .shell,
  .app.immersive-ai .shell {
    padding: 0;
  }

  .page-shell {
    padding-top: 8px;
  }

  .app.immersive-chat .page-shell,
  .app.immersive-chat .page-shell-chat {
    padding: 0;
  }

  .app.immersive-ai .page-shell,
  .app.immersive-ai .page-shell-ai {
    padding: 0 0 calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
  }

  .page-shell-media {
    padding-top: 8px;
  }

  .hero {
    min-height: auto;
    padding: 8px 0 18px;
    border-radius: 0;
  }

  .section {
    padding-inline: 0;
  }

  .hero h1 {
    font-family: var(--font-headline);
    font-size: clamp(26px, 6.6vw, 34px);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.16;
    max-width: none;
  }

  .hero-copy > p {
    font-size: 17px;
  }

  .ai-message {
    width: 94%;
  }

  .hero-art {
    min-height: 220px;
  }

  .hero-note {
    display: none;
  }

  .grid-three,
  .content-grid,
  .practice-track,
  .editorial-rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: min(84vw, 300px);
    grid-template-columns: unset;
    align-items: stretch;
    gap: 12px;
    margin-inline: -12px;
    padding-inline: 12px 24px;
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 12px;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 12px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .editorial-rail::-webkit-scrollbar {
    display: none;
  }

  .editorial-card {
    scroll-snap-align: start;
    width: 100%;
  }

  .editorial-card-art {
    height: 152px;
  }

  .editorial-icon {
    width: 34px;
    height: 34px;
  }

  .editorial-meta strong {
    font-size: 12px;
  }

  .editorial-cta {
    padding: 8px 11px;
    font-size: 12px;
  }

  .section-header h2 {
    font-size: clamp(20px, 5.6vw, 26px);
  }

  .movie-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .brand span {
    font-size: 24px;
  }

  .mobile-nav {
    left: 8px;
    right: 8px;
    bottom: 8px;
  }
}

@media (max-width: 380px) {
  .movie-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Brand wordmark — real loaded fonts (not "Manrope Variable", which never loads). */
.brand span {
  font-family: "Onest", "Manrope", "Segoe UI", system-ui, sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.media-console {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 34px;
  overflow: hidden;
  max-width: 100%;
}

.media-search {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.media-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 17px;
}

.media-search input::placeholder {
  color: rgba(116, 106, 128, 0.68);
}

.media-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.media-tabs button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid rgba(var(--plum-rgb), 0.12);
  border-radius: 999px;
  color: var(--olive-dark);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 10px 26px rgba(var(--plum-rgb), 0.07);
  font-weight: 850;
  white-space: nowrap;
}

.media-tabs button.active {
  color: #fff;
  background: var(--action);
  border-color: transparent;
}

.media-tabs small {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  color: var(--olive-dark);
  background: rgba(201, 167, 255, 0.72);
  font-size: 12px;
  font-weight: 900;
}

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

.media-access-note {
  padding: 16px 20px;
  border-radius: 24px;
  font-size: 14px;
  line-height: 1.55;
}

.media-access-note p {
  margin: 0;
}

.media-access-note p + p {
  margin-top: 8px;
}

.media-free-count {
  color: var(--olive-dark);
  font-weight: 700;
}

.media-section-card {
  position: relative;
  overflow: hidden;
}

.media-section-card span,
.progress-card span,
.data-note {
  color: var(--olive-dark);
  font-size: 13px;
  font-weight: 850;
}

.media-section-card h3 {
  margin: 10px 0 8px;
  color: var(--ink);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1;
  letter-spacing: -0.06em;
}

.progress-card {
  display: grid;
  align-content: center;
  gap: 10px;
}

.progress-card strong {
  color: var(--ink);
  font-size: 34px;
  line-height: 1;
}

.progress-card div {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(217, 206, 190, 0.28);
}

.progress-card i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sage), var(--olive));
}

.library-list {
  display: grid;
  gap: 22px;
}

.library-list .library-card,
.library-list .library-card-button {
  min-height: 180px;
  padding: 22px;
  border-radius: 28px;
}

.transcript-preview {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.access-wall {
  display: grid;
  gap: 18px;
  max-width: 720px;
  margin: 40px auto;
  padding: clamp(28px, 5vw, 54px);
  border-radius: 42px;
}

.access-wall h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(38px, 6vw, 68px);
  line-height: 0.96;
  letter-spacing: -0.07em;
}

.access-wall p {
  max-width: 590px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.material-page {
  display: grid;
  gap: 18px;
  max-width: 920px;
  margin: 0 auto;
  width: 100%;
}

body.material-immersive-open .topbar,
body.material-immersive-open .mobile-nav,
body.material-immersive-open .pwa-install-banner {
  display: none !important;
}

.app-crash-screen {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  align-content: center;
  gap: 14px;
  padding: 24px;
  color: var(--ink);
  background: var(--bg);
  text-align: center;
}

.app-crash-screen img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.app-crash-screen h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.app-crash-screen p {
  max-width: 320px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.app-crash-screen button {
  margin-top: 6px;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--action);
  font-weight: 800;
}

.material-page-immersive {
  --m-pad-x: 20px;
  --m-8: 8px;
  --m-12: 12px;
  --m-16: 16px;
  --m-20: 20px;
  --m-24: 24px;
  --m-32: 32px;
  position: fixed;
  inset: 0;
  z-index: 100;
  gap: 0;
  max-width: none;
  margin: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

body.material-immersive-open {
  overflow: hidden;
}

.material-immersive-media {
  width: 100%;
  max-width: none;
  margin-left: 0;
}

.audio-frame-immersive {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #19111f;
}

.audio-frame-immersive audio {
  display: block;
  width: 100%;
  padding: 18px;
}

.material-immersive-body {
  display: grid;
  gap: 0;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px calc(32px + env(safe-area-inset-bottom, 0px));
}

.glass-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  justify-self: start;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 24px rgba(var(--plum-rgb), 0.08);
  font-size: 14px;
  font-weight: 800;
}

.material-kicker {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.6;
}

.material-page-immersive h1 {
  margin: 0;
  color: var(--ink);
  /* Same display face as home mobile section titles — compact under video */
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  line-height: 30px;
  letter-spacing: -0.03em;
}

.material-page-immersive h1.is-long {
  font-size: 22px;
  line-height: 28px;
}

.material-page-immersive > .material-immersive-body > p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.material-section-plain {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.material-section-plain h2 {
  margin: 8px 0 6px;
  font-size: 20px;
}

.material-section-plain p {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.detail-back {
  justify-self: start;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--olive-dark);
  background: rgba(255, 255, 255, 0.64);
  font-weight: 850;
}

.material-hero {
  padding: clamp(26px, 5vw, 48px);
  border-radius: 38px;
}

.material-hero > span {
  color: var(--olive-dark);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.material-hero h1 {
  margin: 14px 0;
  color: var(--ink);
  font-size: clamp(36px, 6vw, 64px);
  line-height: 0.98;
  letter-spacing: -0.07em;
}

.material-hero p,
.material-section p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.material-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.material-chip,
.material-chips small {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border-radius: 17px;
  color: var(--ink);
  background: rgba(var(--plum-rgb), 0.08);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
}

.material-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 500;
}

.material-meta-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.material-meta-row svg {
  width: 18px;
  height: 18px;
  opacity: 0.72;
}

.material-takeaways {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 20px;
  border-radius: 24px;
  background: #fff;
  border: 1px solid #ececec;
  box-shadow: 0 4px 20px rgba(43, 39, 53, 0.08);
}

.material-takeaways h2 {
  margin: 0;
  color: var(--ink);
  font-family: "Onest", "Manrope", "Segoe UI", system-ui, sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
  letter-spacing: -0.02em;
}

.material-takeaways ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.material-takeaways li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--ink);
  font-size: 15px;
  line-height: 22px;
  font-weight: 500;
}

.material-takeaway-check {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 4px;
  border-radius: 50%;
  color: #fff;
  background: var(--olive-dark);
}

.material-takeaway-check svg {
  width: 12px;
  height: 12px;
}

.material-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  height: 60px;
  padding: 0 24px;
  border: 0;
  border-radius: 30px;
  color: #fff;
  background: linear-gradient(180deg, var(--olive) 0%, var(--olive-dark) 100%);
  box-shadow: 0 12px 28px rgba(var(--plum-rgb), 0.28);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
}

.material-cta:hover {
  background: linear-gradient(180deg, var(--brand-hover) 0%, var(--olive-dark) 100%);
}

.material-cta:active {
  transform: scale(0.985);
}

.material-cta-copy {
  display: grid;
  gap: 2px;
  text-align: left;
}

.material-cta-copy strong {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.2;
}

.material-cta-copy small {
  font-size: 14px;
  font-weight: 400;
  opacity: 0.85;
}

.material-cta svg {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  opacity: 0.92;
}

.material-section {
  display: grid;
  gap: 14px;
}

.material-section h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(24px, 4vw, 34px);
  letter-spacing: -0.05em;
}

.material-video {
  border-radius: 18px;
}

.mark-viewed {
  min-height: 48px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(180deg, var(--olive) 0%, var(--olive-dark) 100%);
  font-weight: 900;
}

.data-note {
  width: fit-content;
  margin: 0;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
}

.media-tabs::-webkit-scrollbar {
  display: none;
}

@media (max-width: 680px) {
  .brand img {
    width: 30px;
    height: 30px;
  }

  .brand span {
    font-size: 18px;
  }

  .media-console {
    padding: 12px;
  }

  .media-search {
    min-height: 54px;
  }

  .media-overview {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .material-page {
    gap: 14px;
  }

  .material-section.glass-card {
    padding: 16px;
    border-radius: 22px;
  }

  .video-frame,
  .material-video {
    border-radius: 0;
    box-shadow: none;
  }

  .material-section .video-frame {
    margin-inline: -16px;
    width: calc(100% + 32px);
  }
}

.yandex-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 800;
  color: #fff;
  background: #101010;
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(16, 16, 16, 0.16);
}

.yandex-button-icon {
  display: grid;
  place-items: center;
}

.pwa-install-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 92px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 22px;
}

.pwa-install-banner p {
  margin: 4px 0 0;
  font-size: 14px;
}

.pwa-install-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.checkout-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(145deg, #f0ecf6 0%, #ebe6f2 100%);
}

.checkout-card {
  width: min(480px, 100%);
  padding: 28px;
  border-radius: 28px;
}

.checkout-brand {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.checkout-yookassa,
.checkout-prodamus {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.checkout-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(43, 39, 53, 0.08);
}

.checkout-pay {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(180deg, #5b4bff, #3d2fd6);
  cursor: pointer;
}

.checkout-note,
.checkout-error {
  font-size: 14px;
}

.checkout-error {
  color: #b42318;
}

.checkout-success-inline {
  margin: 0;
  padding: 14px 16px;
  border-radius: 18px;
  color: #2f5d28;
  background: rgba(126, 176, 105, 0.16);
  font-size: 14px;
  line-height: 1.5;
}

.checkout-success {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(169, 159, 188, 0.2);
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.plan-card {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(43, 39, 53, 0.08);
  text-align: left;
  color: inherit;
}

.plan-card-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.plan-renew {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.plan-renew p,
.plan-renew ol {
  margin: 0;
}

.plan-renew ol {
  padding-left: 18px;
}

.plan-renew summary {
  width: fit-content;
  color: var(--olive-dark);
  font-weight: 800;
  cursor: pointer;
}

.plan-renew a {
  color: var(--olive-dark);
}

.plan-card-benefits {
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.plan-card-buy {
  margin-top: 4px;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: var(--action);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.plan-card-buy:active {
  transform: scale(0.98);
}

.chat-readonly-note {
  flex-shrink: 0;
  margin: 0;
  padding: 16px 16px calc(22px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(var(--plum-rgb), 0.08);
  background: #f7f4fb;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  line-height: 1.4;
}

.movie-detail-note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.plan-card.is-featured {
  border-color: rgba(var(--plum-rgb), 0.35);
  box-shadow: 0 10px 28px rgba(var(--plum-rgb), 0.1);
}

.plan-card-price {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.plan-card-price small {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.plan-card-desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.profile-plan-grid {
  padding: 0 4px 8px;
}

.profile-access-line,
.ai-quota-line {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.media-feed-card.is-locked .media-feed-card-visual {
  filter: grayscale(0.2);
  opacity: 0.9;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 190;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(24, 16, 32, 0.42);
  backdrop-filter: blur(4px);
  overflow-y: auto;
}

.plan-card strong {
  font-size: 16px;
  letter-spacing: -0.03em;
}

.profile-plans,
.profile-links {
  padding: 22px;
}

.profile-free-list {
  margin: 0 0 16px;
  padding-left: 18px;
  color: var(--muted);
}

@media (max-width: 760px) {
  .plan-grid {
    grid-template-columns: 1fr;
  }

  .pwa-install-banner {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (min-width: 981px) {
  .page-shell {
    padding-bottom: 24px;
  }

  /*
    Desktop keeps the SAME single scroller as mobile (.media-feed-scroll).
    We only drop the two sources of dead bands on a mouse page. Top: the
    floating-overlay spacer, so the bar joins the normal flow and the reserved
    padding goes away. Bottom: the mobile bottom-nav padding, which has no nav
    to sit above here.

    The .page-shell-media prefix is load-bearing: the base .media-feed-* rules
    live LATER in this file, so a bare selector here loses the cascade. The
    extra class outranks them regardless of source order.
  */
  .page-shell-media .media-feed-controls,
  .page-shell-media .media-feed-page.media-controls-hidden .media-feed-controls {
    position: static;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 0;
  }

  .page-shell-media .media-feed-scroll {
    padding-top: 0;
  }

  .page-shell-media .media-feed-page {
    padding-bottom: 24px;
  }
}

/* Media library — HYPE-style feed */
.media-feed-page {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px) + 12px);
}

/*
  Overlay chrome + constant spacer:
  --media-controls-h reserves room for the first card at rest.
  Hide/show only translates the bar; the spacer stays, so no content jump.
*/
.media-feed-controls {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 6;
  padding-inline: 2px;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  border-bottom: 1px solid rgba(var(--plum-rgb), 0.08);
  transform: translate3d(0, 0, 0);
  opacity: 1;
  transition:
    transform 0.22s cubic-bezier(0.33, 1, 0.68, 1),
    opacity 0.18s ease;
  will-change: transform, opacity;
  pointer-events: auto;
}

.media-feed-page.media-controls-hidden .media-feed-controls {
  transform: translate3d(0, calc(-100% - 1px), 0);
  opacity: 0;
  pointer-events: none;
  border-bottom-color: transparent;
}

.media-feed-scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  /* Constant — do not toggle this when the bar hides. */
  padding-top: var(--media-controls-h, 148px);
}

.media-feed-header {
  display: grid;
  gap: 16px;
  padding: 8px 0 14px;
  background: var(--bg);
}

.media-feed-toolbar {
  display: grid;
  gap: 8px;
  padding: 0 0 10px;
  background: var(--bg);
}

.media-feed-search-top {
  width: 100%;
}

.media-feed-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.media-feed-brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.media-feed-brand span {
  color: var(--ink);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 1;
}

.media-feed-categories {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 2px 0 6px;
  scrollbar-width: none;
}

.media-feed-categories::-webkit-scrollbar {
  display: none;
}

.media-feed-categories button {
  flex: 0 0 auto;
  padding: 0 0 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.media-feed-categories button.active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.media-feed-categories button.is-locked {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.media-feed-categories button.is-locked svg {
  width: 11px;
  height: 11px;
  opacity: 0.55;
}

.media-feed-sort {
  display: flex;
  gap: 18px;
}

.media-feed-sort button {
  padding: 0;
  border: 0;
  color: rgba(var(--plum-rgb), 0.42);
  background: transparent;
  font-size: 15px;
  font-weight: 700;
}

.media-feed-sort button.active {
  color: var(--ink);
  font-weight: 900;
}

.media-feed-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(var(--plum-rgb), 0.12);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.88);
}

.media-feed-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 16px;
}

.media-feed-search-clear {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--muted);
  background: rgba(var(--plum-rgb), 0.08);
  font-size: 18px;
  line-height: 1;
}

.media-feed-search-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.media-feed-list {
  display: grid;
  gap: 28px;
  padding-top: 12px;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.media-feed-list.is-loading,
.feed-list.is-loading {
  opacity: 0;
}

.feed-list {
  transition: opacity 0.2s ease;
}

.media-feed-card {
  display: grid;
  gap: 12px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(var(--plum-rgb), 0.1);
}

.media-feed-card:last-child {
  border-bottom: 0;
}

.media-feed-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.media-feed-card-head > span:not(.access-badge) {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-feed-card-logo {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.media-feed-lock {
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--olive-dark);
  background: rgba(201, 167, 255, 0.35);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.media-feed-card-visual {
  position: relative;
  display: block;
  width: 100%;
  height: 0;
  padding: 0 0 56.25%;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background: rgba(var(--plum-rgb), 0.06);
}

.media-feed-card-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-feed-card-visual.is-poster {
  display: grid;
  place-items: center;
  height: auto;
  padding: 20px 16px 22px;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.55), transparent 46%),
    linear-gradient(180deg, #f4eee8, #ebe3ed);
}

.media-feed-poster {
  display: block;
  width: min(46%, 220px);
  overflow: hidden;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(43, 39, 53, 0.2);
  background: #ddd6de;
}

.media-feed-card-visual.is-poster img {
  position: static;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ddd6de;
}

.media-feed-visual-lock {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #fff;
  background: rgba(43, 39, 53, 0.62);
  font-size: 11px;
  font-weight: 800;
  backdrop-filter: blur(6px);
}

.media-feed-card-title {
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-size: clamp(22px, 4.5vw, 28px);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.04em;
  text-align: left;
}

.media-feed-card-title:hover {
  color: var(--olive-dark);
}

.media-feed-card-desc {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.media-desc-fold {
  display: grid;
  gap: 8px;
}

.media-desc-toggle {
  padding: 0;
  border: 0;
  color: var(--olive-dark);
  background: transparent;
  font-size: 14px;
  font-weight: 800;
  text-align: left;
}

.material-paid-text {
  margin-top: 18px;
}

.material-paid-text h2 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 800;
}

.feed-link {
  color: var(--olive-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
  pointer-events: auto;
  user-select: auto;
  -webkit-user-select: auto;
}

.media-feed-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.media-feed-card-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font-size: 14px;
  font-weight: 700;
}

.media-feed-card-actions button:first-child {
  margin-right: auto;
}

.media-feed-card-actions button[data-like-item],
.media-feed-card-actions button[data-share-item] {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(var(--plum-rgb), 0.08);
}

.media-feed-card-actions .media-action-liked {
  color: #d6456a;
}

.media-feed-empty {
  padding: 40px 0;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 680px) {
  .media-feed-brand span {
    font-size: 24px;
  }

  .media-feed-card-visual:not(.is-poster) {
    padding-bottom: 52%;
  }

  .media-feed-poster {
    width: min(52%, 200px);
  }

  .insta-post-media:not(.is-video) {
    height: auto;
    padding-bottom: 0;
  }

  .media-feed-card-title {
    font-size: 20px;
  }
}

.media-feed-toolbar,
.media-feed-sort {
  display: none !important;
}

.feed-page {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

.insta-feed {
  display: grid;
  gap: 0;
}

.feed-empty-state {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 48px 20px;
  color: var(--muted);
  text-align: center;
}

.feed-empty-state p {
  max-width: 360px;
  margin: 0;
}

.insta-post-skeleton {
  pointer-events: none;
}

.insta-skeleton-head,
.insta-skeleton-actions {
  display: flex;
  align-items: center;
}

.insta-skeleton-head {
  gap: 10px;
  padding: 12px 14px;
}

.insta-skeleton-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 10px;
  background: rgba(var(--plum-rgb), 0.1);
}

.insta-skeleton-copy {
  display: grid;
  flex: 1;
  gap: 7px;
}

.insta-skeleton-copy i,
.insta-skeleton-actions i,
.insta-skeleton-lines i {
  display: block;
  border-radius: 999px;
  background: rgba(var(--plum-rgb), 0.1);
  animation: chat-skeleton-pulse 1.4s ease-in-out infinite;
}

.insta-skeleton-copy i:first-child { width: 34%; height: 11px; }
.insta-skeleton-copy i:last-child { width: 52%; height: 9px; }

.insta-skeleton-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(110deg, rgba(var(--plum-rgb), 0.07) 8%, rgba(255, 255, 255, 0.52) 18%, rgba(var(--plum-rgb), 0.07) 33%);
  background-size: 220% 100%;
  animation: feed-skeleton-shimmer 1.25s linear infinite;
}

.insta-skeleton-actions {
  gap: 16px;
  padding: 9px 14px 4px;
}

.insta-skeleton-actions i {
  width: 26px;
  height: 12px;
}

.insta-skeleton-actions i:last-child {
  margin-left: auto;
}

.insta-skeleton-lines {
  display: grid;
  gap: 8px;
  padding: 6px 14px 16px;
}

.insta-skeleton-lines i { height: 10px; }
.insta-skeleton-lines i:nth-child(2) { width: 92%; }
.insta-skeleton-lines i:nth-child(3) { width: 68%; }

@keyframes feed-skeleton-shimmer {
  to { background-position-x: -220%; }
}

@media (prefers-reduced-motion: reduce) {
  .insta-skeleton-copy i,
  .insta-skeleton-actions i,
  .insta-skeleton-lines i,
  .insta-skeleton-media {
    animation: none;
  }
}

@media (min-width: 761px) {
  .page-shell-feed {
    padding-inline: 16px;
    padding-top: 18px;
  }

  .feed-page {
    overflow: visible;
    border: 1px solid rgba(var(--plum-rgb), 0.1);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(61, 41, 75, 0.06);
  }

  .insta-post:last-child {
    border-bottom: 0;
  }

  .insta-post-media:not(.is-video) {
    max-height: none;
    height: auto;
    padding-bottom: 0;
  }
}

.insta-post {
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid rgba(var(--plum-rgb), 0.1);
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.insta-post-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}

.insta-post-mark {
  display: block;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.insta-post-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--ink);
  background: rgba(var(--plum-soft-rgb), 0.35);
  font-weight: 800;
}

.insta-post-meta {
  display: grid;
  gap: 2px;
}

.insta-post-meta strong {
  font-size: 14px;
}

.insta-post-meta span {
  color: var(--muted);
  font-size: 12px;
}

.insta-post-media {
  position: relative;
  width: 100%;
  height: auto;
  overflow: hidden;
  background: #f4efe8;
}

.insta-post-media:not(.is-video) img {
  position: static;
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  vertical-align: middle;
}

.insta-post-media.is-video {
  height: 0;
  padding-bottom: 56.25%;
  background: #111;
}

.insta-post-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 11px 14px 9px;
}

.insta-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.insta-action span {
  font-variant-numeric: tabular-nums;
}

.insta-action-share {
  margin-left: auto;
}

.insta-post-stats {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.insta-post-caption {
  padding: 4px 14px 14px;
  font-size: 14px;
  line-height: 1.55;
}

.insta-post-byline {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.insta-post-caption-logo {
  display: block;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.insta-post-caption-copy {
  min-width: 0;
  flex: 1;
}

.insta-post-caption-name {
  margin: 0;
  line-height: 1.3;
}

.insta-post-caption-body {
  margin-top: 2px;
  white-space: pre-wrap;
}

.insta-post-caption-body.is-clamped {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  overflow: hidden;
}

.insta-post-more {
  margin-top: 6px;
  padding: 0;
  color: var(--olive-dark);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.insta-post-more[hidden] {
  display: none;
}

.insta-post-title {
  margin: 4px 0 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.insta-post-actions-end {
  padding: 4px 14px 16px;
}

.insta-post-react {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(43, 39, 53, 0.08);
}

.insta-post-react-copy {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.insta-like-cta {
  flex-shrink: 0;
  margin-left: auto;
  gap: 6px;
  padding: 8px 15px;
  border-radius: 999px;
  background: rgba(43, 39, 53, 0.06);
}

.insta-like-cta.insta-liked {
  background: rgba(224, 55, 93, 0.12);
}

.insta-like-cta:active {
  transform: scale(0.96);
}

.insta-post-media iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

html:not(.is-staff) .insta-post-caption,
html:not(.is-staff) .media-feed-card,
html:not(.is-staff) .material-page,
html:not(.is-staff) .chat-bubble-main,
html:not(.is-staff) .telegram-messages,
html:not(.is-staff) .telegram-thread {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.insta-post-caption strong {
  margin-right: 6px;
}

.insta-liked {
  color: #e0375d !important;
}

/* ── Comments sheet modal ──────────────────────────────── */

@keyframes sheet-up {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

.comments-backdrop {
  position: fixed;
  inset: 0;
  z-index: 180;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
}

.comments-sheet {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  max-height: 82dvh;
  border-radius: 24px 24px 0 0;
  background: var(--bg);
  box-shadow: 0 -16px 60px rgba(var(--plum-rgb), 0.18);
  animation: sheet-up 0.32s cubic-bezier(0.32, 0.72, 0, 1) both;
}

.comments-sheet-handle {
  width: 36px;
  height: 4px;
  margin: 12px auto 0;
  border-radius: 99px;
  background: rgba(var(--plum-rgb), 0.18);
}

.comments-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--line);
}

.comments-sheet-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.comments-sheet-close {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  color: var(--muted);
  background: rgba(var(--plum-rgb), 0.06);
  line-height: 1;
}

.comments-sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.comments-list {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.comments-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.comments-item-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #7a9a5d, #5f8e4b);
  font-size: 14px;
  font-weight: 800;
}

.comments-item-copy {
  min-width: 0;
}

.comments-item-copy strong {
  font-size: 13px;
  font-weight: 800;
}

.comments-item-copy p {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  word-break: break-word;
}

.comments-skeleton {
  display: grid;
  gap: 16px;
  min-height: 220px;
  padding: 4px 0 12px;
}

.comments-skeleton-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.comments-skeleton-row i,
.comments-skeleton-row b {
  display: block;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(var(--plum-rgb), 0.08), rgba(var(--plum-rgb), 0.16), rgba(var(--plum-rgb), 0.08));
  background-size: 200% 100%;
  animation: comments-shimmer 1.2s ease-in-out infinite;
}

.comments-skeleton-row i {
  width: 36px;
  height: 36px;
}

.comments-skeleton-row span {
  display: grid;
  gap: 8px;
  padding-top: 4px;
}

.comments-skeleton-row b:first-child {
  width: 38%;
  height: 12px;
}

.comments-skeleton-row b:last-child {
  width: 78%;
  height: 12px;
}

@keyframes comments-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.comments-empty {
  display: grid;
  gap: 8px;
  padding: 40px 0;
  color: var(--muted);
  text-align: center;
  justify-items: center;
}

.comments-empty p {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.comments-empty span {
  font-size: 13px;
}

.comments-sheet-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
}

.comments-sheet-input input {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(var(--plum-rgb), 0.14);
  border-radius: 999px;
  outline: 0;
  background: rgba(var(--plum-rgb), 0.04);
  font-size: 14px;
  font-family: inherit;
}

.comments-sheet-input button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, #2a1d35, #4b3858);
  box-shadow: 0 5px 14px rgba(var(--plum-rgb), 0.25);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.comments-sheet-input button:active {
  transform: scale(0.92);
}

.comments-sheet-input button:disabled {
  opacity: 0.4;
}

/* ── Movie facts (Kinopoisk-style meta) ─────────────────── */

.movie-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-bottom: 4px;
}

.movie-fact {
  display: grid;
  gap: 2px;
}

.movie-fact span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.movie-fact strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

/* ── Movie detail page (Apple-style overlap) ────────────── */

.movie-detail-page {
  position: fixed;
  inset: 0;
  z-index: 120;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
}

.movie-detail-hero {
  position: relative;
  width: 100%;
  height: min(64vh, 560px);
  overflow: hidden;
  background: #2b2735;
}

.movie-detail-hero img,
.movie-detail-hero .poster-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.movie-detail-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(25, 17, 31, 0.32) 0%, transparent 26%, transparent 62%, var(--bg) 99%);
}

.movie-detail-back {
  position: absolute;
  z-index: 2;
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  left: 16px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #2b2735;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.24);
}

.movie-detail-back:active {
  transform: scale(0.92);
}

.movie-detail-body {
  position: relative;
  z-index: 1;
  margin-top: -34px;
  padding: 28px 20px calc(env(safe-area-inset-bottom, 0px) + 48px);
  border-radius: 28px 28px 0 0;
  background: var(--bg);
}

.movie-detail-kicker {
  color: var(--olive-dark);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.movie-detail-body h1 {
  margin: 8px 0 16px;
  font-size: clamp(28px, 7vw, 40px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.movie-detail-body .movie-facts {
  padding: 16px 0;
  margin-bottom: 4px;
  border-top: 1px solid rgba(var(--plum-rgb), 0.1);
  border-bottom: 1px solid rgba(var(--plum-rgb), 0.1);
}

.movie-detail-desc {
  margin: 18px 0 0;
  font-size: 16px;
  line-height: 1.62;
  color: var(--ink);
}

.movie-detail-body .movie-modal-prompt {
  margin-top: 22px;
}

.movie-detail-body .movie-modal-cta {
  margin-top: 22px;
  width: 100%;
  justify-content: center;
}

/* ── Consistent inner-screen navigation ────────────────── */

.inner-page-header {
  position: sticky;
  top: 0;
  z-index: 12;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  min-height: 60px;
  padding: env(safe-area-inset-top, 0px) 14px 0;
  border-bottom: 1px solid rgba(var(--plum-rgb), 0.08);
  background: rgba(251, 247, 253, 0.94);
  backdrop-filter: blur(20px);
}

.inner-page-back {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: rgba(var(--plum-rgb), 0.08);
}

.inner-page-back:active {
  transform: scale(0.92);
  background: rgba(var(--plum-rgb), 0.14);
}

.brand-mark {
  display: block;
  background: none;
  border-radius: 0;
  box-shadow: none;
}

.inner-page-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  line-height: 1.1;
}

.inner-page-brand > div {
  display: grid;
  min-width: 0;
}

.inner-page-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  background: none;
}

.inner-page-brand strong {
  color: var(--ink);
  font-size: 15px;
  letter-spacing: -0.03em;
}

.inner-page-brand span {
  overflow: hidden;
  max-width: 100%;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inner-page-spacer {
  width: 34px;
  height: 34px;
}

/* The poster belongs to the film content, not a stretched screen header. */
.movie-detail-page {
  display: block;
  background: var(--bg);
}

.movie-detail-header {
  position: sticky;
}

.movie-detail-hero {
  display: none;
}

.movie-detail-body {
  max-width: 680px;
  margin: 0 auto;
  padding: 22px 20px calc(env(safe-area-inset-bottom, 0px) + 48px);
  border-radius: 0;
}

.movie-detail-poster {
  width: min(58vw, 250px);
  margin: 0 auto 24px;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  border-radius: 16px;
  background: #e8e1e9;
  box-shadow: 0 16px 34px rgba(43, 39, 53, 0.18);
}

.movie-detail-poster img,
.movie-detail-poster .poster-fallback {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.movie-detail-body h1 {
  margin: 8px 0 14px;
  font-size: clamp(27px, 7vw, 38px);
}

.material-page-immersive .inner-page-header {
  position: sticky;
}

.material-immersive-media {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: var(--m-12) var(--m-pad-x) 0;
  background: var(--bg);
}

.material-video-immersive {
  position: relative;
  width: 100%;
  overflow: hidden;
  /* ~1.58:1 MasterClass-like frame (taller than 16:9) */
  aspect-ratio: 1.58 / 1;
  border-radius: 20px !important;
  box-shadow: 0 10px 28px rgba(var(--plum-rgb), 0.12);
}

.material-video-immersive::before {
  content: none;
  display: none;
  padding: 0;
}

.material-immersive-body {
  display: grid;
  gap: 0;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  /* 24px from video → title block */
  padding: var(--m-24) var(--m-pad-x) calc(var(--m-32) + env(safe-area-inset-bottom, 0px));
}

.material-immersive-body > .material-kicker {
  margin: 0;
}

.material-immersive-body > h1 {
  margin: var(--m-8) 0 0;
}

.material-immersive-body > .material-meta-row {
  margin-top: var(--m-16);
}

.material-immersive-body > .material-chips {
  margin-top: var(--m-16);
}

/* 24 between tags and takeaways card */
.material-immersive-body > .material-takeaways {
  margin-top: var(--m-24);
}

@media (min-width: 981px) {
  .material-page-immersive {
    background:
      radial-gradient(1200px 480px at 50% -10%, rgba(var(--plum-soft-rgb), 0.28), transparent 60%),
      var(--bg);
  }

  .material-immersive-media {
    padding: var(--m-12) var(--m-pad-x) 0;
  }

  .material-video-immersive {
    border-radius: 20px !important;
    box-shadow: 0 22px 60px rgba(var(--plum-rgb), 0.16);
  }

  .material-immersive-body {
    padding: var(--m-20) var(--m-pad-x) calc(28px + env(safe-area-inset-bottom, 0px));
  }
}

.material-summary {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.62;
}

.material-section-plain {
  display: grid;
  gap: 14px;
  margin-top: 4px;
}

.material-section-plain h2 {
  margin: 10px 0 0;
}

.material-section-plain p {
  margin: 0;
  font-size: 16px;
  line-height: 1.72;
}

.material-type-label {
  color: var(--olive-dark);
  font-size: 12px;
  font-weight: 800;
}

.material-article {
  display: block;
  margin-top: 20px;
}

.material-article p {
  margin: 0 0 0.95em;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.material-article p.material-blank {
  height: 0.85em;
  margin: 0;
}

.ai-inner-header {
  position: relative;
  z-index: 4;
  margin: 0;
  padding-top: calc(env(safe-area-inset-top, 0px) + 8px);
  padding-inline: 8px;
  background: rgba(247, 244, 251, 0.96);
  border-bottom: 1px solid rgba(var(--plum-rgb), 0.08);
}

.ai-typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 1px 2px 2px;
}

.ai-typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(var(--plum-rgb), 0.48);
  animation: ai-typing-pulse 1.2s ease-in-out infinite;
}

.ai-typing i:nth-child(2) { animation-delay: 0.14s; }
.ai-typing i:nth-child(3) { animation-delay: 0.28s; }

@keyframes ai-typing-pulse {
  0%, 60%, 100% { opacity: 0.34; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* ── iOS-style profile ──────────────────────────────────── */

.profile-ios {
  display: grid;
  gap: 20px;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 4px 2px 28px;
}

.profile-ios-aside,
.profile-ios-main {
  display: grid;
  gap: 20px;
  min-width: 0;
}

@media (min-width: 981px) {
  .profile-ios {
    max-width: 880px;
    gap: 28px;
    padding: 12px 8px 40px;
    grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.2fr);
    align-items: start;
  }

  .profile-ios-hero {
    grid-column: 1 / -1;
  }

  .profile-ios-aside {
    display: grid;
    gap: 22px;
  }

  .profile-ios-main {
    display: grid;
    gap: 22px;
  }
}

.profile-ios-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px;
  border-radius: 26px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.5)),
    linear-gradient(145deg, rgba(var(--plum-soft-rgb), 0.3), rgba(217, 206, 190, 0.16));
  border: 1px solid rgba(var(--plum-rgb), 0.08);
  box-shadow: 0 18px 40px rgba(43, 39, 53, 0.08);
}

.profile-avatar-wrap {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  padding: 0;
  border: 0;
  background: none;
  appearance: none;
  cursor: pointer;
  font: inherit;
}

div.profile-avatar-wrap {
  cursor: default;
}

.profile-ios-avatar {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  color: #fff;
  font-size: 30px;
  font-weight: 800;
  background: linear-gradient(150deg, var(--action), #6c5b7b);
  box-shadow: 0 10px 24px rgba(108, 91, 123, 0.35);
  overflow: hidden;
}

.profile-avatar-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--ink);
  border: 1px solid rgba(var(--plum-rgb), 0.12);
  box-shadow: 0 4px 10px rgba(43, 39, 53, 0.12);
}

.profile-avatar-note {
  margin: 8px 0 0;
  font-size: 13px;
}

.profile-avatar-reset {
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--action);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.profile-ios-avatar.has-photo {
  background: #ddd6cf;
}

.profile-ios-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-ios-identity h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.profile-ios-identity p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.ios-group {
  display: grid;
  gap: 8px;
}

.ios-group > .plan-card-buy {
  width: 100%;
}

.ios-group-title {
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ios-list {
  overflow: hidden;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(var(--plum-rgb), 0.08);
}

.ios-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid rgba(var(--plum-rgb), 0.08);
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ios-row:last-child {
  border-bottom: 0;
}

.ios-row:hover {
  background: rgba(var(--plum-rgb), 0.04);
}

.ios-row:active {
  background: rgba(var(--plum-rgb), 0.08);
}

.ios-row > svg:last-child {
  flex: 0 0 auto;
  margin-left: auto;
  opacity: 0.35;
  color: var(--muted);
}

.ios-row-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--ink);
  background: rgba(var(--plum-rgb), 0.06);
  border: 1px solid rgba(var(--plum-rgb), 0.08);
}

.ios-row-icon svg {
  width: 19px;
  height: 19px;
  opacity: 0.82;
}

.ios-row-text {
  display: grid;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.ios-row-text strong {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.ios-row-text span {
  overflow: hidden;
  font-size: 13px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.ios-row-chevron {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: rgba(var(--plum-rgb), 0.35);
}

.ios-info-row {
  padding: 16px;
}

.ios-info-row span {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
}

.ios-footnote {
  margin: 0;
  padding: 0 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
}

.about-loza-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 0 28px;
}

.about-loza-page .inner-page-header {
  position: relative;
  padding-top: 8px;
  background: transparent;
  border-bottom: 0;
}

.about-loza-card {
  display: grid;
  gap: 12px;
  padding: 22px 20px 24px;
  border: 1px solid rgba(var(--plum-rgb), 0.08);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 40px rgba(43, 39, 53, 0.06);
}

.about-loza-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.about-loza-kicker {
  margin: 4px 0 0;
  color: var(--olive-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.about-loza-card h1 {
  margin: 0;
  font-size: 32px;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.about-loza-lead {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.5;
}

.about-loza-card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.about-loza-list {
  margin: 4px 0 0;
  padding-left: 18px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}

.about-loza-list li + li {
  margin-top: 8px;
}

.delete-account-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.delete-account-list li + li {
  margin-top: 8px;
}

.delete-account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}