/**
 * TeleLive /live UI fixes + chat panel redesigns (V617+)
 * Load after stream.css / stream-chat-v2.css / theme-apple-pages.css
 */

:root {
  --tl-follow: var(--brand, #1e56f5);
  --tl-follow-soft: rgba(30, 86, 245, 0.16);
  --tl-ban: #ef4444;
  --tl-ban-soft: rgba(239, 68, 68, 0.14);
}

/* ═══════════════════════════════════════════
   1) Modals / popups above mobile chat dock
   ═══════════════════════════════════════════ */
@media (max-width: 1024px) {
  body.page-stream #subModalOverlay,
  body.page-stream .sub-modal-overlay,
  body.page-stream .chat-settings-modal,
  body.page-stream #reportModal,
  body.page-stream #reportModalOverlay,
  body.page-stream .report-modal-overlay,
  body.page-stream #smsModal,
  body.page-stream #pollModal,
  body.page-stream #raidModal,
  body.page-stream .chat-user-popup,
  body.page-stream .mob-drawer,
  body.page-stream .mob-drawer-overlay,
  body.page-stream .toast-container,
  body.page-stream .telepass-overlay,
  body.page-stream .wof-overlay,
  body.page-stream .tl-modal-overlay,
  body.page-stream [id$="ModalOverlay"],
  body.page-stream .cup-chat-history-modal {
    z-index: 100120 !important;
  }

  body.page-stream.sub-modal-open #tlMobChatDock,
  body.page-stream.sub-modal-open .tl-sk-mount--stream-chat,
  body.page-stream.tl-modal-open #tlMobChatDock,
  body.page-stream:has(#subModalOverlay.open) #tlMobChatDock,
  body.page-stream:has(.chat-settings-modal[style*="flex"]) #tlMobChatDock,
  body.page-stream:has(.mob-drawer.open) #tlMobChatDock {
    z-index: 99980 !important;
  }
  body.page-stream #subModalOverlay.open,
  body.page-stream .sub-modal-overlay.open {
    z-index: 100140 !important;
  }

  /* Closed dock: reserve real height so Subscribe isn't under the bar */
  body.page-stream:not(.tl-mob-chat-drawer-open) .stream-page:not([data-mob-tab="info"]) {
    padding-bottom: calc(var(--tl-mob-dock-h, 72px) + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Open dock: don't create a containing block for fixed popups */
  body.page-stream #tlMobChatDock,
  body.page-stream.tl-mob-chat-drawer-open .tl-sk-mount--stream-chat {
    -webkit-transform: none !important;
    transform: none !important;
  }

  /* Chat popovers fit inside open sheet */
  body.page-stream.tl-mob-chat-drawer-open .chat-emoji-picker,
  body.page-stream.tl-mob-chat-drawer-open .chat-cheer-panel,
  body.page-stream.tl-mob-chat-drawer-open .chat-spark-panel,
  body.page-stream.tl-mob-chat-drawer-open .chat-admin-whisper-panel {
    max-height: min(48dvh, calc(100dvh - var(--tl-mob-chat-overlay-top, 38vh) - 110px)) !important;
    overflow-y: auto !important;
  }
}

/* ═══════════════════════════════════════════
   2) /live navbar RTL — brand right, icons left
   ═══════════════════════════════════════════ */
@media (max-width: 1024px) {
  body.page-stream .navbar-container > .tl-navbar-brand-cluster {
    flex: 0 1 auto !important;
    justify-content: flex-start !important;
    min-width: 0 !important;
  }
  body.page-stream .navbar-container > .tl-navbar-end {
    flex: 0 1 auto !important;
    justify-content: flex-end !important;
    margin-inline-start: auto !important;
    margin-inline-end: 0 !important;
    gap: 6px !important;
    min-width: 0 !important;
  }
}
html[dir="rtl"] .tl-navbar-end {
  margin-inline-start: auto;
  margin-inline-end: 0;
}

/* ═══════════════════════════════════════════
   3) Info bar: keep username · category tight + link
   ═══════════════════════════════════════════ */
.mob-info-name {
  flex: 0 1 auto !important;
  max-width: min(48%, 220px);
}
.mob-info-category,
a.mob-info-category {
  flex: 0 1 auto !important;
  max-width: min(42vw, 160px);
  color: var(--brand, #1e56f5);
  text-decoration: none;
  cursor: pointer;
}
a.mob-info-category:hover,
a.mob-info-category:focus-visible {
  text-decoration: underline;
  outline: none;
}
.mob-info-subrow {
  justify-content: flex-start;
  gap: 6px;
}

/* ═══════════════════════════════════════════
   4) Chat header — 2 compact buttons, one row
   ═══════════════════════════════════════════ */
html:not([data-theme="lite"]) body.page-stream .chat-hdr-actions-slot--desktop,
html:not([data-theme="lite"]) body.page-stream .chat-header-top .chat-header-actions,
html:not([data-theme="lite"]) body.page-stream .chat-header-actions-grid,
.chat-header-actions-grid {
  display: flex !important;
  flex: 0 0 auto !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-end !important;
  max-width: none !important;
  min-width: 0 !important;
  gap: 6px !important;
  grid-template-columns: none !important;
}
body.page-stream .chat-header-top h3,
body.page-stream .chat-drawer-hint-title {
  min-width: 0 !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-hdr-actions-slot--mob {
  max-width: none !important;
}
.chat-hdr-actions-slot--mob .chat-header-actions-grid {
  overflow: visible !important;
}
html:not(#tlx) body .chat-header-actions-grid .chat-hdr-btn {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 10px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  color: rgba(255, 255, 255, 0.78) !important;
  font-size: 0.82rem !important;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
html:not(#tlx) body .chat-header-actions-grid .chat-hdr-btn:hover,
html:not(#tlx) body .chat-header-actions-grid .chat-hdr-btn.is-active {
  background: rgba(30, 86, 245, 0.18) !important;
  border-color: rgba(30, 86, 245, 0.45) !important;
  color: #fff !important;
}
html:not(#tlx) body .chat-header-actions-grid .chat-hdr-btn:active {
  transform: scale(0.94);
}
html[data-theme="light"]:not(#tlx) body .chat-header-actions-grid .chat-hdr-btn {
  border-color: rgba(0, 0, 0, 0.1) !important;
  background: rgba(0, 0, 0, 0.04) !important;
  color: rgba(0, 0, 0, 0.7) !important;
}

/* Quick access row — top of chat settings */
.tl-cs-actions {
  margin: 4px 0 16px;
}
.tl-cs-actions__title {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted, #a6a6b2);
  margin: 0 2px 8px;
  letter-spacing: 0.01em;
}
.tl-cs-actions__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
html:not(#tlx) body .tl-cs-actions .tl-cs-action {
  position: relative;
  display: flex !important;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text, #e8e8e8) !important;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  text-align: start;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
html:not(#tlx) body .tl-cs-actions .tl-cs-action:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}
html:not(#tlx) body .tl-cs-actions .tl-cs-action:active {
  transform: scale(0.98);
}
.tl-cs-action__ic {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  background: rgba(30, 86, 245, 0.16);
  color: #8fb0ff;
}
.tl-cs-action__txt {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tl-cs-action--admin .tl-cs-action__ic { background: rgba(245, 158, 11, 0.14); color: #fbbf24; }
.tl-cs-action--mod .tl-cs-action__ic { background: rgba(34, 197, 94, 0.14); color: #4ade80; }
.tl-cs-action--warn .tl-cs-action__ic { background: rgba(239, 68, 68, 0.15); color: #f87171; }
html:not(#tlx) body .tl-cs-actions .tl-cs-action--warn {
  border-color: rgba(239, 68, 68, 0.25);
}
html:not(#tlx) body .tl-cs-actions .tl-cs-action--warn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.45);
}
.tl-cs-action__state {
  margin-inline-start: auto;
  width: 30px;
  height: 17px;
  flex: 0 0 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  position: relative;
  transition: background 0.2s ease;
}
.tl-cs-action__state::after {
  content: "";
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  transition: inset-inline-start 0.2s ease;
}
html:not(#tlx) body .tl-cs-actions .tl-cs-action--admin.is-admin-on {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.08);
}
.tl-cs-action--admin.is-admin-on .tl-cs-action__state { background: #f59e0b; }
.tl-cs-action--admin.is-admin-on .tl-cs-action__state::after { inset-inline-start: 15px; }
html:not(#tlx) body.tl-hide-mod-btns #tlChatQuickActions #adminModeToggleBtn,
html:not(#tlx) body.tl-hide-mod-btns #tlChatQuickActions #streamerWarnOpenBtn,
html:not(#tlx) body.tl-hide-mod-btns #tlChatQuickActions #modViewToggleBtn {
  display: flex !important;
}
html[data-theme="light"] .tl-cs-actions .tl-cs-action {
  border-color: rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.03);
}
@media (max-width: 360px) {
  .tl-cs-actions__grid { grid-template-columns: 1fr; }
}

/* Viewer count — same colors, no border; flashes green/red on change */
html:not(#tlx) body #viewerCountWrap.tl-vc,
html:not(#tlx) body #chatHdrViewerCount.tl-vc {
  border: 0 !important;
  box-shadow: none !important;
  gap: 6px !important;
  font-size: 0.9rem !important;
  font-weight: 800 !important;
  font-variant-numeric: tabular-nums;
}
html:not(#tlx) body .tl-vc #viewerCount,
html:not(#tlx) body .tl-vc #chatHdrViewerNum {
  transition: color 0.35s ease;
}
html:not(#tlx) body .tl-vc i.fa-eye {
  font-size: 0.82rem !important;
  transition: color 0.35s ease;
}
html:not(#tlx) body .tl-vc.tl-vc--up #viewerCount,
html:not(#tlx) body .tl-vc.tl-vc--up #chatHdrViewerNum,
html:not(#tlx) body .tl-vc.tl-vc--up i.fa-eye {
  color: #22c55e !important;
}
html:not(#tlx) body .tl-vc.tl-vc--down #viewerCount,
html:not(#tlx) body .tl-vc.tl-vc--down #chatHdrViewerNum,
html:not(#tlx) body .tl-vc.tl-vc--down i.fa-eye {
  color: #ef4444 !important;
}
.tl-vc.tl-vc--up i.fa-eye,
.tl-vc.tl-vc--down i.fa-eye {
  animation: tlVcBlink 0.9s ease-in-out;
}
@keyframes tlVcBlink {
  0%, 100% { transform: scaleY(1); }
  15% { transform: scaleY(0.1); }
  30% { transform: scaleY(1); }
  45% { transform: scaleY(0.1); }
  60% { transform: scaleY(1); }
}
@media (max-width: 640px) {
  html:not(#tlx) body #viewerCountWrap.tl-vc {
    font-size: 0.84rem !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tl-vc i.fa-eye { animation: none !important; }
}

/* ═══════════════════════════════════════════
   5) Player controls — LTR chrome in all langs
   ═══════════════════════════════════════════ */
.player-controls-bar {
  direction: ltr !important;
}
.player-controls-bar__cluster--right {
  margin-left: auto !important;
  margin-right: 0 !important;
  margin-inline: unset !important;
}
.player-volume-wrap {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-direction: row !important;
}
@media (max-width: 640px) {
  .player-volume-slider {
    display: none !important;
  }
  .player-controls-bar {
    left: 6px !important;
    right: 6px !important;
    bottom: 6px !important;
    gap: 6px !important;
  }
  .player-controls-bar__cluster {
    padding: 3px 6px !important;
    min-height: 34px !important;
  }
}

/* ═══════════════════════════════════════════
   6) Brand hearts → blue
   ═══════════════════════════════════════════ */
.mob-info-btn.btn-following {
  background: var(--tl-follow-soft) !important;
  border-color: var(--tl-follow) !important;
  color: var(--tl-follow) !important;
}
.mob-info-btn.btn-following i {
  color: var(--tl-follow) !important;
}
.chat-hdr-stat i.fa-heart,
.chat-hdr-total-views .fa-heart,
.cup-stat i.fa-heart,
.chat-user-popup.tl-cup-card .cup-stat i {
  color: var(--tl-follow) !important;
}
.chat-user-popup.tl-cup-card .cup-follow-btn {
  border-color: var(--tl-follow) !important;
  color: var(--tl-follow) !important;
}
.chat-user-popup.tl-cup-card .cup-follow-btn.is-following,
.chat-user-popup.tl-cup-card .cup-follow-btn:not(.is-following) {
  background: var(--tl-follow-soft);
}
.chat-user-popup.tl-cup-card .cup-follow-btn i {
  color: var(--tl-follow) !important;
}

/* ═══════════════════════════════════════════
   7) Ban / timeout redesign
   ═══════════════════════════════════════════ */
.chat-user-popup {
  z-index: 100130 !important;
  max-height: min(78dvh, 560px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.cup-btn {
  text-align: start !important;
  border-radius: 12px !important;
  min-height: 40px;
  padding: 9px 12px !important;
  font-weight: 600;
}
.cup-action-group {
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  gap: 8px !important;
}
.cup-action-label {
  font-size: 0.68rem !important;
  letter-spacing: 0.04em;
  opacity: 0.75;
}
.cup-timeout-btns {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px !important;
}
.cup-btn.cup-btn-sm {
  min-width: 0 !important;
  min-height: 34px !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.cup-btn.cup-btn-sm:hover {
  background: var(--brand, #1e56f5) !important;
  border-color: transparent;
  color: #fff !important;
}
.cup-btn.cup-btn-danger {
  background: var(--tl-ban-soft) !important;
  border: 1px solid color-mix(in srgb, var(--tl-ban) 45%, transparent) !important;
  color: var(--tl-ban) !important;
  justify-content: center;
  font-weight: 800 !important;
  letter-spacing: 0.01em;
  margin-top: 4px;
}
.cup-btn.cup-btn-danger:hover {
  background: var(--tl-ban) !important;
  color: #fff !important;
}
.cup-btn.cup-btn-danger i {
  margin-inline-end: 6px;
}
@media (max-width: 640px) {
  .chat-user-popup.tl-cup-card {
    position: fixed !important;
    left: 10px !important;
    right: 10px !important;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    top: auto !important;
    width: auto !important;
    max-width: none !important;
    max-height: min(70dvh, 520px);
    border-radius: 20px !important;
    animation: cupSheetUp 0.22s ease;
  }
}
@keyframes cupSheetUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════
   8) Emoji picker redesign + GIF skeleton
   ═══════════════════════════════════════════ */
.chat-emoji-picker,
.emoji-picker-v2.open {
  border-radius: 16px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(18, 18, 24, 0.96) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
  overflow: hidden;
}
.emoji-tabs {
  background: rgba(255, 255, 255, 0.03) !important;
  padding: 8px 8px 0 !important;
  gap: 4px !important;
}
.emoji-tab {
  border-radius: 10px 10px 0 0 !important;
  min-width: 48px;
  padding: 7px 9px !important;
}
.emoji-tab.active {
  background: rgba(30, 86, 245, 0.12) !important;
}
.emoji-picker__body {
  padding: 6px !important;
}
.emoji-sk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  padding: 10px;
}
.emoji-sk-tile {
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(255,255,255,.04) 25%, rgba(255,255,255,.1) 50%, rgba(255,255,255,.04) 75%);
  background-size: 200% 100%;
  animation: tlEmojiSk 1.1s ease-in-out infinite;
}
@keyframes tlEmojiSk {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.emoji-item.emoji-gif {
  position: relative;
  overflow: hidden;
}
.emoji-item.emoji-gif::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(255,255,255,.04) 25%, rgba(255,255,255,.1) 50%, rgba(255,255,255,.04) 75%);
  background-size: 200% 100%;
  animation: tlEmojiSk 1.1s ease-in-out infinite;
  z-index: 0;
}
.emoji-item.emoji-gif img {
  position: relative;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.emoji-item.emoji-gif img.is-loaded,
.emoji-item.emoji-gif.is-loaded img {
  opacity: 1;
}
.emoji-item.emoji-gif.is-loaded::before {
  display: none;
}

/* Custom emoji tiles — shimmer until each image is ready */
.emoji-item.emoji-custom {
  position: relative;
  overflow: hidden;
}
.emoji-item.emoji-custom::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(255,255,255,.05) 25%, rgba(255,255,255,.13) 50%, rgba(255,255,255,.05) 75%);
  background-size: 200% 100%;
  animation: tlEmojiSk 1.1s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
.emoji-item.emoji-custom img {
  position: relative;
  z-index: 1;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.emoji-item.emoji-custom.is-loaded::before {
  display: none;
}
.emoji-item.emoji-custom.is-loaded img {
  opacity: 1;
  transform: none;
}
.emoji-item.emoji-custom.emoji-locked.is-loaded img {
  opacity: 0.4;
}
.emoji-item.emoji-custom.is-broken img {
  visibility: hidden;
}

/* Square skeleton grid while emoji packs are loading */
.emoji-sk-grid.emoji-sk-grid--sq {
  grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  gap: 6px;
  padding: 4px 6px 8px;
}
.emoji-sk-tile.emoji-sk-tile--sq {
  aspect-ratio: 1 / 1;
  border-radius: 9px;
}
.emoji-sk-tile--sq:nth-child(3n+1) { animation-delay: 0.08s; }
.emoji-sk-tile--sq:nth-child(3n+2) { animation-delay: 0.16s; }
.emoji-loading-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 8px 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted, #a6a6b2);
}
.emoji-loading-spin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--brand, #1e56f5);
  animation: tlEmojiSpin 0.7s linear infinite;
}
@keyframes tlEmojiSpin {
  to { transform: rotate(360deg); }
}
.emoji-picker__inner {
  position: relative;
}
.emoji-loading-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  overflow: hidden;
  z-index: 3;
  background: rgba(30, 86, 245, 0.15);
}
.emoji-loading-bar::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -40%;
  width: 40%;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--brand, #1e56f5), #6ea0ff, transparent);
  animation: tlEmojiBar 1.05s ease-in-out infinite;
}
@keyframes tlEmojiBar {
  0% { left: -40%; }
  100% { left: 100%; }
}
.emoji-picker__inner.is-loading .emoji-tab:not(.active):not([data-tab="standard"]) {
  opacity: 0.7;
}
html[data-theme="light"] .emoji-item.emoji-custom::before,
html[data-theme="light"] .emoji-sk-tile {
  background: linear-gradient(90deg, rgba(0,0,0,.05) 25%, rgba(0,0,0,.1) 50%, rgba(0,0,0,.05) 75%);
  background-size: 200% 100%;
}
@media (prefers-reduced-motion: reduce) {
  .emoji-item.emoji-custom::before,
  .emoji-sk-tile,
  .emoji-loading-bar::after { animation-duration: 2.4s; }
}

/* ═══════════════════════════════════════════
   9) Admin whisper panel redesign
   ═══════════════════════════════════════════ */
.chat-admin-whisper-panel,
#chatAdminPanel.chat-admin-whisper-panel {
  position: absolute !important;
  bottom: calc(100% + 8px) !important;
  inset-inline: 8px !important;
  left: auto;
  right: auto;
  z-index: 230 !important;
  max-height: min(62vh, 420px) !important;
  overflow: hidden !important;
  flex-direction: column;
  border-radius: 16px !important;
  border: 1px solid rgba(245, 158, 11, 0.28) !important;
  background: linear-gradient(165deg, #1c1914 0%, #121018 100%) !important;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.55) !important;
}
#chatAdminPanel.chat-admin-whisper-panel[style*="display: none"],
#chatAdminPanel.chat-admin-whisper-panel[style*="display:none"] {
  display: none !important;
}
#chatAdminPanel.chat-admin-whisper-panel[style*="display: block"],
#chatAdminPanel.chat-admin-whisper-panel[style*="display:block"],
#chatAdminPanel.chat-admin-whisper-panel[style*="display: flex"],
#chatAdminPanel.chat-admin-whisper-panel[style*="display:flex"] {
  display: flex !important;
}
.chat-admin-whisper-head {
  background: rgba(245, 158, 11, 0.1) !important;
  border-bottom-color: rgba(245, 158, 11, 0.22) !important;
}
.chat-admin-preset {
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  padding: 10px 12px !important;
}
.chat-admin-preset:hover {
  border-color: rgba(245, 158, 11, 0.5) !important;
  background: rgba(245, 158, 11, 0.1) !important;
}

/* ═══════════════════════════════════════════
   10) Tele cheer panel redesign
   ═══════════════════════════════════════════ */
.chat-cheer-panel {
  border-radius: 16px !important;
  border: 1px solid rgba(30, 86, 245, 0.35) !important;
  background: linear-gradient(165deg, #121826 0%, #0e1018 100%) !important;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
  padding: 12px !important;
  max-height: min(58vh, 400px);
  overflow-y: auto;
}
.ccp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.ccp-title {
  font-weight: 800;
  font-size: 0.9rem;
  color: #93c5fd;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.ccp-bal {
  font-weight: 700;
  font-size: 0.8rem;
  color: #60a5fa;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(30, 86, 245, 0.15);
  border: 1px solid rgba(30, 86, 245, 0.3);
}
.ccp-amounts {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px !important;
  margin-bottom: 8px;
}
.ccp-amt {
  border-radius: 12px !important;
  min-height: 42px;
  font-weight: 800 !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #e8eefc !important;
}
.ccp-amt.sel,
.ccp-amt:hover {
  background: rgba(30, 86, 245, 0.22) !important;
  border-color: rgba(30, 86, 245, 0.55) !important;
  color: #fff !important;
}
.ccp-quick {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.ccp-quick-btn {
  flex: 1;
  border-radius: 10px !important;
  min-height: 36px;
  font-weight: 650;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #dbeafe !important;
}
.ccp-send {
  border-radius: 12px !important;
  min-height: 40px;
  font-weight: 800 !important;
  background: linear-gradient(135deg, #1e56f5, #3b82f6) !important;
  border: none !important;
}

/* ═══════════════════════════════════════════
   11) Tele Spark panel redesign
   ═══════════════════════════════════════════ */
.chat-spark-panel {
  border-radius: 16px !important;
  border: 1px solid rgba(96, 165, 250, 0.3) !important;
  background: linear-gradient(165deg, #101820 0%, #0c1016 100%) !important;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.55) !important;
  inset-inline-start: 8px !important;
  left: auto !important;
  right: auto !important;
  max-height: min(58vh, 420px);
  overflow: hidden;
  flex-direction: column;
}
/* Must beat redesign display — otherwise panel stays visible after close */
.chat-spark-panel[hidden] {
  display: none !important;
}
.chat-spark-panel:not([hidden]),
.chat-spark-panel.is-open:not([hidden]) {
  display: flex !important;
  flex-direction: column;
}
.chat-spark-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 12px 8px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0;
}
.chat-spark-panel__close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(235, 235, 245, 0.75);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}
.chat-spark-panel__close:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fff;
}
.chat-spark-panel__tabs {
  gap: 4px !important;
  padding: 8px !important;
}
.chat-spark-panel__tabs button,
.chat-spark-panel [data-spark-tab] {
  border-radius: 999px !important;
  font-weight: 700;
}
.chat-spark-panel__body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 10px 12px;
}

/* ═══════════════════════════════════════════
   12) Warn streamer modal redesign
   ═══════════════════════════════════════════ */
#streamerWarnModal.tl-sw-modal {
  position: fixed;
  inset: 0;
  z-index: 100140;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
}
#streamerWarnModal .tl-sw-modal__backdrop {
  background: rgba(6, 6, 10, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
#streamerWarnModal .tl-sw-modal__card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(500px, 100%);
  max-height: min(88vh, 760px);
  max-height: min(88dvh, 760px);
  overflow: hidden;
  padding: 0;
  border-radius: 20px;
  border: 1px solid rgba(239, 68, 68, 0.22);
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(239, 68, 68, 0.16), transparent 60%),
    rgba(20, 20, 26, 0.97);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: tlSwIn 0.22s ease;
}
@keyframes tlSwIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
#streamerWarnModal .tl-sw-modal__head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
#streamerWarnModal .tl-sw-modal__head-text {
  flex: 1 1 auto;
  min-width: 0;
}
#streamerWarnModal .tl-sw-modal__icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  color: #fff;
  background: linear-gradient(145deg, #ef4444, #b91c1c);
  box-shadow: 0 8px 20px -6px rgba(239, 68, 68, 0.6);
}
#streamerWarnModal .tl-sw-modal__title {
  margin: 1px 0 8px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
}
#streamerWarnModal .tl-sw-modal__sub {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}
#streamerWarnModal .tl-sw-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}
#streamerWarnModal .tl-sw-chip i { font-size: 0.66rem; opacity: 0.8; }
#streamerWarnModal .tl-sw-modal__close {
  position: static;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
#streamerWarnModal .tl-sw-modal__close:hover {
  background: rgba(239, 68, 68, 0.18);
  color: #fff;
}
#streamerWarnModal .tl-sw-modal__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 14px 18px 6px;
}
#streamerWarnModal .tl-sw-modal__section {
  margin: 0 0 16px;
}
#streamerWarnModal .tl-sw-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 9px;
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}
#streamerWarnModal .tl-sw-label small {
  font-weight: 500;
  color: var(--text-muted, #a6a6b2);
}
#streamerWarnModal .tl-sw-step {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
  color: #fecaca;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.35);
}
#streamerWarnModal .tl-sw-modes {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}
#streamerWarnModal .tl-sw-mode {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 9px 4px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.78);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
#streamerWarnModal .tl-sw-mode i { font-size: 0.9rem; opacity: 0.85; }
#streamerWarnModal .tl-sw-mode:hover {
  background: rgba(255, 255, 255, 0.08);
}
#streamerWarnModal .tl-sw-mode:active { transform: scale(0.96); }
#streamerWarnModal .tl-sw-mode.is-active {
  color: #fff;
  border-color: rgba(30, 86, 245, 0.6);
  background: rgba(30, 86, 245, 0.2);
  box-shadow: inset 0 0 0 1px rgba(30, 86, 245, 0.35);
}
#streamerWarnModal .tl-sw-mode--danger.is-active {
  border-color: rgba(239, 68, 68, 0.65);
  background: rgba(239, 68, 68, 0.2);
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.35);
}
#streamerWarnModal .tl-sw-select-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
#streamerWarnModal .tl-sw-select-wrap__lbl {
  flex: 0 0 auto;
  font-size: 0.76rem;
  color: var(--text-muted, #a6a6b2);
}
#streamerWarnModal .tl-sw-select,
#streamerWarnModal .tl-sw-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font: inherit;
  font-size: 0.86rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
#streamerWarnModal .tl-sw-select { padding-block: 8px; cursor: pointer; }
#streamerWarnModal .tl-sw-select.is-custom {
  border-color: rgba(30, 86, 245, 0.6);
}
#streamerWarnModal .tl-sw-textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.6;
}
#streamerWarnModal .tl-sw-select:focus,
#streamerWarnModal .tl-sw-textarea:focus {
  outline: none;
  border-color: rgba(30, 86, 245, 0.7);
  box-shadow: 0 0 0 3px rgba(30, 86, 245, 0.2);
}
#streamerWarnModal .tl-sw-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
#streamerWarnModal .tl-sw-preset {
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.82);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
#streamerWarnModal .tl-sw-preset:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
#streamerWarnModal .tl-sw-preset.is-active {
  border-color: rgba(239, 68, 68, 0.55);
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
}
#streamerWarnModal .tl-sw-upload {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
#streamerWarnModal .tl-sw-upload__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 12px;
  border-radius: 14px;
  border: 1.5px dashed rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
