@import url('https://fonts.googleapis.com/css2?family=Golos+Text:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg-primary: #f7f5ef;
  --surface: #ffffff;
  --bg-secondary: #f1efe8;
  --bg-soft: #fbfaf7;
  --accent: #237a68;
  --accent-strong: #195a4d;
  --accent-soft: #eaf3ef;
  --text-primary: #1e2326;
  --text-secondary: #5a6268;
  --text-tertiary: #5a6268;
  --border: #e6e2d6;
  --border-soft: #eeeae1;
  --line-strong: #d5d0c3;
  --header-bg: rgba(255, 255, 255, 0.96);
  --mark-bg: #dceee8;
  --thumb-bg: #161b1b;
  --match-bg: #f4f9f6;
  --match-border: #dbe7e1;
  --empty-icon-bg: #fbfcfa;
  --empty-icon-border: #c7dcd6;
  --toast-bg: #1e2326;
  --toast-fg: #ffffff;
  --radius-pill: 999px;
  --radius-small: 8px;
  --radius-medium: 12px;
  --radius-card: 14px;
  --radius-large: 16px;
  --sidebar-width: 252px;
  --header-height: 72px;
  --control-size: 44px;
  --shadow-soft: 0 8px 24px rgba(30, 35, 38, 0.08);
  --shadow-pop: 0 16px 40px rgba(30, 35, 38, 0.1);
  --shadow-card: 0 14px 28px rgba(30, 35, 38, 0.07);
  --cat-namaz: #2b763b;
  --cat-quran: #00736b;
  --cat-daret: #1d65b3;
  --cat-taube: #78289c;
  --cat-duga: #d87b00;
  --cat-oraza: #b81d5b;
}

html[data-theme='dark'] {
  color-scheme: dark;
  --bg-primary: #101614;
  --surface: #1a221f;
  --bg-secondary: #151c19;
  --bg-soft: #121916;
  --accent: #3fa888;
  --accent-strong: #5fc4a2;
  --accent-soft: #1a322b;
  --text-primary: #e8efec;
  --text-secondary: #9aaba4;
  --text-tertiary: #8a9b94;
  --border: #2a3531;
  --border-soft: #232e2a;
  --line-strong: #3a4842;
  --header-bg: rgba(26, 34, 31, 0.94);
  --mark-bg: #244038;
  --thumb-bg: #0a0e0d;
  --match-bg: #1a2c26;
  --match-border: #2d4a40;
  --empty-icon-bg: #151c19;
  --empty-icon-border: #2d4a40;
  --toast-bg: #e8efec;
  --toast-fg: #101614;
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.28);
  --shadow-pop: 0 16px 40px rgba(0, 0, 0, 0.38);
  --shadow-card: 0 14px 28px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

html {
  min-width: 320px;
  background: var(--bg-primary);
}

body {
  min-width: 320px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Golos Text', system-ui, sans-serif;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

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

button,
input,
select {
  font: inherit;
}

button,
a,
select,
input,
.video-card {
  -webkit-tap-highlight-color: transparent;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
.video-card:focus-visible {
  outline: 3px solid rgba(35, 122, 104, 0.34);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

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

/* Header and search */
header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  height: var(--header-height);
  padding: 0 28px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.logo {
  display: inline-flex;
  align-items: baseline;
  flex: 0 0 auto;
  color: var(--text-primary);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.7px;
  line-height: 1;
}

.logo span {
  color: var(--accent);
}

.theme-toggle,
.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--control-size);
  height: var(--control-size);
  flex: 0 0 var(--control-size);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--text-primary);
  transition: background 160ms, border-color 160ms, color 160ms;
}

.theme-toggle {
  display: inline-flex;
}

.theme-toggle svg,
.menu-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
}

.menu-toggle svg {
  fill: currentColor;
  stroke: none;
}

.theme-toggle:hover,
.menu-toggle:hover {
  background: var(--bg-secondary);
  border-color: var(--line-strong);
}

.menu-toggle {
  display: none;
}

.search-container {
  position: relative;
  display: flex;
  flex: 1 1 660px;
  flex-direction: column;
  max-width: 660px;
  margin: 0 auto;
}

.search-container form {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 48px;
}

