body.is-pwa,
body.is-app-shell,
body.is-android-app {
    width: 100%;
    max-width: none;
    margin: 0;
    padding-left: 0;
    padding-right: 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ── PWA/Android: компактный верхний ритм ── */
:root {
    --pwa-header-top-gap: 4px;
    --pwa-header-content-gap: 6px;
    --app-shell-bottom-reserve: calc(74px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
}

.is-pwa #siteHeader.ui-header,
.is-app-shell #siteHeader.ui-header,
.is-android-app #siteHeader.ui-header {
    margin-top: var(--pwa-header-top-gap);
    margin-bottom: var(--pwa-header-content-gap);
}

/* Первые рабочие экраны начинаются сразу после общего зазора хедера. */
html.is-pwa .create-page-shell,
html.is-pwa .history-page-shell,
html.is-pwa .profile-dashboard,
html.is-pwa .public-music-page,
html.is-app-shell .create-page-shell,
html.is-app-shell .history-page-shell,
html.is-app-shell .profile-dashboard,
html.is-app-shell .public-music-page,
html.is-android-app .create-page-shell,
html.is-android-app .history-page-shell,
html.is-android-app .profile-dashboard,
html.is-android-app .public-music-page {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* В app-shell действие «Студия» уже находится в нижней навигации. */
.is-pwa #siteHeader .ui-header__studio-cta,
.is-app-shell #siteHeader .ui-header__studio-cta,
.is-android-app #siteHeader .ui-header__studio-cta {
    display: none !important;
}

/* Освободившееся место в app-shell используем для быстрого доступа к балансу. */
.is-pwa #siteHeader .ui-header__credits,
.is-app-shell #siteHeader .ui-header__credits,
.is-android-app #siteHeader .ui-header__credits {
    display: inline-flex !important;
    min-height: 40px;
    padding-inline: 9px;
}

/* ── PWA/Android: компактные карточки (.ui-card, .ui-form-box) ── */
.is-pwa .ui-card,
.is-app-shell .ui-card,
.is-android-app .ui-card {
    padding: 12px 10px;
    border-radius: var(--radius-lg);
}

.is-pwa .ui-form-box,
.is-pwa .ui-box,
.is-app-shell .ui-form-box,
.is-app-shell .ui-box,
.is-android-app .ui-form-box,
.is-android-app .ui-box {
    padding: 10px 10px;
    border-radius: var(--radius-lg);
}

/* ── PWA/Android: hero-баннер (guide, landing) ── */
.is-pwa .ui-hero-banner,
.is-app-shell .ui-hero-banner,
.is-android-app .ui-hero-banner {
    padding: 14px 10px;
    gap: 10px;
}

/* ── PWA/Android: reading-doc (privacy, terms) ── */
.is-pwa .ui-reading-doc,
.is-app-shell .ui-reading-doc,
.is-android-app .ui-reading-doc {
    padding: 14px 10px 24px;
    margin: 0 auto 16px;
}

/* ── PWA/Android: section stack gap ── */
.is-pwa .guide-stack,
.is-app-shell .guide-stack,
.is-android-app .guide-stack {
    gap: 14px;
}

html.is-pwa body,
html.is-app-shell body,
html.is-android-app body {
    width: 100%;
    max-width: none;
    margin: 0;
    padding-left: 0;
    padding-right: 0;
}