#streamerWarnModal .tl-sw-upload__btn i { font-size: 1rem; color: #8fb0ff; }
#streamerWarnModal .tl-sw-upload__btn small {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-muted, #a6a6b2);
}
#streamerWarnModal .tl-sw-upload__btn:hover {
  border-color: rgba(30, 86, 245, 0.6);
  background: rgba(30, 86, 245, 0.08);
}
#streamerWarnModal .tl-sw-upload__name {
  font-size: 0.74rem;
  color: var(--text-muted, #a6a6b2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#streamerWarnModal .tl-sw-upload__name:empty { display: none; }
#streamerWarnModal .tl-sw-upload__preview[hidden] { display: none !important; }
#streamerWarnModal .tl-sw-upload__img {
  max-width: 100%;
  max-height: 150px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
#streamerWarnModal .tl-sw-modal__section--internal {
  padding: 12px;
  border-radius: 14px;
  border: 1px dashed rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.06);
}
#streamerWarnModal .tl-sw-modal__section--internal .tl-sw-label { color: #fde68a; }
#streamerWarnModal .tl-sw-textarea--internal {
  min-height: 64px;
  border-color: rgba(245, 158, 11, 0.3);
}
#streamerWarnModal .tl-sw-modal__foot {
  flex: 0 0 auto;
  padding: 10px 18px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(14, 14, 18, 0.6);
}
#streamerWarnModal .tl-sw-msg {
  margin: 0 0 8px;
  min-height: 0;
  font-size: 0.8rem;
  text-align: center;
}
#streamerWarnModal .tl-sw-msg:empty { display: none; }
#streamerWarnModal .tl-sw-modal__actions {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 8px;
  margin: 0;
}
#streamerWarnModal .tl-sw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
#streamerWarnModal .tl-sw-btn:active { transform: scale(0.98); }
#streamerWarnModal .tl-sw-btn--ghost {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.85);
}
#streamerWarnModal .tl-sw-btn--ghost:hover { background: rgba(255, 255, 255, 0.1); }
#streamerWarnModal #streamerWarnSend.tl-sw-btn--danger {
  border: 0;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #fff;
  box-shadow: 0 10px 24px -10px rgba(239, 68, 68, 0.8);
}
#streamerWarnModal #streamerWarnSend.tl-sw-btn--danger:hover { filter: brightness(1.08); }
#streamerWarnModal #streamerWarnSend:disabled { opacity: 0.6; cursor: wait; }
@media (max-width: 640px) {
  #streamerWarnModal.tl-sw-modal {
    align-items: flex-end;
    padding: 0;
  }
  #streamerWarnModal .tl-sw-modal__card {
    width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: 20px 20px 0 0;
    border-bottom: 0;
    animation: tlSwUp 0.24s ease;
  }
  #streamerWarnModal .tl-sw-modal__foot {
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
  #streamerWarnModal .tl-sw-modes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@keyframes tlSwUp {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
html[data-theme="light"] #streamerWarnModal .tl-sw-modal__card {
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(239, 68, 68, 0.1), transparent 60%),
    #fff;
}
html[data-theme="light"] #streamerWarnModal .tl-sw-modal__title,
html[data-theme="light"] #streamerWarnModal .tl-sw-label { color: #111; }
html[data-theme="light"] #streamerWarnModal .tl-sw-select,
html[data-theme="light"] #streamerWarnModal .tl-sw-textarea {
  background: #f6f6f8;
  color: #111;
  border-color: rgba(0, 0, 0, 0.12);
}
html[data-theme="light"] #streamerWarnModal .tl-sw-chip,
html[data-theme="light"] #streamerWarnModal .tl-sw-mode,
html[data-theme="light"] #streamerWarnModal .tl-sw-preset,
html[data-theme="light"] #streamerWarnModal .tl-sw-btn--ghost,
html[data-theme="light"] #streamerWarnModal .tl-sw-modal__close {
  color: #333;
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
}
html[data-theme="light"] #streamerWarnModal .tl-sw-modal__foot { background: #fafafa; }