.search-bar {
  width: 100%;
  height: 48px;
  padding: 0 96px 0 46px;
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  outline: none;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 500;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.search-bar::placeholder {
  color: var(--text-secondary);
}

.search-bar:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(35, 122, 104, 0.16);
}

.search-leading {
  position: absolute;
  left: 16px;
  z-index: 1;
  display: flex;
  width: 20px;
  height: 20px;
  color: var(--accent-strong);
  pointer-events: none;
}

.search-leading svg {
  width: 20px;
  height: 20px;
}

.search-btn,
.search-clear {
  position: absolute;
  top: 2px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--control-size);
  height: var(--control-size);
  border: 0;
  border-radius: var(--radius-small);
}

.search-btn {
  right: 2px;
  background: var(--accent);
  color: var(--surface);
}

.search-clear {
  right: 50px;
  background: transparent;
  color: var(--text-secondary);
}

.search-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.search-clear svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.search-clear:hover {
  background: var(--border-soft);
  color: var(--text-primary);
}

.search-btn:hover {
  background: var(--accent-strong);
}

.search-trust {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 16px;
  margin-top: 5px;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  line-height: 1.2;
}

.search-trust-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* Suggestions */
.suggest-empty {
  padding: 18px 16px;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  text-align: center;
}

.suggest {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  animation: suggest-in 140ms ease;
}

.suggest-list {
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.suggest-backdrop {
  display: none;
}

@keyframes suggest-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#app.is-live-updating .search-list,
#app.is-live-updating .video-grid,
#app.is-live-updating .page-head {
  animation: live-fade 160ms ease;
}

@keyframes live-fade {
  from {
    opacity: 0.55;
  }
  to {
    opacity: 1;
  }
}

.suggest-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 10px 16px;
  border: 0;
  border-top: 1px solid var(--border-soft);
  background: var(--surface);
  color: var(--text-primary);
  text-align: left;
}

.suggest-item:first-child {
  border-top: 0;
}

.suggest-item:hover,
.suggest-item.is-active {
  background: var(--accent-soft);
}

.suggest-thumb {
  width: 30px;
  height: 44px;
  flex: 0 0 30px;
  border-radius: 5px;
  object-fit: cover;
  background: var(--bg-secondary);
}

.suggest-body {
  min-width: 0;
  flex: 1;
}

.suggest-title {
  display: block;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggest-meta {
  display: block;
  margin-top: 3px;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
}

.suggest-snippet {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 5px;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.suggest-snippet mark {
  padding: 0 2px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--accent) 22%, var(--surface));
  color: inherit;
  font-weight: 700;
}

.suggest-thumb {
  margin-top: 2px;
}

.suggest-item::after {
  flex: 0 0 auto;
  color: var(--accent);
  content: '›';
  font-size: 22px;
  line-height: 1;
}

.suggest-footer {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 12px 16px;
  border: 0;
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}

.suggest-footer:hover {
  background: var(--accent-soft);
}

mark {
  padding: 1px 3px;
  border-radius: 4px;
  background: var(--mark-bg);
  color: var(--accent-strong);
  font-weight: 700;
}

/* Sidebar */
nav.sidebar {
  position: fixed;
  top: var(--header-height);
  bottom: 0;
  left: 0;
  z-index: 90;
  width: var(--sidebar-width);
  overflow-y: auto;
  padding: 28px 18px 22px;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.sidebar-intro {
  margin-bottom: 24px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  background: var(--accent-soft);
}

.sidebar-intro-kicker,
.nav-title,
.source-kicker {
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}

.sidebar-intro-kicker {
  color: var(--accent-strong);
}

.sidebar-intro p {
  margin-top: 8px;
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.55;
}

.nav-group {
  display: grid;
  gap: 4px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-soft);
}

.nav-group:last-child {
  border-bottom: 0;
}

.nav-title {
  margin: 0 12px 9px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--control-size);
  padding: 0 12px;
  border-radius: 9px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  transition: background 180ms ease, color 180ms ease;
}

.nav-item:hover {
  background: var(--bg-soft);
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  fill: currentColor;
}

.nav-item.active svg {
  color: var(--accent);
}

.nav-item .cat-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: var(--cat-color, var(--accent));
}