body.is-pwa::-webkit-scrollbar,
body.is-app-shell::-webkit-scrollbar,
body.is-android-app::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.is-pwa .container,
.is-pwa .admin-sidebar,
.is-pwa .modal-body,
.is-pwa .mobile-notifications-list,
.is-app-shell .container,
.is-app-shell .admin-sidebar,
.is-app-shell .modal-body,
.is-app-shell .mobile-notifications-list,
.is-android-app .container,
.is-android-app .admin-sidebar,
.is-android-app .modal-body,
.is-android-app .mobile-notifications-list {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.is-pwa .container::-webkit-scrollbar,
.is-pwa .admin-sidebar::-webkit-scrollbar,
.is-pwa .modal-body::-webkit-scrollbar,
.is-pwa .mobile-notifications-list::-webkit-scrollbar,
.is-app-shell .container::-webkit-scrollbar,
.is-app-shell .admin-sidebar::-webkit-scrollbar,
.is-app-shell .modal-body::-webkit-scrollbar,
.is-app-shell .mobile-notifications-list::-webkit-scrollbar,
.is-android-app .container::-webkit-scrollbar,
.is-android-app .admin-sidebar::-webkit-scrollbar,
.is-android-app .modal-body::-webkit-scrollbar,
.is-android-app .mobile-notifications-list::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

body.is-pwa .tg-bonus-banner,
body.is-app-shell .tg-bonus-banner,
body.is-android-app .tg-bonus-banner {
    padding: 10px 12px;
    border-radius: var(--radius-md);
    margin-top: 12px;
    margin-bottom: 12px;
}

body.is-pwa .tg-bonus-content,
body.is-app-shell .tg-bonus-content,
body.is-android-app .tg-bonus-content {
    gap: 8px;
}

body.is-pwa .tg-bonus-icon svg,
body.is-app-shell .tg-bonus-icon svg,
body.is-android-app .tg-bonus-icon svg {
    width: 24px;
    height: 24px;
}

body.is-pwa .tg-bonus-text h3,
body.is-app-shell .tg-bonus-text h3,
body.is-android-app .tg-bonus-text h3 {
    font-size: 0.88rem;
    line-height: 1.15;
    margin-bottom: 2px;
}

body.is-pwa .tg-bonus-text p,
body.is-app-shell .tg-bonus-text p,
body.is-android-app .tg-bonus-text p {
    font-size: 0.78rem;
    line-height: 1.28;
}

body.is-pwa .tg-bonus-btn,
body.is-app-shell .tg-bonus-btn,
body.is-android-app .tg-bonus-btn,
body.is-pwa .tg-bonus-btn-profile,
body.is-app-shell .tg-bonus-btn-profile,
body.is-android-app .tg-bonus-btn-profile {
    min-height: 36px;
    padding: 8px 10px;
    font-size: 0.8rem;
    border-radius: var(--ds-radius-sm);
}

body.is-pwa .bonus-section,
body.is-app-shell .bonus-section,
body.is-android-app .bonus-section {
    padding: 10px;
    margin-bottom: 20px;
    border-radius: var(--ds-radius-sm);
}

.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-modal-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-base);
  height: calc(60px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
  padding-bottom: var(--safe-bottom, env(safe-area-inset-bottom, 0px));
  z-index: var(--z-bottom-nav);
  justify-content: space-around;
  align-items: center;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--color-text-subtle);
  text-decoration: none;
  font-size: 10px;
  gap: 4px;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  tap-highlight-color: transparent;
  user-select: none;
}

.bottom-nav-item:focus,
.bottom-nav-item:focus-visible,
.bottom-nav-item:active {
  outline: none;
  box-shadow: none;
}

.bottom-nav-item.active {
  color: var(--color-premium-gold);
}

.bottom-nav-item svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.is-pwa .bottom-nav,
.is-app-shell .bottom-nav,
.is-android-app .bottom-nav {
  display: flex;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  margin-bottom: 0;
}


.is-pwa .index-history-section,
.is-pwa .tasks-section,
.is-pwa footer,
.is-app-shell .index-history-section,
.is-app-shell .tasks-section,
.is-app-shell footer,
.is-android-app .index-history-section,
.is-android-app .tasks-section,
.is-android-app footer {
  display: none !important;
}

.is-pwa .landing-final-cta__referral,
.is-app-shell .landing-final-cta__referral,
.is-android-app .landing-final-cta__referral {
  display: none !important;
}

.is-pwa .hero-section--enhanced,
.is-app-shell .hero-section--enhanced,
.is-android-app .hero-section--enhanced {
  width: 100vw;
  max-width: none;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding-left: 0;
  padding-right: 0;
}

.is-pwa .landing-hero-v2__content,
.is-app-shell .landing-hero-v2__content,
.is-android-app .landing-hero-v2__content {
  grid-template-columns: minmax(0, 1fr);
  padding-left: 0;
  padding-right: 0;
}

.is-pwa .landing-hero-studio-card,
.is-app-shell .landing-hero-studio-card,
.is-android-app .landing-hero-studio-card {
  width: 100%;
  min-width: 0;
}

.is-pwa .landing-prompt-shell__footer,
.is-app-shell .landing-prompt-shell__footer,
.is-android-app .landing-prompt-shell__footer {
  flex-direction: column;
  align-items: stretch;
}

