:root {
  --tt-bg-deepest: #1e1f22;
  --tt-bg-dark: #2b2d31;
  --tt-bg-medium: #313338;
  --tt-bg-light: #383a40;
  --tt-text: #dbdee1;
  --tt-muted: #949ba4;
  --tt-brand: #5865f2;
  --tt-brand-hover: #4752c4;
  --tt-brand-muted: rgba(88, 101, 242, 0.15);
  --tt-success: #23a559;
  --tt-danger: #f23f43;
  --tt-firefly-core: #b8f070;
  --tt-firefly-glow-1: rgba(255, 236, 140, 0.75);
  --tt-firefly-glow-2: rgba(168, 224, 99, 0.22);
  --tt-mini-glow-a: rgba(212, 252, 121, 0.95);
  --tt-mini-glow-b: rgba(255, 236, 140, 0.78);
  --tt-mini-glow-c: rgba(140, 220, 60, 0.42);
  --tt-sidebar-w: 240px;
  --tt-header-h: 48px;
  --tt-mobile-nav-h: 56px;
  --tt-composer-bar-h: 68px;
  --tt-mini-player-overhang: 130px;
  --tt-font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

/* 隐藏滚动条，保留触摸/滚轮滚动 */
body.tt-body,
body.tt-body * {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body.tt-body::-webkit-scrollbar,
body.tt-body *::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
  background: transparent;
}

.tt-body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--tt-bg-deepest);
  color: var(--tt-text);
  font-family: var(--tt-font);
}

.tt-app {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tt-header {
  height: var(--tt-header-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--tt-bg-deepest);
  border-bottom: 1px solid #111214;
}

.tt-logo { font-weight: 700; color: #fff; }
.tt-room-title { color: var(--tt-muted); font-size: 14px; margin-left: 8px; }
.tt-header__status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--tt-muted); margin-left: auto; }
.tt-firefly {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #5c5f66;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.tt-firefly::before,
.tt-firefly::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.tt-firefly::before {
  inset: -4px;
  background: radial-gradient(circle, var(--tt-firefly-glow-1) 0%, var(--tt-firefly-glow-2) 45%, transparent 72%);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.3s ease;
}

.tt-firefly::after {
  inset: -1px;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.9) 0%, transparent 55%);
  opacity: 0;
}

.tt-firefly.is-online {
  background: var(--tt-firefly-core);
  box-shadow:
    0 0 4px var(--tt-firefly-core),
    0 0 10px color-mix(in srgb, var(--tt-firefly-core) 55%, transparent),
    0 0 18px color-mix(in srgb, var(--tt-firefly-core) 25%, transparent);
  animation: tt-firefly-flicker 3.6s ease-in-out infinite;
}

.tt-firefly.is-online::before {
  opacity: 1;
  animation: tt-firefly-glow 2.8s ease-in-out infinite;
}

.tt-firefly.is-online::after {
  opacity: 0.85;
}

.tt-firefly.is-offline {
  background: #5c5f66;
  box-shadow: none;
  animation: none;
}

.tt-firefly--header { width: 11px; height: 11px; }

.tt-firefly--avatar {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border: 2px solid var(--tt-bg-dark);
  z-index: 1;
}

@keyframes tt-firefly-glow {
  0%, 100% { transform: scale(0.9); opacity: 0.45; }
  50% { transform: scale(1.35); opacity: 0.95; }
}

@keyframes tt-firefly-flicker {
  0%, 100% { opacity: 1; filter: brightness(1); }
  42% { opacity: 0.92; filter: brightness(0.95); }
  44% { opacity: 1; filter: brightness(1.15); }
  46% { opacity: 0.78; filter: brightness(0.85); }
  48% { opacity: 1; filter: brightness(1.05); }
  72% { opacity: 0.96; filter: brightness(0.98); }
  74% { opacity: 1; filter: brightness(1.12); }
}
.tt-header__member a,
.tt-header__member .link-btn { color: var(--tt-muted); text-decoration: none; margin-left: 12px; font-size: 13px; }
.tt-header__member .link-btn { background: none; border: none; cursor: pointer; font: inherit; padding: 0; }
.tt-header__member .link-btn:hover { color: var(--tt-brand); text-decoration: underline; }

