/* ═══════════════════════════════════════════════════════════════════════════
   Дизайн как в мобильном приложении «Сериал Детство»:
   стеклянная «пилюля» снизу, мини-плеер над ней и полноэкранный плеер.
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  --au-bg: #111214;
  --au-card: #1b1d21;
  --au-surface: #24272c;
  --au-border: rgba(255,255,255,.12);
  --au-accent: #4385ff;
  --au-accent2: #7aa8ff;
  --au-txt: #e8e9ed;
  --au-txt2: rgba(255,255,255,.62);
  --au-txt3: rgba(255,255,255,.36);
  --au-glass-bg: rgba(26,27,31,.68);
  --au-glass-hi: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.04) 55%, rgba(255,255,255,.02));
  --au-glass-edge: rgba(255,255,255,.2);
  --au-nav-h: 50px;
  --au-nav-gap: 8px;
  --au-spring: cubic-bezier(.34, 1.32, .5, 1);
}
body.theme-light {
  --au-card: #ffffff;
  --au-surface: #eceef2;
  --au-border: rgba(10,14,22,.1);
  --au-txt: #12141a;
  --au-txt2: rgba(10,14,22,.62);
  --au-txt3: rgba(10,14,22,.4);
  --au-glass-bg: rgba(255,255,255,.62);
  --au-glass-hi: linear-gradient(180deg, rgba(255,255,255,.7), rgba(255,255,255,.25));
  --au-glass-edge: rgba(10,14,22,.1);
}

/* Общая «жидкое стекло» подложка */
.au-glass {
  background: var(--au-glass-hi), var(--au-glass-bg);
  -webkit-backdrop-filter: blur(26px) saturate(1.6);
  backdrop-filter: blur(26px) saturate(1.6);
  border: 1px solid var(--au-glass-edge);
  box-shadow: 0 10px 34px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.12);
}

/* ─── Нижняя панель-«пилюля» (телефон) ─────────────────────────────────────── */
@media (max-width: 700px) {
  body.studio-home #page-tabs.page-tabs {
    position: fixed !important;
    top: auto !important;
    left: max(36px, calc(50% - 170px)) !important;
    right: max(36px, calc(50% - 170px)) !important;
    bottom: calc(var(--au-nav-gap) + env(safe-area-inset-bottom)) !important;
    width: auto !important;
    height: var(--au-nav-h) !important;
    padding: 3px !important;
    gap: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    border-radius: 999px !important;
    background: var(--au-glass-hi), var(--au-glass-bg) !important;
    -webkit-backdrop-filter: blur(26px) saturate(1.6) !important;
    backdrop-filter: blur(26px) saturate(1.6) !important;
    border: 1px solid var(--au-glass-edge) !important;
    box-shadow: 0 12px 36px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.14) !important;
    z-index: 300 !important;
    transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .25s;
  }
  body.studio-home #page-tabs.page-tabs::before { display: none !important; }

  /* Светлый стеклянный овал, который переезжает к выбранной вкладке */
  #page-tabs .au-pill {
    position: absolute;
    top: 3px; bottom: 3px; left: 3px;
    width: calc((100% - 6px) / var(--au-tabs, 4));
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,.10));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.3), inset 0 0 0 1px rgba(255,255,255,.08);
    transform: translateX(calc(100% * var(--au-idx, 0)));
    transition: transform .45s var(--au-spring);
    pointer-events: none;
    z-index: 0;
  }
  body.theme-light #page-tabs .au-pill {
    background: linear-gradient(180deg, rgba(67,133,255,.20), rgba(67,133,255,.12));
    box-shadow: inset 0 0 0 1px rgba(67,133,255,.18);
  }

  body.studio-home #page-tabs .page-tab-btn {
    position: relative; z-index: 1;
    flex: 1 1 0 !important;
    height: auto !important; min-height: 0 !important;
    display: flex !important; flex-direction: column !important;
    align-items: center !important; justify-content: center !important;
    gap: 1px !important; padding: 0 !important;
    border: 0 !important; border-radius: 999px !important;
    background: transparent !important; box-shadow: none !important;
    color: rgba(255,255,255,.7) !important;
    font-size: 9px !important; font-weight: 500 !important;
    -webkit-tap-highlight-color: transparent;
    transition: color .25s;
  }
  body.studio-home #page-tabs .page-tab-btn.active {
    background: transparent !important;
    color: #fff !important;
    font-weight: 700 !important;
  }
  body.studio-home #page-tabs .page-tab-btn .tab-txt { color: inherit !important; font-weight: inherit !important; line-height: 1.15; }
  body.studio-home #page-tabs .page-tab-btn .tab-ico {
    width: 19px !important; height: 19px !important; color: inherit !important;
    transition: transform .35s var(--au-spring), color .25s;
  }
  body.studio-home #page-tabs .page-tab-btn .tab-ico svg { width: 19px; height: 19px; }
  body.studio-home #page-tabs .page-tab-btn.active .tab-ico { color: var(--au-accent2) !important; transform: scale(1.08); }
  body.studio-home #page-tabs .page-tab-btn:active .tab-ico { transform: scale(.88); }
  body.studio-home #page-tabs .page-tab-btn.active .tab-ico svg { stroke-width: 2; }
  body.theme-light.studio-home #page-tabs .page-tab-btn { color: rgba(10,14,22,.55) !important; }
  body.theme-light.studio-home #page-tabs .page-tab-btn.active { color: #12141a !important; }
  body.theme-light.studio-home #page-tabs .page-tab-btn.active .tab-ico { color: var(--au-accent) !important; }

  /* Чтобы последние карточки не прятались под панелью */
  body.studio-home #app { padding-bottom: calc(var(--au-nav-h) + var(--au-nav-gap) + 24px + env(safe-area-inset-bottom)) !important; }
  body.studio-home.au-has-music #app { padding-bottom: calc(var(--au-nav-h) + var(--au-nav-gap) + 92px + env(safe-area-inset-bottom)) !important; }

  /* Пуш-баннер и прочее, что стояло над старой панелью */
  body.studio-home .push-banner { bottom: calc(var(--au-nav-h) + var(--au-nav-gap) + 12px + env(safe-area-inset-bottom)) !important; }
}