.nav-item.is-empty {
  opacity: 0.72;
}

.cat-expand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  margin-top: 4px;
  padding: 8px 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-small);
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.cat-expand svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  transition: transform 160ms ease;
}

.cat-expand.is-open svg {
  transform: rotate(90deg);
}

.cat-expand:hover {
  border-color: var(--accent);
  background: var(--accent-soft, #eaf3ef);
  color: var(--accent-strong, var(--accent));
}

.cat-list-extra {
  display: flex;
  flex-direction: column;
  margin-top: 2px;
}

.cat-list-extra[hidden] {
  display: none !important;
}

.nav-count {
  margin-left: auto;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  margin-left: auto;
  padding: 0 7px;
  border-radius: var(--radius-pill);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
}

.source-card {
  display: block;
  margin-top: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  background: var(--bg-soft);
}

.source-kicker {
  margin-bottom: 10px;
}

.sidebar-account {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 0;
  border-radius: var(--radius-small);
}

.sidebar-account:hover {
  background: var(--bg-secondary);
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #efb14e, #dd5b8e 62%, #4c6ec7);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
}

.avatar.sm {
  width: 22px;
  height: 22px;
  flex-basis: 22px;
  font-size: 8px;
}

.sidebar-account-name {
  display: block;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.sidebar-account-handle {
  display: block;
  margin-top: 3px;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
}

.sidebar-footer {
  padding: 0 12px;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  line-height: 1.7;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 89;
  background: rgba(30, 35, 38, 0.42);
}

/* Page shell */
main {
  min-height: calc(100vh - var(--header-height));
  margin-top: var(--header-height);
  margin-left: var(--sidebar-width);
  padding: 38px 36px 60px;
}

.page-head {
  max-width: 1080px;
  margin: 0 auto 24px;
  text-align: left;
}

.page-head.feed-head {
  max-width: 1080px;
}

.search-head {
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--accent-strong);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.eyebrow-line {
  width: 20px;
  height: 1px;
  background: var(--accent);
}

.page-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: var(--text-primary);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.65px;
  line-height: 1.16;
}

.feed-head .page-title {
  display: block;
  font-size: 36px;
  letter-spacing: -1px;
}

.page-title .cat-bar {
  width: 7px;
  height: 42px;
  flex: 0 0 7px;
  border-radius: var(--radius-pill);
  background: var(--cat-color, var(--accent));
}

.page-sub {
  max-width: 720px;
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
}

.breadcrumbs {
  margin-bottom: 16px;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
}

.breadcrumbs a:hover {
  color: var(--accent-strong);
}

.feed-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1080px;
  margin: 0 auto 14px;
}

.feed-summary h2 {
  color: var(--text-primary);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.25px;
}

.feed-summary span,
.result-count {
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
}

.result-count strong {
  color: var(--text-primary);
  font-weight: 700;
}

.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1080px;
  margin: 0 auto 28px;
}

.filter-row.results-toolbar {
  margin-top: 30px;
  margin-bottom: 18px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.chips-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  min-width: 0;
  padding-bottom: 3px;
  scrollbar-width: none;
  scroll-behavior: smooth;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.chip:hover {
  border-color: var(--line-strong);
  background: var(--bg-secondary);
}

.chip.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.chip.active[data-color] {
  border-color: var(--cat-color);
  background: var(--cat-color);
}

.chips-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--control-size);
  height: var(--control-size);
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transform: translateY(-50%);
}

.chips-nav.prev {
  left: -8px;
}

.chips-nav.next {
  right: -8px;
}

.chips-nav svg {
  width: 18px;
  height: 18px;
  fill: var(--text-primary);
}

.chips-wrap.at-start .chips-nav.prev,
.chips-wrap.at-end .chips-nav.next {
  display: none;
}

.sort-select {
  min-height: var(--control-size);
  padding: 0 34px 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  outline: none;
  background: var(--surface);
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
}

.sort-select:hover {
  border-color: var(--accent);
}

/* Video cards */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 40px 20px;
  max-width: 1080px;
  margin: 0 auto;
}

.video-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  cursor: pointer;
  text-align: left;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.video-card:hover {
  transform: translateY(-4px);
}

