/* BAOYING_V9795_BOSS_RECTIFICATION */

.by-live-header .by-brand strong,
.by-entry-nav .by-brand strong,
.by-auth-brand .by-brand strong {
  color: var(--by-gold-bright);
  font-size: 19px;
  font-weight: 900;
  letter-spacing: .04em;
}

.by-player-brand-lockup {
  gap: 12px;
  margin-bottom: 10px;
}

.by-player-brand-lockup .by-brand-mark {
  width: 48px;
  height: 48px;
  font-size: 20px;
}

.by-player-brand-lockup strong {
  color: var(--by-gold-bright);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .08em;
}

.by-player-brand-lockup small {
  margin-top: 4px;
  font-size: 9px;
}

.by-player-stage {
  width: 100%;
  min-height: 0;
  height: auto;
  flex: 0 0 auto;
  aspect-ratio: 16 / 9;
}

.by-player-stage:fullscreen,
.by-player-stage:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  aspect-ratio: auto;
  border-radius: 0;
  background: #000;
}

.by-player-stage:fullscreen video,
.by-player-stage:-webkit-full-screen video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.by-player-fullscreen {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 24;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--by-line);
  border-radius: 6px;
  padding: 0 11px;
  background: rgba(5,10,18,.72);
  color: #e8eef6;
  backdrop-filter: blur(8px);
  font-size: 11px;
  font-weight: 750;
  transition: border-color .18s ease, background-color .18s ease, color .18s ease;
}

.by-player-fullscreen:hover {
  border-color: rgba(240,211,141,.58);
  background: rgba(16,22,31,.9);
  color: #f0d38d;
}

.by-player-fullscreen:focus-visible {
  outline: 3px solid rgba(240,211,141,.45);
  outline-offset: 2px;
}

.by-player-fullscreen svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.by-theme-picker {
  position: relative;
  z-index: 60;
  flex: 0 0 auto;
}

.by-live-header .by-header-actions .by-header-control {
  display: inline-flex;
  min-width: 76px;
  height: 42px;
  min-height: 42px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  overflow: hidden;
  border: 1px solid rgba(205, 218, 238, .18);
  border-radius: 6px;
  padding: 0 15px;
  background: rgba(255, 255, 255, .035);
  color: #c8d3e2;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  vertical-align: middle;
  transition: border-color .16s ease, background-color .16s ease, color .16s ease;
}

.by-live-header .by-header-actions .by-header-control:hover,
.by-live-header .by-header-actions .by-header-control:focus-visible,
.by-live-header .by-header-actions .by-header-control[aria-expanded="true"] {
  border-color: rgba(214, 179, 101, .48);
  background: rgba(214, 179, 101, .09);
  color: #f0d38d;
  transform: none;
}

.by-live-header .by-header-actions .by-header-control.by-btn-gold {
  border-color: #d6b365;
  background: #d6b365;
  color: #10141c;
}

.by-live-header .by-header-actions .by-header-control.by-btn-gold:hover,
.by-live-header .by-header-actions .by-header-control.by-btn-gold:focus-visible {
  background: #f0d38d;
  color: #10141c;
}

.by-live-header .by-header-actions .by-theme-trigger,
.by-live-header .by-header-actions .by-seo-entry {
  min-width: 112px;
}

.by-live-header .by-header-actions .by-user-chip {
  max-width: 140px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.by-theme-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  border: 1px solid var(--by-line);
  border-radius: 6px;
  padding: 0 11px;
  background: var(--by-panel-2);
  color: var(--by-muted);
  font-size: 11px;
  font-weight: 750;
}

.by-theme-trigger:hover,
.by-theme-trigger[aria-expanded="true"] {
  border-color: var(--by-line-strong);
  color: var(--by-text);
}

.by-theme-trigger svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.by-theme-menu {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 1000;
  width: 260px;
  border: 1px solid var(--by-line-strong);
  border-radius: 9px;
  padding: 12px;
  background: var(--by-panel);
  box-shadow: 0 18px 48px rgba(0,0,0,.38);
  color: var(--by-text);
}

.by-theme-menu[hidden] { display: none; }
.by-theme-menu > b { display: block; font-size: 14px; }
.by-theme-menu > p { margin: 4px 0 10px; color: var(--by-muted); font-size: 10px; line-height: 1.5; }