.tt-body-grid {
  flex: 1;
  display: grid;
  grid-template-columns: var(--tt-sidebar-w) 1fr var(--tt-sidebar-w);
  min-height: 0;
  overflow: hidden;
}

.tt-sidebar, .tt-members {
  background: var(--tt-bg-dark);
  padding: 16px;
  border-right: 1px solid #111214;
  min-height: 0;
  overflow-y: auto;
}

.tt-members { border-right: 0; border-left: 1px solid #111214; }

.tt-panel { margin-bottom: 20px; }
.tt-panel__title { margin: 0 0 12px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--tt-muted); }

.tt-chat {
  display: flex;
  flex-direction: column;
  background: var(--tt-bg-medium);
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.tt-mood-list { display: grid; gap: 8px; margin-bottom: 12px; }

.tt-mood {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--tt-text);
  cursor: pointer;
  text-align: left;
}

.tt-mood:hover { background: var(--tt-bg-light); }
.tt-mood.is-active { background: #404249; border-color: var(--tt-brand); }

.tt-btn {
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  color: #fff;
  background: var(--tt-bg-light);
}

.tt-btn--primary { background: var(--tt-brand); }
.tt-btn--primary:hover { background: var(--tt-brand-hover); }
.tt-btn--secondary { background: var(--tt-bg-light); color: var(--tt-text); }
.tt-btn--secondary:hover { background: color-mix(in srgb, var(--tt-brand) 18%, var(--tt-bg-light)); }
.tt-btn--ghost { background: transparent; border: 1px solid var(--tt-bg-light); color: var(--tt-text); }
.tt-btn--danger { background: var(--tt-danger); }
.tt-btn--block { width: 100%; margin-top: 8px; }
.tt-btn--sm { padding: 4px 10px; font-size: 12px; margin-top: 0; }

.tt-invite__hint { font-size: 12px; margin: 0 0 10px; line-height: 1.5; }
.tt-invite__login-hint { font-size: 12px; margin: 0 0 8px; color: var(--tt-brand); }
.tt-invite-join { margin-top: 10px; }
.tt-invite-join__input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--tt-bg-light);
  background: var(--tt-bg-dark);
  color: var(--tt-text);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tt-invite-code {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--tt-brand) 10%, var(--tt-bg-dark));
  border: 1px solid var(--tt-bg-light);
}
.tt-invite-code[hidden] { display: none !important; }
.tt-invite-code__label { font-size: 11px; color: var(--tt-muted); width: 100%; }
.tt-invite-code__value {
  flex: 1;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--tt-brand);
}
.tt-btn:disabled { opacity: .45; cursor: not-allowed; }

.tt-activity {
  border-bottom: 1px solid #111214;
  background: var(--tt-bg-dark);
  padding: 0;
  flex-shrink: 0;
}

.tt-activity[hidden] { display: none !important; }

.tt-activity__shell {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.tt-activity__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 10px 16px 8px;
}