.video-card:focus-visible {
  border-radius: var(--radius-card);
}

.thumbnail-wrap {
  position: relative;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--thumb-bg);
}

.thumbnail-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 350ms ease;
}

.video-card:hover .thumbnail-wrap img {
  transform: scale(1.035);
}

.meta-overlay {
  position: absolute;
  right: 9px;
  bottom: 9px;
  left: 9px;
  display: flex;
  justify-content: flex-end;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.duration-badge {
  padding: 4px 6px;
  border-radius: 5px;
  background: rgba(20, 28, 28, 0.82);
  font-variant-numeric: tabular-nums;
}

.play-veil {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 12px;
  background: linear-gradient(to bottom, transparent 54%, rgba(16, 26, 25, 0.48));
  opacity: 0;
  transition: opacity 180ms ease;
}

.video-card:hover .play-veil,
.video-card:focus-visible .play-veil {
  opacity: 1;
}

.play-veil svg {
  width: 44px;
  height: 44px;
  padding: 12px;
  border-radius: 50%;
  background: var(--accent);
  fill: #fff;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.25));
}

.save-btn {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--control-size);
  height: var(--control-size);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: rgba(20, 28, 28, 0.62);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: background 180ms ease, transform 180ms ease, opacity 160ms ease;
}

.thumbnail-wrap:hover .save-btn,
.video-card:hover .save-btn,
.video-card:focus-within .save-btn,
.save-btn:focus-visible {
  opacity: 1;
  pointer-events: auto;
}

@media (hover: none) {
  .thumbnail-wrap:active .save-btn,
  .save-btn.is-saved {
    opacity: 1;
    pointer-events: auto;
  }
}

.save-btn:hover {
  background: var(--accent);
  transform: scale(1.04);
}

.save-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
}

.save-btn.is-saved {
  background: var(--accent);
}

.save-btn.is-saved svg {
  fill: currentColor;
}

.video-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 2px;
}

.topic-tag {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 5px;
  min-height: 20px;
  margin-top: 0;
  color: var(--cat-color, var(--accent));
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 1.3;
  text-transform: uppercase;
}

.topic-tag:hover {
  text-decoration: underline;
}

.topic-tag .sep {
  opacity: 0.48;
  font-weight: 500;
}

.video-title {
  min-height: 42px;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.38;
}

.author-line {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 24px;
  margin-top: 7px;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
}

.timestamp {
  margin-left: auto;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
}

/* Search result cards */
.match-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.match-badge {
  padding: 4px 6px;
  border: 1px solid var(--match-border);
  border-radius: 5px;
  background: var(--match-bg);
  color: var(--accent-strong);
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
}

.snippet {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 10px;
  padding: 9px 10px;
  border-left: 3px solid var(--cat-color, var(--accent));
  border-radius: 0 var(--radius-small) var(--radius-small) 0;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  line-height: 1.48;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

/* ── Іздеу нәтижелері (тізім) ───────────────────────────── */
.search-head .page-title {
  font-size: 28px;
}

.search-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 1080px;
  margin: 0 auto;
}

.search-hit {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 24px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface, #fff);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.search-hit:hover,
.search-hit:focus-visible {
  border-color: color-mix(in srgb, var(--cat-color, var(--accent)) 35%, var(--border));
  box-shadow: 0 10px 28px rgba(30, 35, 38, 0.07);
  transform: translateY(-1px);
  outline: none;
}

.search-hit-thumb {
  position: relative;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 12px;
  background: var(--thumb-bg);
}

.search-hit-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-hit-thumb .duration-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 1;
  color: #fff;
}

.search-hit-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 26, 25, 0.22);
  opacity: 0;
  transition: opacity 160ms ease;
}

.search-hit:hover .search-hit-play {
  opacity: 1;
}

.search-hit-play svg {
  width: 40px;
  height: 40px;
  padding: 11px;
  border-radius: 50%;
  background: var(--accent);
  fill: #fff;
}

.search-hit-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 4px 4px 4px 0;
}

.search-hit-title {
  margin: 0;
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.35px;
  line-height: 1.35;
}