.by-theme-menu > button {
  display: grid;
  grid-template-columns: 34px minmax(0,1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 7px;
  background: transparent;
  color: var(--by-text);
  text-align: left;
}

.by-theme-menu > button:hover,
.by-theme-menu > button.is-active {
  border-color: var(--by-line);
  background: var(--by-surface);
}

.by-theme-menu i {
  display: block;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 7px;
}

.by-theme-menu i.is-midnight { background: #09111f; }
.by-theme-menu i.is-slate { background: #33465c; }
.by-theme-menu i.is-sand { background: #e9e1d2; }
.by-theme-menu strong, .by-theme-menu small { display: block; }
.by-theme-menu strong { font-size: 12px; }
.by-theme-menu small { margin-top: 2px; color: var(--by-muted); font-size: 9px; }

.by-message-avatar {
  border: 1px solid rgba(160,178,203,.26);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: -.04em;
}

.by-message-head { gap: 6px; }
.by-message-head .by-role-badge { order: 0; }
.by-message-head .by-message-name { order: 1; }
.by-message-head .by-prod-origin { order: 2; }
.by-message-head .by-message-time { order: 3; }

.by-message.is-role-moderator .by-message-avatar {
  border-color: rgba(255,91,82,.65);
  background: rgba(131,27,27,.55);
  color: #ffd8d5;
}

.by-message.is-role-moderator .by-role-badge,
.by-message.is-role-moderator .by-message-name {
  border-color: rgba(255,91,82,.55);
  background: rgba(255,91,82,.11);
  color: #ff6a62;
  font-size: 12px;
  font-weight: 900;
}

.by-message.is-role-teacher .by-message-avatar,
.by-message.is-role-supreme .by-message-avatar {
  border-color: rgba(240,211,141,.62);
  background: rgba(126,91,19,.48);
  color: #ffe7a7;
}

.by-message.is-role-service .by-message-avatar {
  border-color: rgba(183,135,255,.55);
  background: rgba(89,48,143,.45);
  color: #e1c8ff;
}

.by-message.is-role-premium .by-message-avatar {
  border-color: rgba(183,135,255,.55);
  background: rgba(89,48,143,.45);
  color: #e1c8ff;
}

.by-message.is-role-diamond .by-message-avatar {
  border-color: rgba(94,213,255,.58);
  background: rgba(23,94,127,.46);
  color: #bdefff;
}

.by-message.is-role-gold .by-message-avatar {
  border-color: rgba(225,181,77,.55);
  background: rgba(117,78,11,.45);
  color: #f8d987;
}

.by-message.is-role-silver .by-message-avatar {
  border-color: rgba(188,204,224,.5);
  background: rgba(83,100,122,.42);
  color: #e2ebf7;
}

.by-message.is-role-visitor .by-message-avatar {
  border-color: rgba(145,157,175,.25);
  background: rgba(91,103,121,.18);
  color: var(--by-muted);
}

html[data-by-theme="slate"] {
  --by-ink: #202c3a;
  --by-navy: #263648;
  --by-panel: #2b3b4e;
  --by-panel-2: #33465c;
  --by-surface: #3d526a;
  --by-line: rgba(220,232,245,.17);
  --by-line-strong: rgba(227,194,116,.48);
  --by-text: #f8fbff;
  --by-muted: #ccd7e4;
  --by-muted-2: #9eafc1;
  color-scheme: dark;
}

html[data-by-theme="slate"] body.by-v9 {
  background-color: #202c3a;
  background-image: linear-gradient(145deg, #202c3a 0%, #2c3d51 58%, #253547 100%);
}

html[data-by-theme="slate"] .by-live-header,
html[data-by-theme="slate"] .by-broadcast,
html[data-by-theme="slate"] .by-service-rail,
html[data-by-theme="slate"] .by-workspace,
html[data-by-theme="slate"] .by-access-card,
html[data-by-theme="slate"] .by-member-card {
  background: rgba(38,54,72,.96);
}

html[data-by-theme="sand"] {
  --by-ink: #e9e1d2;
  --by-navy: #f4efe6;
  --by-panel: #fffaf1;
  --by-panel-2: #f1e8d9;
  --by-surface: #e9decd;
  --by-line: rgba(79,61,38,.16);
  --by-line-strong: rgba(143,99,34,.42);
  --by-gold: #9a6b25;
  --by-gold-bright: #7b5016;
  --by-text: #28231d;
  --by-muted: #665d52;
  --by-muted-2: #857a6c;
  --by-shadow: 0 18px 48px rgba(67,49,27,.15);
  color-scheme: light;
}

html[data-by-theme="sand"] body.by-v9 {
  background-color: #e9e1d2;
  background-image: linear-gradient(145deg, #eee7db 0%, #e3d8c6 60%, #ebe3d6 100%);
  color: var(--by-text);
}

html[data-by-theme="sand"] .by-live-header,
html[data-by-theme="sand"] .by-broadcast,
html[data-by-theme="sand"] .by-service-rail,
html[data-by-theme="sand"] .by-workspace,
html[data-by-theme="sand"] .by-access-card,
html[data-by-theme="sand"] .by-member-card,
html[data-by-theme="sand"] .by-theme-menu,
html[data-by-theme="sand"] .by-presence-popover {
  background: rgba(255,250,241,.97);
  color: var(--by-text);
}

html[data-by-theme="sand"] .by-brand-mark,
html[data-by-theme="sand"] .by-theme-trigger,
html[data-by-theme="sand"] .by-service-grid button,
html[data-by-theme="sand"] .by-session-card,
html[data-by-theme="sand"] .by-tabs,
html[data-by-theme="sand"] .by-chat-composer,
html[data-by-theme="sand"] .by-persona-console,
html[data-by-theme="sand"] .by-persona-recent-chip,
html[data-by-theme="sand"] .by-field input,
html[data-by-theme="sand"] .by-field select,
html[data-by-theme="sand"] .by-composer-row textarea {
  background: #f4ede1;
  color: var(--by-text);
}

html[data-by-theme="sand"] .by-live-header .by-brand strong,
html[data-by-theme="sand"] .by-broadcast-head h1,
html[data-by-theme="sand"] .by-panel-head h2,
html[data-by-theme="sand"] .by-section-head h2,
html[data-by-theme="sand"] .by-message-name,
html[data-by-theme="sand"] .by-online b {
  color: #28231d;
}

html[data-by-theme="sand"] .by-btn-quiet {
  background: rgba(71,52,28,.06);
  color: #5f5548;
}

html[data-by-theme="sand"] .by-player-stage,
html[data-by-theme="sand"] .by-player-poster,
html[data-by-theme="sand"] .by-player-gate {
  background: #13171d;
  color-scheme: dark;
}

/* Keep the light theme genuinely readable instead of inheriting dark-theme whites. */
html[data-by-theme="sand"] .by-live-header {
  border-bottom-color: rgba(214, 179, 101, .25);
  background: #151b24;
  color: #f7f9fc;
}

html[data-by-theme="sand"] .by-live-header .by-header-control {
  border-color: rgba(214, 179, 101, .28);
  background: rgba(255, 255, 255, .05);
  color: #c9d4e3;
}

html[data-by-theme="sand"] .by-live-header .by-header-control:hover,
html[data-by-theme="sand"] .by-live-header .by-header-control:focus-visible,
html[data-by-theme="sand"] .by-live-header .by-header-control[aria-expanded="true"] {
  border-color: rgba(214, 179, 101, .5);
  background: rgba(214, 179, 101, .1);
  color: #efd082;
}

html[data-by-theme="sand"] .by-live-header .by-online,
html[data-by-theme="sand"] .by-live-header .by-online b {
  color: #f0d38d;
}

html[data-by-theme="sand"] .by-service-grid button {
  border-color: rgba(91, 67, 38, .2);
  background: #f5ecdf;
  color: #2d261e;
}

html[data-by-theme="sand"] .by-service-grid button:hover {
  border-color: rgba(143, 99, 34, .52);
  background: #ecdfcc;
}

html[data-by-theme="sand"] .by-service-grid button strong,
html[data-by-theme="sand"] .by-rail-insight summary strong,
html[data-by-theme="sand"] .by-session-card dd,
html[data-by-theme="sand"] .by-trend-item h3,
html[data-by-theme="sand"] .by-trend-detail h3,
html[data-by-theme="sand"] .by-support-intro b,
html[data-by-theme="sand"] .by-support-fallback h3,
html[data-by-theme="sand"] .by-activity-card h3,
html[data-by-theme="sand"] .by-resource-item h3,
html[data-by-theme="sand"] .by-process-list h3 {
  color: #2d261e;
}

html[data-by-theme="sand"] .by-service-grid button small,
html[data-by-theme="sand"] .by-rail-insight summary small,
html[data-by-theme="sand"] .by-session-card dt,
html[data-by-theme="sand"] .by-session-card dd,
html[data-by-theme="sand"] .by-panel-head em,
html[data-by-theme="sand"] .by-composer-note {
  color: #6b6053;
}

html[data-by-theme="sand"] .by-session-card,
html[data-by-theme="sand"] .by-rail-insight,
html[data-by-theme="sand"] .by-trend-item,
html[data-by-theme="sand"] .by-activity-card,
html[data-by-theme="sand"] .by-resource-item,
html[data-by-theme="sand"] .by-support-thread,
html[data-by-theme="sand"] .by-support-callback,
html[data-by-theme="sand"] .by-support-fallback {
  background: #f7efe3 !important;
  color: #2d261e;
}

html[data-by-theme="sand"] .by-tabs button { color: #64594c; }
html[data-by-theme="sand"] .by-tabs button.is-active { color: #7b5016; }
html[data-by-theme="sand"] .by-chat-feed { background: #fffaf2; }
html[data-by-theme="sand"] .by-message-name,
html[data-by-theme="sand"] .by-message-body,
html[data-by-theme="sand"] .by-detail-copy,
html[data-by-theme="sand"] .by-activity-copy { color: #302920; }
html[data-by-theme="sand"] .by-message { border-bottom-color: rgba(79, 61, 38, .12); }
html[data-by-theme="sand"] .by-message-avatar { background: #eee2d0; }

html[data-by-theme="sand"] .by-chat-composer,
html[data-by-theme="sand"] .by-support-composer,
html[data-by-theme="sand"] .by-support-staff-composer {
  background: #efe4d4;
}

html[data-by-theme="sand"] .by-composer-row textarea,
html[data-by-theme="sand"] .by-support-composer textarea,
html[data-by-theme="sand"] .by-support-callback input,
html[data-by-theme="sand"] .by-support-callback textarea,
html[data-by-theme="sand"] .by-support-staff-search input,
html[data-by-theme="sand"] .by-support-staff-compose-row textarea,
html[data-by-theme="sand"] .by-support-staff-profile-body select,
html[data-by-theme="sand"] .by-support-staff-profile-body textarea {
  border-color: rgba(79, 61, 38, .24);
  background: #fffaf2;
  color: #28231d;
}

html[data-by-theme="sand"] .by-chat-tools > button,
html[data-by-theme="sand"] .by-panel-head > button,
html[data-by-theme="sand"] .by-detail-back,
html[data-by-theme="sand"] .by-support-staff-search button,
html[data-by-theme="sand"] .by-support-staff-tools button,
html[data-by-theme="sand"] .by-support-staff-lead-form button {
  border-color: rgba(79, 61, 38, .2);
  background: #eadfce;
  color: #554838;
}

html[data-by-theme="sand"] .by-support-staff-workbench,
html[data-by-theme="sand"] .by-support-staff-queue,
html[data-by-theme="sand"] .by-support-staff-profile,
html[data-by-theme="sand"] .by-support-staff-thread {
  background: #f7efe3;
  color: #2d261e;
}

html[data-by-theme="sand"] .by-support-staff-queue-head b,
html[data-by-theme="sand"] .by-support-staff-profile-head span,
html[data-by-theme="sand"] .by-support-staff-session-body strong,
html[data-by-theme="sand"] .by-support-staff-section-title b,
html[data-by-theme="sand"] .by-support-staff-lead header strong,
html[data-by-theme="sand"] .by-support-staff-customer h3,
html[data-by-theme="sand"] .by-support-staff-placeholder b {
  color: #2d261e;
}

html[data-by-theme="sand"] .by-support-message strong,
html[data-by-theme="sand"] .by-support-composer label,
html[data-by-theme="sand"] .by-support-callback label { color: #564a3b; }
html[data-by-theme="sand"] .by-support-message p {
  border-color: rgba(79, 61, 38, .2);
  background: #fffaf2;
  color: #302920;
}

html[data-by-theme="sand"] .by-persona-select select,
html[data-by-theme="sand"] .by-emoji-popover,
html[data-by-theme="sand"] .by-quickphrase-popover,
html[data-by-theme="sand"] .by-colorbar-popover,
html[data-by-theme="sand"] .by-dialog,
html[data-by-theme="sand"] .by-toast {
  border-color: rgba(79, 61, 38, .24);
  background: #fffaf2;
  color: #302920;
}

html[data-by-theme="sand"] .by-emoji-head b,
html[data-by-theme="sand"] .by-dialog h2,
html[data-by-theme="sand"] .by-schedule-table tbody th {
  color: #302920;
}

html[data-by-theme="sand"] .by-emoji-popover button,
html[data-by-theme="sand"] .by-quickphrase-popover button,
html[data-by-theme="sand"] .by-colorbar-popover button,
html[data-by-theme="sand"] .by-support-staff-lead,
html[data-by-theme="sand"] .by-support-staff-session:hover,
html[data-by-theme="sand"] .by-support-staff-session.is-active,
html[data-by-theme="sand"] .by-schedule-table tbody th {
  background: #efe4d4;
  color: #3a3025;
}

html[data-by-theme="sand"] .by-support-staff-session-body small,
html[data-by-theme="sand"] .by-support-staff-session-body em,
html[data-by-theme="sand"] .by-support-staff-section-title small,
html[data-by-theme="sand"] .by-support-staff-lead p,
html[data-by-theme="sand"] .by-support-staff-lead > small,
html[data-by-theme="sand"] .by-support-staff-customer p,
html[data-by-theme="sand"] .by-support-staff-placeholder small {
  color: #6b6053;
}

html[data-by-theme="sand"] .by-support-staff-lead-form select,
html[data-by-theme="sand"] .by-support-staff-lead-form input {
  border-color: rgba(79, 61, 38, .24);
  background: #fffaf2;
  color: #302920;
}

/* BAOYING_R13_SAND_CONTRAST_FIX: warm sand keeps text at WCAG-readable contrast. */
html[data-by-theme="sand"] .by-header-meta,
html[data-by-theme="sand"] .by-header-room {
  color: #f7f9fc;
}

html[data-by-theme="sand"] .by-player-poster > span,
html[data-by-theme="sand"] .by-player-gate > span,
html[data-by-theme="sand"] .by-player-state,
html[data-by-theme="sand"] .by-guest-player-notice p,
html[data-by-theme="sand"] .by-guest-player-gate p {
  color: #dbe5f2;
}

html[data-by-theme="sand"] .by-line-state {
  border-color: rgba(28, 113, 73, .32);
  background: rgba(28, 113, 73, .12);
  color: #195f3e;
}

html[data-by-theme="sand"] .by-line-state[data-line-state="offair"] {
  border-color: rgba(81, 72, 62, .28);
  background: rgba(81, 72, 62, .08);
  color: #51483e;
}

html[data-by-theme="sand"] .by-chat-tool-primary > button,
html[data-by-theme="sand"] .by-chat-tool-more > summary,
html[data-by-theme="sand"] .by-chat-tool-more-body > button {
  border-color: rgba(79, 61, 38, .22);
  background: linear-gradient(180deg, #f5ebdc, #e6d9c6);
  color: #3a3025;
  box-shadow: inset 0 1px rgba(255,255,255,.62), 0 4px 12px rgba(67,49,27,.08);
}

html[data-by-theme="sand"] .by-chat-tool-primary > button:hover,
html[data-by-theme="sand"] .by-chat-tool-more > summary:hover,
html[data-by-theme="sand"] .by-chat-tool-more-body > button:hover,
html[data-by-theme="sand"] .by-chat-tool-more[open] > summary {
  border-color: rgba(123, 80, 22, .44);
  background: linear-gradient(180deg, #eadbc5, #ddceb9);
  color: #28231d;
}

html[data-by-theme="sand"] .by-message.is-role-moderator .by-message-avatar {
  border-color: rgba(138, 31, 26, .68);
  background: #7b211d;
  color: #fff0ed;
}

html[data-by-theme="sand"] .by-message.is-role-moderator .by-role-badge,
html[data-by-theme="sand"] .by-message.is-role-moderator .by-message-name {
  border-color: rgba(138, 31, 26, .34);
  background: rgba(138, 31, 26, .10);
  color: #8a1f1a;
}

html[data-by-theme="sand"] .by-message.is-role-teacher .by-message-avatar,
html[data-by-theme="sand"] .by-message.is-role-supreme .by-message-avatar {
  border-color: rgba(111, 74, 13, .68);
  background: #6f4a0d;
  color: #fff2bd;
}

html[data-by-theme="sand"] .by-message.is-role-service .by-message-avatar,
html[data-by-theme="sand"] .by-message.is-role-premium .by-message-avatar {
  border-color: rgba(86, 48, 111, .68);
  background: #56306f;
  color: #fff0ff;
}

html[data-by-theme="sand"] .by-message.is-role-diamond .by-message-avatar {
  border-color: rgba(22, 90, 121, .68);
  background: #165a79;
  color: #e6f8ff;
}

html[data-by-theme="sand"] .by-message.is-role-gold .by-message-avatar {
  border-color: rgba(107, 74, 14, .68);
  background: #6b4a0e;
  color: #fff2bd;
}

html[data-by-theme="sand"] .by-message.is-role-silver .by-message-avatar {
  border-color: rgba(80, 91, 106, .58);
  background: #505b6a;
  color: #f4f8ff;
}

html[data-by-theme="sand"] .by-message.is-role-visitor .by-message-avatar {
  border-color: rgba(81, 72, 62, .28);
  background: #e6dac8;
  color: #51483e;
}

@media (max-width: 767px) {
  .by-live-header .by-brand strong { font-size: 15px; }
  .by-live-header .by-header-actions .by-header-control { min-width: 64px; height: 44px; min-height: 44px; padding: 0 11px; font-size: 11px; }
  .by-live-header .by-header-actions .by-theme-trigger { width: 44px; min-width: 44px; padding: 0; }
  .by-theme-trigger span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .by-theme-trigger svg { width: 18px; height: 18px; }
  .by-theme-menu { position: fixed; top: calc(58px + env(safe-area-inset-top)); right: 8px; width: min(280px, calc(100vw - 16px)); }
  .by-player-fullscreen { top: 8px; right: 8px; width: 40px; min-height: 36px; padding: 0; }
  .by-player-fullscreen span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .by-player-fullscreen svg { width: 17px; height: 17px; }
  .by-player-stage { height: auto; aspect-ratio: 16 / 9; }
  .by-player-brand-lockup { gap: 8px; margin-bottom: 4px; }
  .by-player-brand-lockup .by-brand-mark { width: 34px; height: 34px; font-size: 14px; }
  .by-player-brand-lockup strong { font-size: 15px; }
  .by-player-brand-lockup small { font-size: 7px; }
  .by-message-avatar { font-size: 9px; }
}

@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
  .by-player-stage { width: 100%; height: min(56.25vw, calc(100dvh - 50px)); aspect-ratio: 16 / 9; }
}

@media (prefers-reduced-motion: reduce) {
  .by-player-fullscreen,
  .by-theme-trigger,
  .by-theme-menu > button { transition: none; }
}

/* BAOYING_R15_THEME_CONTRAST_CLOSEOUT
   Applies the verified warm-sand/slate contrast closeout. The [data-tool-kind]
   rules intentionally use !important because baoying_v979_closeout.css does too. */
html[data-by-theme="sand"] [data-tool-kind] {
  background: linear-gradient(180deg, #f5ebdc, #e6d9c6) !important;
  border-color: rgba(79, 61, 38, .24) !important;
  color: #3a3025 !important;
}
html[data-by-theme="sand"] [data-tool-kind]:hover {
  background: linear-gradient(180deg, #eadbc5, #ddceb9) !important;
}
html[data-by-theme="sand"] [data-tool-kind="emoji"] .by-tool-icon { color: #6b4a12; }
html[data-by-theme="sand"] [data-tool-kind="quick"] .by-tool-icon { color: #1f5a8a; }
html[data-by-theme="sand"] [data-tool-kind="color"] .by-tool-icon { color: #6b3fa0; }
html[data-by-theme="sand"] [data-tool-kind="image"] .by-tool-icon,
html[data-by-theme="sand"] [data-tool-kind="capture"] .by-tool-icon { color: #1f6b45; }
html[data-by-theme="sand"] .by-chat-tool-more-body {
  background: rgba(255, 253, 248, .98);
  border-color: rgba(79, 61, 38, .18);
}
html[data-by-theme="slate"] .by-message.is-role-moderator .by-role-badge,
html[data-by-theme="slate"] .by-message.is-role-moderator .by-message-name { color: #ff9a95; }
html[data-by-theme="sand"] { --by-muted-2: #6b6157; }
html[data-by-theme="sand"] .by-kicker,
html[data-by-theme="sand"] .by-card-index,
html[data-by-theme="sand"] .by-section-head > span,
html[data-by-theme="sand"] .by-panel-head > div > span,
html[data-by-theme="sand"] .by-broadcast-title > span,
html[data-by-theme="sand"] .by-session-card > span,
html[data-by-theme="sand"] .by-brand small { color: #6b4a12; }
html[data-by-theme="sand"] .by-btn-gold,
html[data-by-theme="sand"] .by-btn-primary,
html[data-by-theme="sand"] .by-player-start {
  border-color: #6b4a12;
  background: #6b4a12;
  color: #fffaf1;
}
html[data-by-theme="sand"] .by-btn-gold:hover,
html[data-by-theme="sand"] .by-btn-primary:hover,
html[data-by-theme="sand"] .by-player-start:hover {
  border-color: #54390c;
  background: #54390c;
  color: #fffaf1;
}
html[data-by-theme="sand"] .by-room-announcement { background: rgba(255,253,248,.92); }
html[data-by-theme="sand"] .by-room-announcement > b { color: #6b4a12; }
html[data-by-theme="sand"] .by-announcement-window { color: #51483e; }

.by-join-welcome { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 0 12px; border: 1px solid rgba(216,176,92,.48); border-radius: 999px; color: #f7df9a; background: linear-gradient(135deg, rgba(216,176,92,.18), rgba(255,255,255,.06)); box-shadow: 0 10px 28px rgba(0,0,0,.16); font-size: 12px; white-space: nowrap; opacity: 0; transform: translateY(-4px); transition: opacity .24s ease, transform .24s ease; }
.by-join-welcome.is-visible { opacity: 1; transform: translateY(0); }
.by-join-welcome b { color: #fff7cf; font-weight: 900; }
.by-join-welcome em { color: rgba(255,255,255,.78); font-style: normal; }
html[data-by-theme="sand"] .by-join-welcome { color: #8b5b10; background: #fff8e4; border-color: #d8b05c; box-shadow: 0 8px 22px rgba(139,91,16,.12); }
html[data-by-theme="sand"] .by-join-welcome b { color: #6d4307; }
html[data-by-theme="sand"] .by-join-welcome em { color: #7f6a48; }
@media (max-width: 760px) { .by-join-welcome { order: 4; max-width: 100%; font-size: 11px; } }

/* BAOYING_R24_ROOM_HEADER_ONLINE: room name no longer sits before the online count. */
.by-live-header .by-online-label { color: rgba(220,229,243,.72); font-size: 13px; white-space: nowrap; }
.by-live-header .by-online { display: inline-flex; align-items: baseline; gap: 5px; color: rgba(220,229,243,.78); white-space: nowrap; }
.by-live-header .by-online em { color: rgba(220,229,243,.62); font-style: normal; font-size: 12px; }
.by-entry-alert { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 0 12px; border: 1px solid rgba(216,176,92,.46); border-radius: 999px; background: linear-gradient(135deg, rgba(216,176,92,.18), rgba(255,255,255,.06)); color: #f6d782; font-size: 12px; font-weight: 900; cursor: pointer; }
.by-entry-alert[hidden] { display: none; }
.by-entry-alert b { max-width: 72px; overflow: hidden; color: #fff4ca; text-overflow: ellipsis; white-space: nowrap; }
.by-entry-alert:hover { border-color: rgba(245,205,118,.75); background: rgba(216,176,92,.22); }
.by-entry-alert-detail h3 { margin: 0 0 10px; color: #fff; }
.by-entry-alert-detail p { margin: 0; color: #dce5f3; line-height: 1.75; white-space: pre-wrap; }
.by-entry-alert-detail small { display: block; margin-top: 12px; color: rgba(220,229,243,.62); }
.by-rail-welcome.by-join-welcome { width: 100%; min-height: 76px; justify-content: center; margin-top: 12px; padding: 14px 16px; border-radius: 12px; background: radial-gradient(circle at 18% 20%, rgba(245,205,118,.28), transparent 36%), linear-gradient(135deg, rgba(216,176,92,.22), rgba(10,18,32,.92)); font-size: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.2); }
.by-rail-welcome.by-join-welcome span { color: rgba(255,255,255,.72); }
.by-rail-welcome.by-join-welcome b { font-size: 18px; }
.by-rail-welcome.by-join-welcome em { font-size: 13px; }
html[data-by-theme="sand"] .by-live-header .by-online-label,
html[data-by-theme="sand"] .by-live-header .by-online em { color: rgba(247,249,252,.72); }
html[data-by-theme="sand"] .by-entry-alert { color: #8b5b10; background: #fff8e4; border-color: #d8b05c; }
html[data-by-theme="sand"] .by-entry-alert b { color: #6d4307; }
html[data-by-theme="sand"] .by-rail-welcome.by-join-welcome { background: linear-gradient(135deg, #fff8e4, #f3e3bf); color: #8b5b10; }
html[data-by-theme="sand"] .by-rail-welcome.by-join-welcome span,
html[data-by-theme="sand"] .by-rail-welcome.by-join-welcome em { color: #7f6a48; }
@media (max-width: 760px) {
  .by-live-header .by-online-label { display: none; }
  .by-entry-alert { max-width: 96px; padding: 0 9px; font-size: 11px; }
  .by-entry-alert b { display: none; }
}


/* BAOYING_R25_SIGNAL_PUBLISH_UI */
#by-join-welcome[hidden], .by-entry-alert[hidden] { display: none !important; }
.by-signal-publish-trigger { min-height: 30px; padding: 0 12px; border: 1px solid rgba(92,209,167,.42); border-radius: 999px; background: rgba(42,178,129,.1); color: #9af0cb; font-size: 12px; font-weight: 850; cursor: pointer; white-space: nowrap; }
.by-signal-publish-trigger:hover { border-color: rgba(121,232,191,.72); background: rgba(42,178,129,.18); }
.by-signal-publish-trigger:focus-visible, .by-entry-alert:focus-visible { outline: 2px solid #f2cf7b; outline-offset: 3px; }
.by-signal-publish-dialog { width: min(680px, calc(100vw - 32px)); }
.by-signal-publish-form { padding: 0 24px 24px; }
.by-signal-publish-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; }
.by-signal-publish-actions small { max-width: 46ch; color: var(--by-muted-2); line-height: 1.6; }
.by-signal-alert-list { display: grid; gap: 12px; }
.by-signal-alert-card { border: 1px solid var(--by-line); border-radius: 9px; padding: 16px; background: rgba(14,23,37,.82); }
.by-signal-alert-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.by-signal-alert-card h3 { margin: 0; color: #fff; font-size: 18px; }
.by-signal-alert-card header p { margin: 5px 0 0; color: var(--by-muted-2); font-size: 11px; }
.by-signal-alert-card header > span { border: 1px solid rgba(216,176,92,.42); border-radius: 999px; padding: 5px 9px; color: #f6d782; font-size: 11px; font-weight: 800; }
.by-signal-alert-card dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0 0; }
.by-signal-alert-card dl > div { border: 1px solid rgba(205,218,238,.11); border-radius: 7px; padding: 9px; }
.by-signal-alert-card dt { color: var(--by-muted-2); font-size: 10px; }
.by-signal-alert-card dd { margin: 4px 0 0; color: #fff; font-weight: 850; font-variant-numeric: tabular-nums; }
.by-signal-risk { margin: 2px 0 0; color: var(--by-muted-2); font-size: 11px; line-height: 1.7; }
html[data-by-theme="sand"] .by-signal-publish-trigger { border-color: #29785c; background: #e4f4ed; color: #1f654d; }
html[data-by-theme="sand"] .by-signal-alert-card { border-color: rgba(79,61,38,.2); background: #fffaf2; }
html[data-by-theme="sand"] .by-signal-alert-card h3, html[data-by-theme="sand"] .by-signal-alert-card dd { color: #302920; }
html[data-by-theme="sand"] .by-signal-alert-card header > span { border-color: #b78b37; color: #7b5016; }
@media (max-width: 760px) {
  .by-header-meta { flex-wrap: wrap; }
  .by-signal-publish-trigger { min-height: 32px; padding: 0 9px; font-size: 11px; }
  .by-signal-publish-form { padding: 0 16px 18px; }
  .by-signal-publish-actions { align-items: stretch; flex-direction: column; }
  .by-signal-publish-actions .by-btn { width: 100%; min-height: 44px; }
  .by-signal-alert-card dl { grid-template-columns: 1fr; }
}


/* BAOYING_R26_SIGNAL_WELCOME_UI: inline signal disclosure and compact welcome stream. */
.by-signal-drawer { grid-column: 1 / -1; border: 1px solid rgba(216,176,92,.34); border-radius: 10px; padding: 16px 18px 18px; background: linear-gradient(135deg, rgba(24,32,45,.98), rgba(11,18,30,.98)); box-shadow: 0 16px 36px rgba(0,0,0,.18); }
.by-signal-drawer[hidden] { display: none; }
.by-signal-drawer > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.by-signal-drawer > header span { color: #d8b05c; font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.by-signal-drawer > header h2 { margin: 3px 0 0; color: #fff; font-size: 20px; outline: none; }
.by-signal-drawer > header p { margin: 5px 0 0; color: var(--by-muted-2); font-size: 12px; }
.by-signal-drawer > header button { min-width: 64px; min-height: 34px; border: 1px solid rgba(216,176,92,.36); border-radius: 7px; background: rgba(255,255,255,.04); color: #f6d782; cursor: pointer; }
.by-entry-alert.is-active { border-color: rgba(245,205,118,.9); background: rgba(216,176,92,.28); }
.by-signal-drawer .by-signal-alert-list { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.by-signal-drawer .by-signal-risk { grid-column: 1 / -1; }

.by-rail-welcome.by-join-welcome.by-welcome-stream { display: grid; width: 100%; min-height: 0; max-height: 106px; justify-content: stretch; gap: 5px; margin-top: 8px; padding: 0; border: 0; border-radius: 0; overflow-x: hidden; overflow-y: auto; background: transparent; box-shadow: none; opacity: 1; transform: none; transition: none; scrollbar-width: thin; scrollbar-color: rgba(216,176,92,.42) transparent; }
.by-rail-welcome.by-join-welcome.by-welcome-stream[hidden] { display: none; }
.by-welcome-row { display: flex; align-items: center; gap: 5px; min-width: 0; min-height: 30px; padding: 0 10px; border-left: 2px solid rgba(216,176,92,.72); background: linear-gradient(90deg, rgba(216,176,92,.13), rgba(216,176,92,.03)); color: rgba(255,255,255,.72); font-size: 12px; line-height: 1; opacity: 0; transform: translateY(3px); transition: opacity .2s ease, transform .2s ease; }
.by-welcome-row.is-visible { opacity: 1; transform: translateY(0); }
.by-welcome-row.is-real { border-left-color: #62d6a7; background: linear-gradient(90deg, rgba(55,166,122,.16), rgba(55,166,122,.03)); }
.by-welcome-row b { min-width: 0; overflow: hidden; color: #fff0b8; font-size: 13px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.by-welcome-row em { flex: 0 0 auto; color: rgba(255,255,255,.7); font-style: normal; }
html[data-by-theme="sand"] .by-signal-drawer { border-color: rgba(139,91,16,.28); background: #fffaf2; box-shadow: 0 12px 30px rgba(95,68,24,.1); }
html[data-by-theme="sand"] .by-signal-drawer > header h2 { color: #302920; }
html[data-by-theme="sand"] .by-signal-drawer > header button { border-color: #c59a47; background: #fff7df; color: #6d4307; }
html[data-by-theme="sand"] .by-welcome-row { color: #7f6a48; background: linear-gradient(90deg, rgba(216,176,92,.2), rgba(216,176,92,.04)); }
html[data-by-theme="sand"] .by-welcome-row b { color: #6d4307; }
html[data-by-theme="sand"] .by-welcome-row em { color: #7f6a48; }
@media (max-width: 760px) {
  .by-signal-drawer { padding: 14px; border-radius: 8px; }
  .by-signal-drawer > header { gap: 10px; }
  .by-signal-drawer > header h2 { font-size: 18px; }
  .by-signal-drawer .by-signal-alert-list { grid-template-columns: 1fr; }
  .by-rail-welcome.by-join-welcome.by-welcome-stream { max-height: 106px; }
  .by-welcome-row { min-height: 30px; padding: 0 8px; font-size: 11px; }
  .by-welcome-row b { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .by-welcome-row { transition: none; }
}

.by-rail-welcome.by-join-welcome.by-welcome-stream .by-welcome-row span { flex: 0 0 auto; color: rgba(255,255,255,.68); font-size: 11px; }
.by-rail-welcome.by-join-welcome.by-welcome-stream .by-welcome-row b { min-width: 0; overflow: hidden; color: #fff0b8; font-size: 13px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.by-rail-welcome.by-join-welcome.by-welcome-stream .by-welcome-row em { flex: 0 0 auto; color: rgba(255,255,255,.7); font-size: 11px; font-style: normal; }
html[data-by-theme="sand"] .by-rail-welcome.by-join-welcome.by-welcome-stream .by-welcome-row span,
html[data-by-theme="sand"] .by-rail-welcome.by-join-welcome.by-welcome-stream .by-welcome-row em { color: #7f6a48; }
html[data-by-theme="sand"] .by-rail-welcome.by-join-welcome.by-welcome-stream .by-welcome-row b { color: #6d4307; }
@media (max-width: 760px) {
  .by-rail-welcome.by-join-welcome.by-welcome-stream .by-welcome-row b { font-size: 12px; }
}


/* BAOYING_R27_WELCOME_CARRIERS: no manual scrolling required on desktop or mobile. */
.by-service-rail > .by-welcome-stream { position: sticky; bottom: 0; z-index: 3; margin-top: 8px; padding: 6px; border: 1px solid rgba(216,176,92,.24); border-radius: 7px; background: rgba(8,15,26,.96); box-shadow: 0 -8px 24px rgba(0,0,0,.18); }
.by-mobile-welcome-stream { display: none; }
html[data-by-theme="sand"] .by-service-rail > .by-welcome-stream { border-color: rgba(139,91,16,.25); background: rgba(255,250,242,.98); }
@media (max-width: 1099px) {
  .by-service-rail > .by-welcome-stream { display: none !important; }
  .by-mobile-welcome-stream { display: grid; flex: 0 0 auto; max-height: 106px; gap: 5px; padding: 6px 10px; overflow-x: hidden; overflow-y: auto; border-top: 1px solid rgba(216,176,92,.26); border-bottom: 1px solid rgba(216,176,92,.2); background: rgba(8,15,26,.96); scrollbar-width: thin; scrollbar-color: rgba(216,176,92,.42) transparent; }
  .by-mobile-welcome-stream[hidden] { display: none; }
  html[data-by-theme="sand"] .by-mobile-welcome-stream { background: rgba(255,250,242,.98); }
}