.tt-activity__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.tt-activity__meta strong {
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tt-activity__meta span {
  font-size: 12px;
  color: var(--tt-muted);
}

.tt-activity__player {
  padding: 0 12px 12px;
  width: 100%;
  min-width: 0;
}

.tt-activity__mini { width: 100%; min-height: 64px; }
.tt-activity__mini.pmp-root[data-mode="listen"],
[data-activity-mini-host].pmp-root[data-mode="listen"] {
  min-height: 132px;
  background: var(--tt-bg-medium);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.tt-activity__mini.pmp-root[data-mode="compact"],
[data-activity-mini-host].pmp-root[data-mode="compact"] {
  background: var(--tt-bg-medium);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}

body.tt-body .pmp-root[data-mode="bar"] {
  z-index: 9600;
  --pmp-accent: var(--tt-brand);
  --pmp-accent-hover: var(--tt-brand-hover);
}

body.tt-body.has-pmp-bar {
  padding-bottom: calc(var(--pmp-bar-h) + env(safe-area-inset-bottom, 0px));
}

body.tt-body .pmp-dock {
  z-index: 9600;
}

@media (max-width: 1023px) {
  body.tt-body.has-pmp-bar .pmp-root[data-mode="bar"] {
    bottom: calc(var(--tt-mobile-nav-h) + env(safe-area-inset-bottom, 0px));
  }

  body.tt-body.has-pmp-bar {
    padding-bottom: calc(var(--pmp-bar-h) + var(--tt-mobile-nav-h) + env(safe-area-inset-bottom, 0px));
  }

  body.tt-body .pmp-dock {
    left: 12px;
    right: 12px;
    bottom: calc(var(--tt-mobile-nav-h) + env(safe-area-inset-bottom, 0px) + 12px);
    max-width: none;
  }

  .tt-activity__header {
    padding: 10px 12px 6px;
  }

  .tt-activity__player {
    padding: 0 8px 10px;
  }
}
.tt-activity__player audio, .tt-activity__player video { width: 100%; max-height: 120px; }
.tt-activity__header .tt-activity__controls { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.tt-activity__controls[hidden] { display: none !important; }
.tt-activity__controls--request .tt-btn { font-size: 12px; }

.tt-embed {
  margin-top: 6px;
  border-left: 4px solid var(--tt-brand);
  background: var(--tt-bg-dark);
  border-radius: 4px;
  padding: 12px;
  max-width: 420px;
}

.tt-embed__title { font-weight: 600; margin-bottom: 4px; }
.tt-embed__tags { font-size: 12px; color: var(--tt-muted); margin-bottom: 10px; }
.tt-embed__status { font-size: 12px; color: var(--tt-muted); margin-bottom: 8px; }
.tt-embed__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.tt-modal {
  border: none;
  padding: 0;
  background: transparent;
  max-width: 480px;
  width: calc(100% - 32px);
}

.tt-modal::backdrop { background: rgba(0,0,0,.55); }
.tt-modal__panel {
  margin: 0;
  border: none;
  background: var(--tt-bg-dark);
  color: var(--tt-text);
  border-radius: 8px;
  width: 100%;
}
.tt-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.tt-modal__header h3 { margin: 0; font-size: 16px; }
.tt-modal__close { background: none; border: none; color: var(--tt-muted); font-size: 24px; cursor: pointer; }
.tt-modal__filter { padding: 0 16px 8px; }
.tt-modal__search {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--tt-bg-light);
  background: var(--tt-bg-medium);
  color: var(--tt-text);
}
.tt-modal__body { padding: 12px 16px 16px; max-height: 360px; overflow-y: auto; }

.tt-composer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px;
  background: var(--tt-bg-light);
  align-items: stretch;
  position: relative;
  flex-shrink: 0;
  z-index: 9500;
}

.tt-chat--composer-pinned .tt-composer,
.tt-chat:has(.tt-composer:not([hidden])) .tt-composer {
  position: fixed;
  left: var(--tt-sidebar-w);
  right: var(--tt-sidebar-w);
  bottom: 0;
}

.tt-composer__row {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.tt-composer__player-dock {
  position: absolute;
  right: 16px;
  bottom: calc(100% + 10px);
  width: 200px;
  height: 120px;
  z-index: 9600;
  pointer-events: auto;
  border-radius: 12px;
  overflow: visible;
  isolation: isolate;
}

.tt-composer__player-dock[hidden] {
  display: none !important;
}

.tt-composer__player-dock::before,
.tt-composer__player-dock::after {
  content: '';
  position: absolute;
  pointer-events: none;
}

/* 外层柔光晕 — 慢速呼吸 */
.tt-composer__player-dock::before {
  top: -12px;
  right: -12px;
  bottom: -12px;
  left: -12px;
  border-radius: 22px;
  background: radial-gradient(
    ellipse 88% 76% at 50% 54%,
    rgba(255, 236, 140, 0.38) 0%,
    rgba(180, 240, 90, 0.2) 36%,
    rgba(140, 220, 60, 0.07) 58%,
    transparent 76%
  );
  filter: blur(7px);
  opacity: 0.7;
  transform: scale(0.96);
  animation: tt-mini-halo-breathe 3.4s ease-in-out infinite;
  z-index: 0;
  will-change: transform, opacity;
}

/* 边缘渐变描边 — 流光 + 萤火虫微闪 */
.tt-composer__player-dock::after {
  top: -2px;
  right: -2px;
  bottom: -2px;
  left: -2px;
  border-radius: 14px;
  padding: 1.5px;
  background: linear-gradient(
    128deg,
    var(--tt-mini-glow-a) 0%,
    var(--tt-mini-glow-b) 24%,
    rgba(168, 224, 99, 0.55) 48%,
    var(--tt-mini-glow-b) 72%,
    var(--tt-mini-glow-a) 100%
  );
  background-size: 240% 240%;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  box-shadow:
    0 0 5px rgba(212, 252, 121, 0.5),
    0 0 14px rgba(180, 240, 90, 0.24),
    0 0 28px rgba(140, 220, 60, 0.12);
  animation:
    tt-mini-ring-shimmer 5.2s ease-in-out infinite,
    tt-mini-ring-flicker 3.8s ease-in-out infinite;
  z-index: 0;
  will-change: opacity, background-position, filter;
}

@supports not (mask-composite: exclude) {
  .tt-composer__player-dock::after {
    padding: 0;
    background: transparent;
    -webkit-mask: none;
    mask: none;
    border: 1.5px solid rgba(212, 252, 121, 0.72);
    box-shadow:
      0 0 5px rgba(212, 252, 121, 0.45),
      0 0 14px rgba(180, 240, 90, 0.28);
  }
}

@keyframes tt-mini-halo-breathe {
  0%, 100% { transform: scale(0.92); opacity: 0.48; }
  50% { transform: scale(1.08); opacity: 0.88; }
}

@keyframes tt-mini-ring-shimmer {
  0%, 100% { background-position: 0% 42%; filter: brightness(1) saturate(1); }
  50% { background-position: 100% 58%; filter: brightness(1.1) saturate(1.08); }
}

@keyframes tt-mini-ring-flicker {
  0%, 100% { opacity: 1; }
  41% { opacity: 0.96; }
  43% { opacity: 1; filter: brightness(1.12); }
  45% { opacity: 0.78; filter: brightness(0.92); }
  47% { opacity: 0.98; filter: brightness(1.04); }
  71% { opacity: 0.94; }
  73% { opacity: 1; filter: brightness(1.08); }
}

.tt-composer__mini,
[data-composer-mini-host].pmp-root[data-mode="chat"] {
  position: relative;
  z-index: 1;
  width: 200px !important;
  height: 120px !important;
  max-width: 200px;
  max-height: 120px;
  border-radius: 10px;
  border: 1px solid rgba(212, 252, 121, 0.2);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    inset 0 0 18px rgba(180, 240, 90, 0.04);
  animation: tt-mini-inner-glow 3.4s ease-in-out infinite;
}

@keyframes tt-mini-inner-glow {
  0%, 100% {
    border-color: rgba(212, 252, 121, 0.16);
    box-shadow:
      0 8px 24px rgba(0, 0, 0, 0.45),
      inset 0 1px 0 rgba(255, 255, 255, 0.04),
      inset 0 0 14px rgba(180, 240, 90, 0.03);
  }
  50% {
    border-color: rgba(212, 252, 121, 0.34);
    box-shadow:
      0 10px 28px rgba(0, 0, 0, 0.5),
      inset 0 1px 0 rgba(255, 255, 255, 0.06),
      inset 0 0 24px rgba(180, 240, 90, 0.1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tt-composer__player-dock::before,
  .tt-composer__player-dock::after,
  [data-composer-mini-host].pmp-root[data-mode="chat"] {
    animation: none;
  }

  .tt-composer__player-dock::before {
    opacity: 0.65;
    transform: none;
  }

  .tt-composer__player-dock::after {
    opacity: 0.9;
  }
}

.tt-composer__share-wrap {
  position: relative;
  flex-shrink: 0;
}

.tt-share-picker {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  width: min(360px, calc(100vw - 48px));
  z-index: 30;
}

.tt-share-picker[hidden] { display: none !important; }

.tt-share-picker__panel {
  position: relative;
  background: var(--tt-bg-dark);
  color: var(--tt-text);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.tt-share-picker__panel::after {
  content: '';
  position: absolute;
  left: 14px;
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: var(--tt-bg-dark);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transform: rotate(45deg);
}

.tt-share-picker__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tt-share-picker__header h3 { margin: 0; font-size: 15px; }

.tt-share-picker__tabs {
  display: flex;
  gap: 4px;
  padding: 6px 10px 0;
  flex-wrap: wrap;
}

.tt-share-picker__tabs[hidden] { display: none !important; }

.tt-share-tab {
  border: none;
  background: transparent;
  color: var(--tt-muted, #9aa0a6);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.tt-share-tab.is-active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--tt-text, #fff);
}

.tt-share-picker__playlist {
  padding: 8px 14px 0;
}

.tt-share-picker__playlist[hidden] { display: none !important; }

.tt-share-picker__playlist-select {
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.2);
  color: var(--tt-text, #fff);
  padding: 8px 10px;
  font-size: 13px;
}

.tt-share-picker__close {
  background: none;
  border: none;
  color: var(--tt-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.tt-share-picker__close:hover { color: var(--tt-text); }

.tt-share-picker__filter { padding: 8px 14px 4px; }

.tt-share-picker__search {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--tt-bg-medium);
  color: var(--tt-text);
}

.tt-share-picker__body {
  padding: 8px 14px 12px;
  max-height: 280px;
  overflow-y: auto;
}
.tt-share-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255,255,255,.08);
  background: var(--tt-bg-medium);
  color: var(--tt-text);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.tt-share-item:hover { border-color: var(--tt-brand); background: var(--tt-bg-light); }
.tt-share-item__body { min-width: 0; }
.tt-share-item__title { font-weight: 600; }
.tt-share-item__tags { font-size: 12px; color: var(--tt-muted); margin-top: 4px; }
.tt-share-item__share {
  border: none;
  background: transparent;
  color: var(--tt-muted);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.tt-share-item__share:hover {
  color: var(--tt-brand);
  background: rgba(88, 101, 242, 0.12);
}
.tt-share-item .pmp-list-play,
.tt-share-item__play .pmp-list-play {
  --pmp-accent: var(--tt-brand);
  --pmp-accent-hover: var(--tt-brand-hover);
  opacity: 1;
  transform: scale(1);
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.tt-share-item__play {
  display: inline-flex;
  flex-shrink: 0;
}

.tt-ambient__hint { margin: 0 0 10px; font-size: 12px; }
.tt-ambient__schedule { margin: 0 0 10px; font-size: 11px; color: var(--tt-brand); line-height: 1.45; }
.tt-ambient-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.tt-ambient-toggle-row .tt-panel__title { margin: 0; }
.tt-ambient-switch {
  position: relative;
  display: inline-flex;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.tt-ambient-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.tt-ambient-switch__slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tt-muted) 35%, transparent);
  transition: background 0.2s ease;
  cursor: pointer;
}
.tt-ambient-switch__slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}
.tt-ambient-switch input:checked + .tt-ambient-switch__slider {
  background: var(--tt-brand);
}
.tt-ambient-switch input:checked + .tt-ambient-switch__slider::before {
  transform: translateX(20px);
}
.tt-ambient-switch input:disabled + .tt-ambient-switch__slider {
  opacity: 0.5;
  cursor: not-allowed;
}
.tt-ambient-volume {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tt-ambient-volume__label { font-size: 12px; color: var(--tt-muted); white-space: nowrap; }
.tt-ambient-volume__range { flex: 1; }

.tt-share-tab[hidden] { display: none !important; }

.tt-guest-wall, .tt-lobby {
  padding: 48px 24px;
  text-align: center;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.tt-guest-wall__copy,
.tt-lobby__copy {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--tt-brand);
  font-weight: 500;
  min-height: 1.65em;
}
.tt-mood-tags {
  margin: 12px 0 14px;
}
.tt-mood-tags__label {
  margin: 0 0 8px;
  font-size: 11px;
  color: var(--tt-muted);
}
.tt-mood-tags__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tt-mood-tag {
  border: 1px solid var(--tt-border);
  background: var(--tt-panel);
  color: var(--tt-text);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
}
.tt-mood-tag:hover { border-color: var(--tt-brand); }
.tt-mood-tag.is-active {
  border-color: var(--tt-brand);
  background: color-mix(in srgb, var(--tt-brand) 18%, transparent);
  color: var(--tt-brand);
}
body.tt-ending-open { overflow: hidden; }
.tt-ending {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.tt-ending[hidden] { display: none !important; }
.tt-ending__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 16, 0.72);
  backdrop-filter: blur(3px);
}
.tt-ending__card {
  position: relative;
  width: 100%;
  max-width: 380px;
  padding: 28px 24px;
  border-radius: 16px;
  background: var(--tt-panel);
  border: 1px solid var(--tt-border);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
  text-align: center;
}
.tt-ending__title {
  margin: 0 0 10px;
  font-size: 1.35rem;
  color: var(--tt-text);
}
.tt-ending__desc {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--tt-muted);
}

.tt-guest-wall[hidden], .tt-lobby[hidden], .tt-composer[hidden] { display: none !important; }

.tt-muted { color: var(--tt-muted); }

.tt-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  -webkit-overflow-scrolling: touch;
}

.tt-chat--composer-pinned .tt-messages,
.tt-chat:has(.tt-composer:not([hidden])) .tt-messages {
  padding-bottom: calc(16px + var(--tt-composer-bar-h));
}

.tt-chat--mini-dock-visible .tt-messages,
.tt-chat:has([data-composer-mini-dock]:not([hidden])) .tt-messages {
  padding-bottom: calc(16px + var(--tt-composer-bar-h) + var(--tt-mini-player-overhang));
}

.tt-media-offscreen {
  position: fixed;
  width: 0;
  height: 0;
  opacity: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: -1px;
  pointer-events: none;
}

.tt-message-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 16px 8px;
  color: var(--tt-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  user-select: none;
}

.tt-message-divider::before,
.tt-message-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.tt-message {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 0 16px;
  align-items: start;
  padding: 2px 16px;
  margin: 0;
  border-radius: 4px;
  transition: background-color 0.12s ease;
}

.tt-message:hover {
  background: rgba(4, 4, 5, 0.07);
}

.tt-message--compact {
  margin-top: -2px;
  padding-top: 0;
}

.tt-message--compact:hover {
  background: rgba(4, 4, 5, 0.07);
}

.tt-message--system {
  display: flex;
  justify-content: center;
  grid-template-columns: 1fr;
  padding: 10px 16px;
  margin: 4px 0;
}

.tt-message--system:hover {
  background: transparent;
}

.tt-message__system-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--tt-muted);
  font-size: 12px;
  line-height: 1.4;
  max-width: 90%;
  text-align: center;
}

.tt-avatar {
  width: 40px;
  height: 40px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--tt-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  flex-shrink: 0;
  user-select: none;
}

.tt-avatar--spacer {
  visibility: hidden;
  pointer-events: none;
}

.tt-message__content {
  min-width: 0;
  padding: 2px 0 6px;
}

.tt-message__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
  line-height: 1.375;
}