/* ─── Мини-плеер ───────────────────────────────────────────────────────────── */
.au-mini {
  position: fixed;
  z-index: 299;
  height: 60px;
  border-radius: 18px;
  display: flex; align-items: center;
  padding: 0 4px 0 8px;
  cursor: pointer;
  overflow: hidden;
  touch-action: pan-x;
  -webkit-tap-highlight-color: transparent;
  transform: translateY(24px); opacity: 0; pointer-events: none;
  transition: transform .38s cubic-bezier(.2,.8,.2,1), opacity .28s;
}
.au-mini.show { transform: translateY(0); opacity: 1; pointer-events: auto; }
.au-mini.dragging { transition: none; }
@media (max-width: 700px) {
  .au-mini { left: 16px; right: 16px; bottom: calc(var(--au-nav-h) + var(--au-nav-gap) + 8px + env(safe-area-inset-bottom)); }
  body.au-page-chat .au-mini { display: none; }
}
@media (min-width: 701px) {
  .au-mini { left: calc(218px + 32px); right: 32px; bottom: 20px; max-width: 760px; margin: 0 auto; height: 68px; padding: 0 10px 0 10px; }
  body.studio-home.au-has-music #app { padding-bottom: 110px; }
  body.au-page-chat .au-mini { display: none; }
}
@media (min-width: 701px) and (max-width: 1100px) { .au-mini { left: calc(170px + 24px); right: 24px; } }

.au-cover {
  position: relative; flex: none; overflow: hidden;
  background: var(--au-surface);
}
.au-cover img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.34); /* превью 16:9 с чёрными полосами — приближаем в квадрате */
}
.au-cover .au-note { position: absolute; inset: 0; display: grid; place-items: center; color: var(--au-txt3); }
.au-mini .au-cover { width: 44px; height: 44px; border-radius: 10px; }
@media (min-width: 701px) { .au-mini .au-cover { width: 48px; height: 48px; } }