.is-pwa .landing-mode-group,
.is-app-shell .landing-mode-group,
.is-android-app .landing-mode-group,
.is-pwa .landing-gradient-btn,
.is-app-shell .landing-gradient-btn,
.is-android-app .landing-gradient-btn {
  width: 100%;
}

.is-pwa .pwa-navigation,
.is-app-shell .pwa-navigation,
.is-android-app .pwa-navigation {
  display: block !important;
}


body.is-pwa,
body.is-app-shell,
.is-android-app {
  padding-left: 0;
  padding-right: 0;
}


.is-pwa .container,
.is-android-app .container,
.is-app-shell .container {
  padding-top: 0;
  padding-left: max(8px, var(--safe-left, env(safe-area-inset-left, 0px)));
  padding-right: max(8px, var(--safe-right, env(safe-area-inset-right, 0px)));
  padding-bottom: var(--app-shell-bottom-reserve);
}

.is-android-app #yandex_rtb_R-A-17939695-1,
.is-app-shell #yandex_rtb_R-A-17939695-1,
.is-android-app .cookie-banner-visible,
.is-app-shell .cookie-banner-visible {
  display: none !important;
}

body.is-pwa textarea,
body.is-app-shell textarea,
body.is-android-app textarea,
body.is-pwa input,
body.is-app-shell input,
body.is-android-app input,
body.is-pwa select,
body.is-app-shell select,
body.is-android-app select {
  overscroll-behavior-y: auto;
}

/* Отступ справа — под кнопку очистки. Нижний резервировался под ручку
   изменения размера: её больше нет, а 38 пикселей пустоты под каждым полем
   оставались. У поля стиля это была почти половина высоты. */
body.is-pwa textarea,
body.is-app-shell textarea,
body.is-android-app textarea {
   padding-right: 44px;
}

body.is-pwa .tg-bonus-banner,
body.is-app-shell .tg-bonus-banner,
body.is-android-app .tg-bonus-banner {
    padding: 8px 10px 8px 10px;
    border-radius: var(--ds-radius-sm);
    margin: 10px 0;
}

body.is-pwa .tg-bonus-content,
body.is-app-shell .tg-bonus-content,
body.is-android-app .tg-bonus-content {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
        "icon text"
        "actions actions";
    column-gap: 8px;
    row-gap: 8px;
    align-items: flex-start;
}

body.is-pwa .tg-bonus-icon,
body.is-app-shell .tg-bonus-icon,
body.is-android-app .tg-bonus-icon { grid-area: icon; }

body.is-pwa .tg-bonus-text,
body.is-app-shell .tg-bonus-text,
body.is-android-app .tg-bonus-text {
    grid-area: text;
    min-width: 0;
}

body.is-pwa .tg-bonus-actions,
body.is-app-shell .tg-bonus-actions,
body.is-android-app .tg-bonus-actions { grid-area: actions; }

body.is-pwa .tg-bonus-icon svg,
body.is-app-shell .tg-bonus-icon svg,
body.is-android-app .tg-bonus-icon svg {
    width: 20px;
    height: 20px;
}

body.is-pwa .tg-bonus-text h3,
body.is-app-shell .tg-bonus-text h3,
body.is-android-app .tg-bonus-text h3 {
    font-size: 0.8rem;
    line-height: 1.1;
    margin-bottom: 2px;
}

body.is-pwa .tg-bonus-text p,
body.is-app-shell .tg-bonus-text p,
body.is-android-app .tg-bonus-text p {
    font-size: 0.7rem;
    line-height: 1.18;
    word-break: normal;
    overflow-wrap: break-word;
}

body.is-pwa .tg-bonus-btn,
body.is-app-shell .tg-bonus-btn,
body.is-android-app .tg-bonus-btn {
    padding: 6px 8px;
    font-size: 0.72rem;
    min-height: 30px;
    width: auto;
    min-width: 140px;
}

body.is-pwa .tg-bonus-actions,
body.is-app-shell .tg-bonus-actions,
body.is-android-app .tg-bonus-actions {
    width: 100%;
    display: flex;
    justify-content: center;
    align-self: stretch;
    margin-top: 4px;
    padding-right: 0;
}

body.is-pwa .tg-bonus-btn-wrapper,
body.is-app-shell .tg-bonus-btn-wrapper,
body.is-android-app .tg-bonus-btn-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
}