.search-hit-title mark,
.search-hit-snippet mark,
.video-title mark,
.suggest-title mark {
  padding: 0 2px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--accent) 22%, var(--surface));
  color: inherit;
  font-weight: 700;
}

.search-hit-snippet {
  margin: 2px 0 0;
  padding: 12px 14px;
  border-left: 3px solid var(--cat-color, var(--accent));
  border-radius: 0 10px 10px 0;
  background: var(--bg-secondary, #f7f5ef);
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.55;
}

.search-hit-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
}

.search-hit-meta .dot {
  opacity: 0.5;
}

.save-btn.inline {
  position: static;
  width: 36px;
  height: 36px;
  margin-left: auto;
  border: 1px solid var(--border);
  background: var(--surface, #fff);
  color: var(--text-secondary);
  opacity: 1;
}

.save-btn.inline:hover,
.save-btn.inline.is-saved {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  transform: none;
}

/* Empty states */
.empty {
  max-width: 520px;
  margin: 0 auto;
  padding: 72px 24px;
  text-align: center;
}

.empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 92px;
  height: 92px;
  margin: 0 auto 24px;
  border: 1px solid var(--empty-icon-border);
  border-radius: 50%;
  background: var(--empty-icon-bg);
  color: var(--accent);
}

.empty-icon svg {
  width: 42px;
  height: 42px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.empty h3 {
  margin-bottom: 10px;
  color: var(--text-primary);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.empty p {
  max-width: 420px;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
}

.empty-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 28px;
  padding: 0 20px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-medium);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 600;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.empty-action:hover {
  border-color: var(--accent-strong);
  background: #e2f0ec;
  transform: translateY(-1px);
}

.empty-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 30px;
}

/* Player modal */
.player {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(13, 17, 20, 0.95);
  backdrop-filter: blur(6px);
}

.player-dialog {
  display: grid;
  grid-template-columns: minmax(0, 44%) minmax(0, 56%);
  width: 100%;
  max-width: 1000px;
  height: min(85vh, 780px);
  overflow: hidden;
  border-radius: var(--radius-large);
  background: var(--surface);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.46);
}

.player-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  aspect-ratio: 9 / 16;
  background: #080b0d;
}

.player-stage video {
  display: block;
  width: 100%;
  height: 100%;
  background: #080b0d;
  object-fit: contain;
}

.player-stage::after {
  position: absolute;
  inset: 48% 0 0;
  z-index: 1;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.88));
  content: '';
  pointer-events: none;
}

.unmute-pill {
  position: absolute;
  bottom: 64px;
  left: 50%;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--control-size);
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  transform: translateX(-50%);
}

.tap-play {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  background: rgba(8, 12, 14, 0.45);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.tap-play[hidden] {
  display: none !important;
}

.tap-play svg {
  width: 64px;
  height: 64px;
  padding: 16px;
  border-radius: 50%;
  background: var(--accent);
  fill: #fff;
}

.unmute-pill svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.not-found {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: #101617;
  color: #fff;
  text-align: center;
  flex-direction: column;
}

.not-found-code {
  color: #e5f3ef;
  font-size: 68px;
  font-weight: 700;
  letter-spacing: -2px;
  line-height: 1;
}

.not-found h3 {
  margin: 14px 0 8px;
  font-size: 17px;
}

.not-found p {
  max-width: 260px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  line-height: 1.55;
}

.not-found .btn-ghost {
  margin-top: 18px;
}

.player-side {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
}

.player-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 76px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

.player-side-head > span:last-child {
  min-width: 0;
}

.player-side-body {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 24px;
}

.player-kicker {
  margin-bottom: 8px;
  color: var(--accent);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
}

.player-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: var(--cat-color, var(--accent));
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.tag-pill.outline {
  border: 1px solid currentColor;
  background: transparent;
  color: var(--cat-color, var(--accent));
}

.player-title {
  margin-bottom: 12px;
  color: var(--text-primary);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.45px;
  line-height: 1.18;
}

.player-desc {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.8;
}

.player-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
}