.au-mini-txt { flex: 1; min-width: 0; padding: 0 10px; }
.au-mini-title, .au-mini-artist { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.au-mini-title { color: var(--au-txt); font-size: 14px; font-weight: 600; line-height: 1.3; }
.au-mini-artist { color: var(--au-txt3); font-size: 12px; margin-top: 1px; }
.au-mini-progress { position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; background: rgba(255,255,255,.18); border-radius: 2px; overflow: hidden; }
.au-mini-progress i { display: block; height: 100%; width: 0; background: var(--au-accent); }

.au-btn {
  flex: none; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: transparent; color: var(--au-txt);
  cursor: pointer; padding: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background .2s, transform .15s, color .2s;
}
.au-btn:hover { background: rgba(255,255,255,.08); }
.au-btn:active { transform: scale(.9); }
.au-btn svg { width: 25px; height: 25px; fill: currentColor; }
.au-btn.on { color: var(--au-accent); }
.au-btn.dim { color: var(--au-txt2); }

/* Ползунок громкости и время — только на компьютере */
.au-mini-desk { display: none; align-items: center; gap: 10px; margin-right: 6px; }
@media (min-width: 900px) { .au-mini-desk { display: flex; } }
.au-mini-time { color: var(--au-txt3); font-size: 12px; font-variant-numeric: tabular-nums; min-width: 86px; text-align: right; }
.au-vol { width: 90px; accent-color: var(--au-accent); cursor: pointer; }

body.wo-mini .au-mini { display: none !important; }

/* ─── Полноэкранный плеер ──────────────────────────────────────────────────── */
.au-full {
  position: fixed; inset: 0; z-index: 1200;
  background: var(--au-bg);
  display: flex; flex-direction: column;
  transform: translateY(100%);
  visibility: hidden;
  transition: transform .34s cubic-bezier(.2,.8,.2,1), visibility 0s linear .34s;
  touch-action: pan-x;
  overflow: hidden;
}
.au-full.show { transform: translateY(0); visibility: visible; transition: transform .34s cubic-bezier(.2,.8,.2,1), visibility 0s; }
.au-full.dragging { transition: none; }
.au-full-bg { position: absolute; inset: -60px; background-size: cover; background-position: center; filter: blur(70px) saturate(1.3); opacity: .75; transform: scale(1.1); }
.au-full-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(17,18,20,.6), rgba(17,18,20,.95) 55%, #111214); }
.au-full-in {
  position: relative; flex: 1; display: flex; flex-direction: column; align-items: center;
  width: 100%; max-width: 440px; margin: 0 auto;
  padding: calc(6px + env(safe-area-inset-top)) 26px calc(16px + env(safe-area-inset-bottom));
}
.au-full-top { width: 100%; display: flex; align-items: center; }
.au-full-top .au-full-label { flex: 1; text-align: center; color: var(--au-txt2); font-size: 13px; font-weight: 600; }
.au-full .au-btn { color: #e8e9ed; }
.au-full .au-btn.dim { color: rgba(255,255,255,.62); }
.au-full .au-btn.on { color: var(--au-accent); }
.au-full-sp1 { flex: .6; min-height: 12px; }
.au-full-sp2 { flex: .5; min-height: 12px; }
.au-full-sp3 { flex: .4; min-height: 8px; }
.au-full .au-cover {
  width: 100%; aspect-ratio: 1; border-radius: 22px;
  box-shadow: 0 24px 60px rgba(0,0,0,.55);
  max-height: 46vh; max-width: 46vh;
}
.au-full-title { width: 100%; color: #fff; font-size: 22px; font-weight: 800; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.au-full-artist { width: 100%; color: var(--au-accent2); font-size: 15px; font-weight: 500; margin-top: 4px; }

.au-seek { position: relative; width: 100%; height: 28px; margin-top: 18px; cursor: pointer; touch-action: none; }
.au-seek-track { position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 4px; background: rgba(255,255,255,.2); transition: height .15s, margin .15s; }
.au-seek-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 4px; background: #fff; }
.au-seek-knob { position: absolute; top: 50%; left: 0; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #fff; transition: width .15s, height .15s, margin .15s; }
.au-seek.drag .au-seek-track { height: 6px; margin-top: -3px; }
.au-seek.drag .au-seek-knob { width: 18px; height: 18px; margin: -9px 0 0 -9px; }
.au-times { width: 100%; display: flex; justify-content: space-between; color: rgba(255,255,255,.36); font-size: 12px; font-variant-numeric: tabular-nums; }

.au-ctrls { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 14px 0 10px; }
.au-ctrls .au-btn.s46 { width: 46px; height: 46px; }
.au-ctrls .au-btn.s46 svg { width: 26px; height: 26px; }
.au-ctrls .au-btn.s56 { width: 56px; height: 56px; }
.au-ctrls .au-btn.s56 svg { width: 32px; height: 32px; }
.au-play-big {
  width: 74px; height: 74px; border-radius: 50%; border: 0; cursor: pointer;
  background: #fff; color: #111214; display: grid; place-items: center;
  box-shadow: 0 8px 26px rgba(0,0,0,.35);
  transition: transform .15s;
  -webkit-tap-highlight-color: transparent;
}
.au-play-big:active { transform: scale(.92); }
.au-play-big svg { width: 42px; height: 42px; fill: currentColor; }
.au-spin { width: 32px; height: 32px; border-radius: 50%; border: 3px solid rgba(17,18,20,.25); border-top-color: #111214; animation: au-spin .8s linear infinite; }
@keyframes au-spin { to { transform: rotate(360deg); } }

/* ─── Список треков как в приложении ───────────────────────────────────────── */
#tracks-grid.au-track-list { display: block !important; max-width: 860px; border-top: 0 !important; padding-top: 6px; }
.au-track .ep-share-btn { width: 38px !important; height: 38px !important; padding: 0 !important; margin: 0 !important; border-radius: 50% !important; display: grid !important; place-items: center; background: transparent !important; color: var(--au-txt3) !important; }
.au-track .ep-share-btn:hover { background: rgba(255,255,255,.08) !important; color: var(--au-txt) !important; }
.au-track {
  display: flex; align-items: center;
  padding: 9px 6px 9px 10px; margin: 0 -10px;
  border-radius: 14px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .2s;
}
.au-track:hover { background: rgba(255,255,255,.04); }
.au-track.cur { background: rgba(67,133,255,.10); }
.au-track-n { width: 26px; flex: none; text-align: center; color: var(--au-txt3); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.au-track-n svg { width: 18px; height: 18px; fill: var(--au-accent); vertical-align: middle; }
.au-track .au-cover { width: 54px; height: 54px; border-radius: 10px; margin-left: 8px; }
.au-track-txt { flex: 1; min-width: 0; padding: 0 12px; }
.au-track-title { color: var(--au-txt); font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.au-track.cur .au-track-title { color: var(--au-accent2); }
body.theme-light .au-track.cur .au-track-title { color: var(--au-accent); }
.au-track-sub { color: var(--au-txt3); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.au-track .ep-share-btn { flex: none; }

/* Эквалайзер у играющего трека */
.au-eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.au-eq i { width: 3px; background: var(--au-accent); border-radius: 1px; animation: au-eq 1s ease-in-out infinite; }
.au-eq i:nth-child(2) { animation-delay: -.4s; }
.au-eq i:nth-child(3) { animation-delay: -.7s; }
@keyframes au-eq { 0%,100% { height: 4px; } 50% { height: 14px; } }

@media (prefers-reduced-motion: reduce) {
  #page-tabs .au-pill, .au-mini, .au-full { transition-duration: .01s !important; }
  .au-eq i { animation: none; height: 10px; }
}

/* ─── Серия: свёрнутая стеклянная полоска (как в приложении) ───────────────── */
.wo-bar { display: none; }
body .watch-overlay.mini {
  inset: auto !important;
  left: 16px !important; right: 16px !important;
  bottom: calc(var(--au-nav-h) + var(--au-nav-gap) + 8px + env(safe-area-inset-bottom)) !important;
  top: auto !important;
  width: auto !important; height: 64px !important; aspect-ratio: auto !important;
  border-radius: 18px !important;
  overflow: hidden;
  background: var(--au-glass-hi), var(--au-glass-bg) !important;
  -webkit-backdrop-filter: blur(26px) saturate(1.6);
  backdrop-filter: blur(26px) saturate(1.6);
  border: 1px solid var(--au-glass-edge) !important;
  box-shadow: 0 10px 34px rgba(0,0,0,.45) !important;
  z-index: 310 !important;
}
@media (min-width: 701px) {
  body .watch-overlay.mini { left: auto !important; right: 28px !important; bottom: 20px !important; width: 440px !important; }
}
body .watch-overlay.mini iframe {
  position: absolute; left: 0; top: 0;
  width: 114px !important; height: 64px !important;
  pointer-events: none;
  background: #000;
}
body .watch-overlay.mini .watch-frame-loading,
body .watch-overlay.mini .watch-collapse-btn { display: none !important; }
body .watch-overlay.mini .wo-bar {
  display: flex; align-items: center;
  position: absolute; inset: 0;
  padding: 0 4px 0 114px;
  cursor: pointer; touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
.wo-txt { flex: 1; min-width: 0; padding: 0 10px; }
.wo-title, .wo-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wo-title { color: var(--au-txt); font-size: 14px; font-weight: 600; line-height: 1.3; }
.wo-sub { color: var(--au-txt3); font-size: 12px; margin-top: 1px; }
.wo-btn {
  flex: none; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; padding: 0;
  border: 0; background: transparent; color: var(--au-txt); cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: background .2s, transform .15s;
}
.wo-btn:hover { background: rgba(255,255,255,.08); }
.wo-btn:active { transform: scale(.9); }
.wo-close { color: var(--au-txt2); }
.wo-progress { position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; background: rgba(255,255,255,.18); border-radius: 2px; overflow: hidden; }
.wo-progress i { display: block; height: 100%; width: 0; background: var(--au-accent); }
body.au-page-chat .watch-overlay.mini { bottom: calc(var(--au-nav-h) + var(--au-nav-gap) + 70px + env(safe-area-inset-bottom)) !important; }
@media (min-width: 701px) { body.au-page-chat .watch-overlay.mini { bottom: 90px !important; } }

/* ─── Компактная шапка (как в приложении) ──────────────────────────────────── */
body.studio .header-inner { height: 60px !important; gap: 10px !important; }
@media (max-width: 700px) { body.studio .header-inner { height: 52px !important; padding: 0 14px !important; } }
body.studio .logo { font-size: 18px !important; gap: 8px !important; }
body.studio .logo .logo-ico, body.studio .logo-ico svg { width: 24px !important; height: 24px !important; }
body.studio .brand-caption { display: none !important; }
body.studio .header-nav { gap: 8px !important; align-items: center; }
/* Иконочные кнопки — круглые и одинаковые */
body.studio .header-nav .btn-app-download,
body.studio .header-nav #btn-settings {
  width: 36px !important; height: 36px !important; min-height: 0 !important;
  padding: 0 !important; border-radius: 50% !important;
  display: grid !important; place-items: center !important;
}
body.studio .header-nav .btn-app-download svg, body.studio .header-nav #btn-settings svg { width: 18px; height: 18px; }
body.studio .studio-app-label { display: none !important; }
/* Админка и настройки — в профиле; шестерёнка в шапке только для гостей */
body.studio #btn-admin-access { display: none !important; }
body.au-logged.studio .header-nav #btn-settings { display: none !important; }
/* Вход: короткая кнопка; профиль: только аватарка */
body.studio #btn-open-auth {
  min-height: 0 !important; height: 36px; padding: 0 16px !important;
  border-radius: 999px !important; font-size: 13px !important; font-weight: 600;
  background: var(--au-accent) !important; color: #fff !important; border: 0 !important;
}
body.studio .user-avatar-btn {
  padding: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important;
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
}
body.studio .user-avatar-btn > span:not(.user-avatar-img) { display: none !important; }
body.studio .user-avatar-btn img, body.studio .user-avatar-btn .user-avatar-img {
  width: 34px !important; height: 34px !important; border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255,255,255,.12);
}
body.studio .user-avatar-btn:hover img, body.studio .user-avatar-btn:hover .user-avatar-img { box-shadow: 0 0 0 2px var(--au-accent); }

/* Пункты меню в окне профиля */
.au-prof-menu { margin: 18px 0 4px; border-radius: 14px; overflow: hidden; border: 1px solid var(--au-border); }
.au-prof-item {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 13px 14px; border: 0; background: transparent; color: var(--au-txt);
  font: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer;
}
.au-prof-item + .au-prof-item { border-top: 1px solid var(--au-border); }
.au-prof-item:hover { background: rgba(255,255,255,.05); }
.au-prof-item svg { width: 20px; height: 20px; flex: none; color: var(--au-accent2); }
.au-prof-item .au-chev { margin-left: auto; color: var(--au-txt3); }

/* ─── Чат как в приложении ─────────────────────────────────────────────────── */
body.studio #chat-section { display: flex; flex-direction: column; }
body.studio #chat-section[style*="display: none"] { display: none !important; }
@media (min-width: 701px) { body.studio .chat-section { height: calc(100dvh - 60px) !important; } }
@media (max-width: 700px) {
  body.studio.au-page-chat #chat-section {
    position: fixed; left: 0; right: 0;
    top: calc(52px + var(--au-vv-top, 0px));
    height: calc(var(--au-vvh, 100dvh) - 52px - var(--au-nav-h) - var(--au-nav-gap) - 6px - env(safe-area-inset-bottom)) !important;
    z-index: 50;
  }
  body.studio.au-page-chat.au-kbd #chat-section { height: calc(var(--au-vvh, 100dvh) - 52px) !important; }
  body.studio.au-page-chat #app { padding-bottom: 0 !important; }
}
/* Клавиатура открыта — нижняя панель уезжает вниз */
@media (max-width: 700px) {
  body.au-kbd #page-tabs.page-tabs { transform: translateY(calc(100% + 30px)) !important; opacity: 0; pointer-events: none; }
  body.au-kbd .au-mini, body.au-kbd .watch-overlay.mini { opacity: 0 !important; pointer-events: none !important; }
}

/* Шапка: «Чат» + статус под ним, голосовой чат — кнопкой справа */
body.studio .chat-topbar {
  height: auto !important; min-height: 0; flex: none;
  padding: 10px 16px 10px 20px !important;
  display: grid !important; grid-template-columns: 1fr auto; grid-template-rows: auto auto; align-items: center;
  border-bottom: 0 !important; background: var(--au-bg) !important;
}
body.theme-light.studio .chat-topbar { background: transparent !important; }
body.studio .chat-topbar-title { grid-column: 1; grid-row: 1; font-size: 30px !important; font-weight: 800 !important; letter-spacing: -.6px; line-height: 1.1; color: var(--au-txt); }
body.studio .chat-topbar .online-badge {
  grid-column: 1; grid-row: 2; justify-self: start;
  background: none !important; border: 0 !important; padding: 0 !important; margin-top: 2px;
  color: var(--au-txt3) !important; font-size: 13px !important; font-weight: 500;
}
body.studio .chat-topbar .online-dot { width: 7px; height: 7px; background: #2ecc71; box-shadow: none; }
body.studio .chat-topbar .voice-bar { grid-column: 2; grid-row: 1 / 3; border: 0 !important; background: none !important; padding: 0 !important; }
body.studio .chat-topbar .voice-start-btn {
  width: auto !important; padding: 0 14px !important; height: 38px; border-radius: 999px !important;
  background: var(--au-surface) !important; color: var(--au-txt) !important;
  font-size: 13px !important; font-weight: 600; gap: 6px; border: 0 !important;
}
body.studio .chat-topbar .voice-start-btn.live { background: #2ecc71 !important; color: #fff !important; }
body.studio .chat-topbar .voice-return-bar { position: static; }

/* Сообщения */
body.studio .chat-messages { padding: 8px 10px 10px !important; gap: 0 !important; background: var(--au-bg) !important; }
body.theme-light.studio .chat-messages { background: transparent !important; }
body.studio .chat-msg-wrap { gap: 6px !important; margin: 0 !important; margin-top: 2px !important; max-width: 86%; align-items: flex-end !important; }
body.studio .chat-msg-wrap.au-first { margin-top: 8px !important; }
body.studio .chat-msg-wrap .chat-avatar { width: 34px; height: 34px; }
body.studio .chat-msg-wrap.their:not(.au-last) .chat-avatar { visibility: hidden; }
body.studio .chat-msg-wrap.their:not(.au-first) .chat-sender { display: none; }
body.studio .chat-bubble {
  border: 0 !important; box-shadow: none !important;
  padding: 7px 12px 6px !important;
  border-radius: 18px !important;
  background: var(--au-surface) !important; color: var(--au-txt) !important;
}
body.studio .chat-msg-wrap.their .chat-bubble { border-bottom-left-radius: 6px !important; }
body.studio .chat-msg-wrap.their:not(.au-first) .chat-bubble { border-top-left-radius: 6px !important; }
body.studio .chat-msg-wrap.my .chat-bubble { background: var(--au-accent) !important; color: #fff !important; border-bottom-right-radius: 6px !important; }
body.studio .chat-msg-wrap.my:not(.au-first) .chat-bubble { border-top-right-radius: 6px !important; }
body.studio .chat-msg-wrap.my .chat-text, body.studio .chat-msg-wrap.my .chat-text a { color: #fff !important; }
body.studio .chat-msg-wrap.my .chat-time { color: rgba(255,255,255,.72) !important; }
body.studio .chat-text { font-size: 15px !important; line-height: 1.35 !important; }
body.studio .chat-sender { font-size: 13px !important; font-weight: 700 !important; margin-bottom: 1px; color: var(--au-name, var(--au-accent2)) !important; }
body.studio .chat-time { font-size: 10px !important; color: var(--au-txt3) !important; margin-top: 2px !important; text-align: right; }

/* Поле ввода — «пилюля», без кнопки кружочков */
body.studio #chat-mode-toggle-btn { display: none !important; }
body.studio .chat-input-bar { flex: none; padding: 8px 10px !important; border-top: 0 !important; background: var(--au-bg) !important; }
body.theme-light.studio .chat-input-bar { background: transparent !important; }
body.studio .chat-input-wrap { gap: 8px !important; align-items: flex-end !important; }
body.studio .chat-textarea {
  border-radius: 22px !important; min-height: 44px; padding: 11px 16px !important;
  background: var(--au-surface) !important; border: 1px solid transparent !important;
  color: var(--au-txt) !important; font-size: 15px !important; line-height: 1.35;
}
body.studio .chat-textarea:focus { border-color: rgba(67,133,255,.5) !important; outline: none; }
body.studio .chat-send-btn, body.studio .chat-record-btn {
  width: 44px !important; height: 44px !important; min-width: 44px; border-radius: 50% !important;
  background: var(--au-accent) !important; color: #fff !important; box-shadow: none !important; border: 0 !important;
}
body.studio .chat-login-prompt { background: none !important; padding: 0 !important; }
body.studio .chat-login-prompt > span { display: none; }
body.studio #btn-chat-login {
  width: 100%; height: 48px; border-radius: 14px !important; padding: 0 !important;
  font-size: 15px !important; font-weight: 700; justify-content: center;
}

/* ─── Окно «Мой профиль» — компактная шторка снизу, крестик всегда виден ──── */
body.studio #profile-modal .modal {
  position: relative;
  max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain;
  padding: 18px 18px 20px !important;
}
body.studio #profile-modal .modal-close {
  position: sticky !important; top: 0; float: right; z-index: 3;
  width: 36px; height: 36px; margin: -4px -4px 0 8px; border-radius: 50%;
  display: grid; place-items: center; font-size: 22px; line-height: 1;
  background: var(--au-surface) !important; color: var(--au-txt) !important; border: 0;
}
body.studio #profile-modal .studio-overline, body.studio #profile-modal .studio-profile-sub { display: none; }
body.studio #profile-modal .studio-profile-title { font-size: 22px !important; margin: 4px 0 12px !important; }
body.studio #profile-modal .profile-avatar-wrap { padding: 10px !important; margin-bottom: 12px !important; gap: 12px; clear: both; }
body.studio #profile-modal .profile-avatar-circle { width: 60px !important; height: 60px !important; }
body.studio #profile-modal .profile-avatar-circle img,
body.studio #profile-modal .profile-avatar-circle .user-avatar-img { width: 60px !important; height: 60px !important; font-size: 22px; }
body.studio #profile-modal .form-group { margin-bottom: 8px !important; }
body.studio #profile-modal .form-input { padding: 10px 12px !important; font-size: 15px !important; }
body.studio #profile-modal .btn { padding: 10px !important; margin-top: 8px !important; }
body.studio #profile-modal .au-prof-menu { margin: 12px 0 0; }
body.studio #profile-modal .danger-zone { margin-top: 10px !important; padding-top: 10px !important; }
body.studio #profile-modal .profile-birthday-row label { margin: 8px 0 4px !important; font-size: 13px; }
@media (max-width: 700px) {
  body.studio #profile-modal.open { align-items: flex-end !important; padding: 0 !important; }
  body.studio #profile-modal .modal {
    width: 100% !important; max-width: none !important; margin: 0 !important;
    border-radius: 22px 22px 0 0 !important; border-bottom: 0 !important;
    max-height: 88dvh; padding-bottom: calc(18px + env(safe-area-inset-bottom)) !important;
    animation: au-sheet-up .32s cubic-bezier(.2,.8,.2,1) !important;
  }
  body.studio #profile-modal .modal::before {
    content: ''; display: block; width: 38px; height: 4px; border-radius: 2px;
    background: rgba(255,255,255,.22); margin: -8px auto 8px;
  }
}
@keyframes au-sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* Чужой профиль тоже влезает в экран */
.pp-card { max-height: calc(100dvh - 24px); overflow-y: auto; }
.pp-close { z-index: 3; }