.tt-message__author {
  font-size: 15px;
  font-weight: 600;
  cursor: default;
}

.tt-message__time {
  color: var(--tt-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: default;
  white-space: nowrap;
}

.tt-message__time:hover {
  color: var(--tt-text);
}

.tt-message__body {
  font-size: 15px;
  line-height: 1.375;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--tt-text);
}

.tt-message--compact .tt-message__body {
  margin-top: 0;
}

.tt-message--self .tt-message__body {
  color: #eceeef;
}

.tt-composer__plus {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--tt-bg-medium);
  color: var(--tt-text);
  font-size: 20px;
  cursor: pointer;
}

.tt-composer__plus[aria-expanded="true"] {
  background: color-mix(in srgb, var(--tt-brand) 22%, var(--tt-bg-medium));
  color: #fff;
}

.tt-composer__input {
  flex: 1;
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--tt-bg-medium);
  color: var(--tt-text);
}

.tt-member-list { list-style: none; margin: 0; padding: 0; }
.tt-member-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.tt-member-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.tt-member-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tt-member-name {
  font-size: 14px;
  font-weight: 600;
}

.tt-member-presence {
  font-size: 11px;
  color: var(--tt-muted);
}

.tt-member-presence.is-online { color: #9ad86a; }
.tt-member-presence.is-offline { color: var(--tt-muted); }

.tt-quota__text { margin: 0; font-size: 13px; color: var(--tt-muted); }

.tt-not-found {
  min-height: 100vh;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 24px;
}

.tt-mobile-nav,
.tt-mobile-account,
.tt-mobile-sheet-bar,
.tt-mobile-members-empty,
.tt-lobby__hint--mobile { display: none; }

.tt-lobby__hint--desktop { display: block; }

@media (max-width: 1023px) {
  .tt-lobby__hint--desktop { display: none; }
  .tt-lobby__hint--mobile { display: block; }

  .tt-header {
    padding: 0 12px;
    gap: 8px;
  }

  .tt-room-title {
    display: block;
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-left: 0;
  }

  .tt-header__status {
    margin-left: auto;
    font-size: 12px;
    min-width: 0;
  }

  .tt-header__status span[data-status-label] {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 28vw;
  }

  .tt-header__member { display: none; }

  .tt-body-grid {
    display: flex;
    flex-direction: column;
    grid-template-columns: 1fr;
    min-height: 0;
    overflow: hidden;
  }

  .tt-chat {
    flex: 1;
    min-height: 0;
    padding-bottom: 0;
  }

  .tt-app.tt-app--mobile-nav .tt-chat {
    padding-bottom: calc(var(--tt-mobile-nav-h) + env(safe-area-inset-bottom, 0px));
  }

  .tt-chat--composer-pinned .tt-composer,
  .tt-chat:has(.tt-composer:not([hidden])) .tt-composer {
    left: 0;
    right: 0;
    bottom: 0;
  }

  .tt-app.tt-app--mobile-nav .tt-chat--composer-pinned .tt-composer,
  .tt-app.tt-app--mobile-nav .tt-chat:has(.tt-composer:not([hidden])) .tt-composer {
    bottom: calc(var(--tt-mobile-nav-h) + env(safe-area-inset-bottom, 0px));
  }

  .tt-sidebar,
  .tt-members {
    display: none;
    position: fixed;
    top: var(--tt-header-h);
    left: 0;
    right: 0;
    bottom: calc(var(--tt-mobile-nav-h) + env(safe-area-inset-bottom, 0px));
    z-index: 25;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border: none;
    padding-top: 0;
  }

  .tt-mobile-sheet-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 12px 16px;
    margin: 0 0 8px;
    background: var(--tt-bg-dark);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .tt-mobile-sheet-bar__back {
    border: none;
    background: var(--tt-bg-medium);
    color: var(--tt-text);
    border-radius: 8px;
    min-height: 36px;
    padding: 0 12px;
    font-size: 14px;
    cursor: pointer;
  }

  .tt-mobile-sheet-bar__title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
  }

  .tt-sidebar.is-mobile-open.mode-discover,
  .tt-sidebar.is-mobile-open.mode-more,
  .tt-members.is-mobile-open {
    display: block;
  }

  .tt-sidebar.is-mobile-open.mode-discover .tt-quota,
  .tt-sidebar.is-mobile-open.mode-discover .tt-ambient,
  .tt-sidebar.is-mobile-open.mode-discover .tt-mobile-account {
    display: none !important;
  }

  .tt-sidebar.is-mobile-open.mode-more .tt-panel:first-of-type,
  .tt-sidebar.is-mobile-open.mode-more .tt-invite {
    display: none !important;
  }

  .tt-sidebar.is-mobile-open.mode-more .tt-mobile-account {
    display: block;
  }

  .tt-mobile-members-empty {
    display: block;
    margin: 0 0 12px;
    padding: 0 16px;
    font-size: 14px;
    line-height: 1.5;
  }

  .tt-mobile-members-empty[hidden] {
    display: none !important;
  }

  .tt-members.is-mobile-open .tt-panel__title,
  .tt-members.is-mobile-open .tt-member-list,
  .tt-members.is-mobile-open .tt-invite-code,
  .tt-members.is-mobile-open [data-action="leave-room"] {
    padding-left: 16px;
    padding-right: 16px;
  }

  .tt-members.is-mobile-open .tt-member-list {
    padding-left: 16px;
    padding-right: 16px;
  }

  .tt-members.is-mobile-open [data-action="leave-room"] {
    margin: 12px 16px 16px;
    width: calc(100% - 32px);
  }

  .tt-sidebar.is-mobile-open .tt-panel {
    padding-left: 16px;
    padding-right: 16px;
  }

  .tt-mobile-account__links {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .tt-mobile-account__links a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 8px;
    background: var(--tt-bg-medium);
    color: var(--tt-text);
    text-decoration: none;
    font-size: 15px;
  }

  .tt-mobile-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    height: calc(var(--tt-mobile-nav-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--tt-bg-deepest);
    border-top: 1px solid #111214;
  }

  .tt-mobile-nav[hidden] { display: none !important; }

  .tt-mobile-nav__btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--tt-mobile-nav-h);
    border: none;
    background: transparent;
    color: var(--tt-muted);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    padding: 0 4px;
  }

  .tt-mobile-nav__btn.is-active {
    color: #fff;
    font-weight: 600;
  }

  .tt-mobile-nav__btn.is-active .tt-mobile-nav__label {
    position: relative;
  }

  .tt-mobile-nav__btn.is-active .tt-mobile-nav__label::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -8px;
    width: 18px;
    height: 3px;
    margin-left: -9px;
    border-radius: 999px;
    background: var(--tt-brand);
  }

  .tt-chat.is-mobile-overlay-open {
    visibility: hidden;
  }

  .tt-btn {
    min-height: 44px;
    padding: 10px 16px;
  }

  .tt-btn--sm {
    min-height: 36px;
    padding: 6px 12px;
  }

  .tt-mood {
    min-height: 44px;
    padding: 10px 12px;
  }

  .tt-composer {
    padding: 10px 12px;
  }

  .tt-composer__player-dock {
    right: 12px;
    bottom: calc(100% + 8px);
  }

  .tt-composer__plus {
    width: 44px;
    height: 44px;
    font-size: 22px;
  }

  .tt-composer__input {
    min-height: 44px;
    font-size: 16px;
  }

  .tt-composer__send {
    min-width: 64px;
  }

  .tt-activity {
    padding: 0;
  }

  .tt-activity__header {
    flex-direction: column;
    align-items: stretch;
  }

  .tt-activity__header .tt-activity__controls {
    width: 100%;
    margin-left: 0;
    gap: 8px;
  }

  .tt-activity__header .tt-activity__controls .tt-btn {
    flex: 1 1 calc(50% - 4px);
    min-width: calc(50% - 4px);
    font-size: 13px;
    padding: 8px 10px;
  }

  .tt-activity__header .tt-activity__controls--request .tt-btn {
    flex: 1 1 100%;
    min-width: 100%;
  }

  .tt-embed {
    max-width: none;
  }

  .tt-message {
    grid-template-columns: 44px 1fr;
    gap: 0 10px;
    padding: 2px 12px;
  }

  .tt-avatar {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .tt-share-picker {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(var(--tt-mobile-nav-h) + env(safe-area-inset-bottom, 0px) + 12px);
    width: auto;
    max-width: none;
    z-index: 40;
  }

  .tt-share-picker__panel {
    max-height: min(60vh, 420px);
  }

  .tt-share-picker__body {
    max-height: min(45vh, 320px);
    overflow-y: auto;
  }

  .tt-guest-wall,
  .tt-lobby {
    padding: 24px 16px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tt-app.tt-app--mobile-nav .tt-guest-wall,
  .tt-app.tt-app--mobile-nav .tt-lobby {
    padding-bottom: calc(24px + var(--tt-mobile-nav-h) + env(safe-area-inset-bottom, 0px));
  }
}