.player-excerpt {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.player-excerpt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.player-excerpt-source {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.player-excerpt blockquote {
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.7;
}

.player-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.btn:hover {
  border-color: var(--line-strong);
  background: var(--bg-secondary);
}

.btn:first-child {
  flex: 1 1 auto;
}

.btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.btn.is-saved svg {
  fill: currentColor;
}

.btn.primary,
.btn.save {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.btn.primary:hover,
.btn.save:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: var(--radius-small);
  background: transparent;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
}

.player-close,
.player-nav {
  position: fixed;
  z-index: 310;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--control-size);
  height: var(--control-size);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: #242b2f;
  color: #fff;
}

.player-close:hover,
.player-nav:hover {
  background: #303a3f;
}

.player-close {
  top: 24px;
  right: 28px;
}

.player-nav.prev {
  top: 50%;
  left: 28px;
  transform: translateY(-50%);
}

.player-nav.next {
  top: 50%;
  right: 28px;
  transform: translateY(-50%);
}

.player-close svg,
.player-nav svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 400;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  background: var(--toast-bg);
  color: var(--toast-fg);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-pop);
  transform: translateX(-50%);
}

/* Scrollbars and responsive */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border-radius: var(--radius-pill);
  background: rgba(30, 35, 38, 0.16);
}