body.is-pwa .tg-bonus-qr-popup,
body.is-app-shell .tg-bonus-qr-popup,
body.is-android-app .tg-bonus-qr-popup,
body.is-pwa #tgBonusQrProfile,
body.is-app-shell #tgBonusQrProfile,
body.is-android-app #tgBonusQrProfile {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* =========================================================
   PWA & Mobile Touch Feedback (Active States)
   ========================================================= */
body.is-pwa .btn,
body.is-app-shell .btn,
body.is-android-app .btn,
body.is-pwa .tab,
body.is-app-shell .tab,
body.is-android-app .tab,
body.is-pwa .mobile-menu-link,
body.is-app-shell .mobile-menu-link,
body.is-android-app .mobile-menu-link,
body.is-pwa .ui-mobile-drawer__link,
body.is-app-shell .ui-mobile-drawer__link,
body.is-android-app .ui-mobile-drawer__link,
body.is-pwa .history-tab,
body.is-app-shell .history-tab,
body.is-android-app .history-tab,
body.is-pwa .profile-chip,
body.is-app-shell .profile-chip,
body.is-android-app .profile-chip,
body.is-pwa .global-audio-player__icon-btn,
body.is-app-shell .global-audio-player__icon-btn,
body.is-android-app .global-audio-player__icon-btn,
body.is-pwa .global-audio-player__toggle,
body.is-app-shell .global-audio-player__toggle,
body.is-android-app .global-audio-player__toggle {
    transition: transform 0.15s cubic-bezier(0.2, 0, 0, 1), opacity 0.15s ease, background-color 0.15s ease !important;
}

body.is-pwa .btn:active,
body.is-app-shell .btn:active,
body.is-android-app .btn:active,
body.is-pwa .tab:active,
body.is-app-shell .tab:active,
body.is-android-app .tab:active,
body.is-pwa .mobile-menu-link:active,
body.is-app-shell .mobile-menu-link:active,
body.is-android-app .mobile-menu-link:active,
body.is-pwa .ui-mobile-drawer__link:active,
body.is-app-shell .ui-mobile-drawer__link:active,
body.is-android-app .ui-mobile-drawer__link:active,
body.is-pwa .history-tab:active,
body.is-app-shell .history-tab:active,
body.is-android-app .history-tab:active,
body.is-pwa .profile-chip:active,
body.is-app-shell .profile-chip:active,
body.is-android-app .profile-chip:active,
body.is-pwa .global-audio-player__icon-btn:active,
body.is-app-shell .global-audio-player__icon-btn:active,
body.is-android-app .global-audio-player__icon-btn:active,
body.is-pwa .global-audio-player__toggle:active,
body.is-app-shell .global-audio-player__toggle:active,
body.is-android-app .global-audio-player__toggle:active {
    transform: scale(0.96) !important;
    opacity: 0.85;
}

body.is-pwa .bottom-nav-item,
body.is-app-shell .bottom-nav-item,
body.is-android-app .bottom-nav-item {
    transition: transform 0.15s cubic-bezier(0.2, 0, 0, 1), opacity 0.15s ease !important;
}

body.is-pwa .bottom-nav-item:active,
body.is-app-shell .bottom-nav-item:active,
body.is-android-app .bottom-nav-item:active {
    transform: scale(0.9) !important;
    opacity: 0.7;
}

body.is-pwa .history-task,
body.is-app-shell .history-task,
body.is-android-app .history-task,
body.is-pwa .public-track-card,
body.is-app-shell .public-track-card,
body.is-android-app .public-track-card,
body.is-pwa .voice-source-card,
body.is-app-shell .voice-source-card,
body.is-android-app .voice-source-card {
    transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.2s ease !important;
}

body.is-pwa .history-task:active,
body.is-app-shell .history-task:active,
body.is-android-app .history-task:active,
body.is-pwa .public-track-card:active,
body.is-app-shell .public-track-card:active,
body.is-android-app .public-track-card:active,
body.is-pwa .voice-source-card:active,
body.is-app-shell .voice-source-card:active,
body.is-android-app .voice-source-card:active {
    transform: scale(0.985) !important;
}

/* Fix for Virtual Keyboard overlapping bottom nav */
body.keyboard-open .bottom-nav {
    display: none !important;
}
body.keyboard-open .container {
    padding-bottom: 24px !important;
}

.history-workspace__list {
    gap: 10px!important;;
}