@media (max-width: 1080px) {
  header {
    gap: 16px;
    padding: 0 20px;
  }

  .search-container {
    max-width: 590px;
  }

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

@media (max-width: 900px) {
  .menu-toggle {
    display: flex;
  }

  nav.sidebar {
    width: min(300px, 84vw);
    box-shadow: 16px 0 34px rgba(30, 35, 38, 0.12);
    transform: translateX(-104%);
    transition: transform 220ms ease;
  }

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

  main {
    margin-left: 0;
  }

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

  .player {
    padding: 16px;
  }

  .player-dialog {
    grid-template-columns: 1fr;
    width: min(460px, 100%);
    height: auto;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .player-stage {
    width: 100%;
    max-height: 60vh;
  }

  .player-side {
    max-height: none;
    overflow: visible;
  }

  .player-side-body {
    overflow: visible;
    flex: none;
  }

  .player-nav {
    display: none;
  }
}

@media (max-width: 720px) {
  :root {
    --header-height: 68px;
  }

  header {
    gap: 10px;
    height: 68px;
    padding: 0 12px;
  }

  .logo {
    font-size: 20px;
  }

  .search-container {
    flex-basis: auto;
    min-width: 0;
  }

  .search-trust {
    display: none;
  }

  .search-bar {
    height: 44px;
    padding-left: 42px;
    padding-right: 48px;
    font-size: 13px;
  }

  .search-leading {
    left: 12px;
  }

  .search-btn,
  .search-clear {
    top: 0;
    width: 44px;
    height: 44px;
  }

  .search-clear {
    right: 44px;
  }

  .search-btn {
    right: 0;
  }

  main {
    padding: 28px 14px 48px;
  }

  .page-head,
  .filter-row,
  .feed-summary,
  .video-grid {
    max-width: none;
  }

  .feed-head .page-title {
    font-size: 29px;
  }

  .filter-row,
  .filter-row.results-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .chips-wrap {
    width: 100%;
  }

  .chips-nav {
    display: none;
  }

  .sort-select {
    align-self: flex-end;
  }

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

  .search-list,
  .search-head {
    max-width: none;
  }

  /* Dropdown: на всю ширину до клавиатуры + затемнение фона */
  .suggest-backdrop {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    z-index: 190;
    background: rgba(8, 12, 14, 0.58);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
  }

  body.suggest-open {
    overflow: hidden;
  }

  body.suggest-open main {
    pointer-events: none;
  }

  .suggest {
    position: fixed;
    top: var(--header-height, 68px);
    left: 0;
    right: 0;
    z-index: 200;
    max-height: none;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    box-shadow: none;
    background: var(--surface);
  }

  .suggest-list {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
  }

  .suggest-item {
    align-items: center;
    gap: 14px;
    min-height: 76px;
    padding: 14px 16px;
  }

  .suggest-thumb {
    width: 52px;
    height: 78px;
    flex: 0 0 52px;
    margin-top: 0;
    border-radius: 8px;
  }

  .suggest-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    text-overflow: unset;
  }

  .suggest-meta {
    margin-top: 4px;
    font-size: 12px;
  }

  .suggest-snippet {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.45;
    -webkit-line-clamp: 2;
  }

  .suggest-empty {
    padding: 22px 16px;
    font-size: 14px;
  }

  .suggest-footer {
    min-height: 52px;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 600;
  }

  .suggest-item::after {
    font-size: 26px;
  }

  /* Полный список результатов поиска */
  .search-hit {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 16px;
    padding: 14px;
    border-radius: 14px;
  }

  .search-hit-play {
    opacity: 1;
  }

  .search-hit-play svg {
    width: 36px;
    height: 36px;
    padding: 9px;
  }

  .search-hit-title {
    font-size: 17px;
    letter-spacing: -0.2px;
    line-height: 1.3;
  }

  .search-hit-snippet {
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.5;
  }

  .search-hit-meta {
    font-size: 12px;
    gap: 6px;
    flex-wrap: wrap;
  }

  .search-hit-body {
    gap: 6px;
    padding: 0;
    justify-content: flex-start;
  }

  .video-title {
    min-height: 48px;
    font-size: 14px;
  }

  .author-line,
  .timestamp {
    font-size: 10px;
  }

  .player {
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }

  .player-dialog {
    width: 100%;
    height: auto;
    min-height: 100%;
    max-height: none;
    border-radius: 0;
    overflow: visible;
    grid-template-columns: 1fr;
  }

  .player-stage {
    width: 100%;
    max-height: 56vh;
    flex-shrink: 0;
  }

  .player-side {
    max-height: none;
    overflow: visible;
  }

  .player-side-body {
    overflow: visible;
    flex: none;
    padding: 18px 16px 24px;
  }

  .player-side-head {
    min-height: 68px;
    padding: 14px 16px;
  }

  .player-title {
    font-size: 21px;
  }

  .player-actions {
    padding: 12px 14px;
  }

  .player-close {
    top: 12px;
    right: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* —— Telegram Mini App —— */
html.tg-webapp {
  --tg-safe-top: 0px;
  --tg-safe-bottom: 0px;
  --tg-safe-left: 0px;
  --tg-safe-right: 0px;
  --app-safe-top: 0px;
}

html.tg-webapp,
body.tg-webapp {
  min-height: var(--tg-viewport-stable-height, 100dvh);
  overflow-x: clip;
}

body.tg-webapp header {
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  box-sizing: border-box;
  padding-left: max(12px, var(--tg-safe-left));
  padding-right: max(12px, var(--tg-safe-right));
  z-index: 120;
  gap: 8px;
}

body.tg-webapp .logo {
  font-size: 17px;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.tg-webapp .search-container {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  margin: 0;
}

body.tg-webapp .theme-toggle,
body.tg-webapp .menu-toggle {
  display: inline-flex !important;
  flex: 0 0 var(--control-size);
  position: relative;
  z-index: 2;
  visibility: visible !important;
  opacity: 1 !important;
}

body.tg-webapp .theme-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

body.tg-webapp .theme-icon[hidden] {
  display: none !important;
}

body.tg-webapp nav.sidebar {
  top: var(--header-height);
  padding-left: max(0px, var(--tg-safe-left));
}

body.tg-webapp main {
  margin-top: var(--header-height);
  min-height: calc(var(--tg-viewport-stable-height, 100dvh) - var(--header-height));
  padding-bottom: calc(48px + var(--tg-safe-bottom));
  padding-left: max(0px, var(--tg-safe-left));
  padding-right: max(0px, var(--tg-safe-right));
}

body.tg-webapp .sidebar-overlay {
  top: var(--header-height);
}

body.tg-webapp .player {
  padding-top: 0;
  top: 0;
  bottom: 0;
  height: var(--tg-viewport-stable-height, 100dvh);
  max-height: var(--tg-viewport-stable-height, 100dvh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

body.tg-webapp .player-dialog {
  height: auto;
  min-height: 100%;
  max-height: none;
  overflow: visible;
}

body.tg-webapp .player-side,
body.tg-webapp .player-side-body {
  max-height: none;
  overflow: visible;
}

body.tg-webapp .player-close {
  top: 12px;
  right: max(12px, var(--tg-safe-right));
}

body.tg-webapp .suggest {
  top: var(--header-height, 68px);
}

