:root {
  --bg: #eaf4ff;
  --panel: #ffffff;
  --panel-soft: #f8fbff;
  --panel-tint: #eef9fd;
  --text: #111827;
  --muted: #64748b;
  --line: #d7e3ef;
  --primary: #1677ff;
  --primary-soft: #e8f1ff;
  --success: #0f9d58;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius: 10px;
  --radius-sm: 8px;
  --gap: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

body {
  padding: 12px;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.admin-shell,
.room-shell {
  display: grid;
  gap: var(--gap);
}

.room-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.room-header-main {
  display: grid;
  gap: 8px;
}

.room-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.room-topbar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.room-top-pill {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: grid;
  gap: 6px;
  text-align: center;
}

.room-top-pill span {
  font-size: 12px;
  color: var(--muted);
}

.room-top-pill strong {
  font-size: 24px;
  line-height: 1;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.brand-block {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.brand-name {
  font-size: 22px;
  font-weight: 800;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.brand-sub,
.subtle {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.session-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  font-size: 14px;
  font-weight: 700;
}

.toolbar,
.toggle-row,
.tab-strip,
.message-tools,
.order-actions,
.split-head,
.center-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stack-start {
  justify-content: flex-start;
}

.primary,
.ghost,
.tab,
.mini-button,
.tool-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: 0.15s ease;
  white-space: nowrap;
}

.primary.small,
.ghost.small,
.mini-button.small {
  padding: 8px 12px;
  border-radius: 8px;
}

.primary {
  background: var(--primary);
  color: #fff;
}

.primary:hover {
  background: #0f66dd;
}

.ghost,
.tab,
.mini-button,
.tool-card {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
}

.ghost:hover,
.tab:hover,
.mini-button:hover,
.tool-card:hover {
  border-color: #b8cae0;
  transform: translateY(-1px);
}

.tab {
  color: var(--muted);
  padding: 8px 12px;
}

.tab.is-active {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: #bdd2f2;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--gap);
}

.metric-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}

.metric-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.metric-value {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
}

.console-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(420px, 1.55fr) minmax(300px, 1fr);
  gap: var(--gap);
  align-items: start;
}

.panel {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.left-body,
.right-body,
.center-body {
  display: grid;
  gap: 12px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #f8fbff);
}

.panel-head h2 {
  margin: 0;
  font-size: 16px;
}

.panel-body {
  padding: 12px 14px 14px;
}

.left-body,
.right-body,
.center-body {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field.compact label,
.field label {
  font-size: 12px;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
}

.field textarea {
  min-height: 84px;
  resize: vertical;
}

.status-stack {
  display: grid;
  gap: 10px;
}

.status-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 4px;
}

.status-box span,
.status-box small {
  color: var(--muted);
  font-size: 12px;
}

.status-box strong {
  font-size: 18px;
}

.order-list {
  display: grid;
  gap: 10px;
}

.order-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.order-top,
.sale-card-head,
.event-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.order-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12px;
}

.chip.ok {
  color: var(--success);
  background: #ecfdf5;
  border-color: #bfe8d1;
}

.chip.warn {
  color: var(--warning);
  background: #fff7e7;
  border-color: #ffe1a3;
}

.chip.bad {
  color: var(--danger);
  background: #fef2f2;
  border-color: #f8c7c7;
}

.center-topbar {
  justify-content: flex-start;
}

.small-stat {
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.video-frame {
  position: relative;
  min-height: 420px;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.video-frame video,
.video-placeholder {
  width: 100%;
  min-height: 420px;
  display: block;
  object-fit: cover;
}

.video-placeholder {
  background: linear-gradient(180deg, #0f172a, #111827);
  color: #e5e7eb;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
}

.video-hero {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 8px;
}

.message-tools {
  gap: 10px;
  padding: 2px 0;
}

.product-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.product-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 6px;
}

.product-card span,
.product-card strong {
  display: block;
}

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

.product-card strong {
  font-size: 16px;
}

.tool-icon {
  min-width: 38px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: 0 8px;
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
  transition: 0.15s ease;
}

.tool-icon:hover {
  border-color: #a8c9ff;
  background: #eef6ff;
  color: var(--primary);
}

.message-tools {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chat-tool[data-chat-tool="clear"] {
  color: #b42318;
}

.chat-tool[data-chat-tool="checkin-start"],
.chat-tool[data-chat-tool="checkin-submit"],
.chat-tool[data-chat-tool="lottery-start"],
.chat-tool[data-chat-tool="lottery-draw"] {
  border-color: #b7ebc6;
  background: #f0fff4;
  color: #17663a;
}

.chat-tool[data-chat-tool="lottery-start"],
.chat-tool[data-chat-tool="lottery-draw"] {
  border-color: #ffd591;
  background: #fff7e6;
  color: #7a3d00;
}

.chat-tool[data-chat-tool="scripts"],
.chat-tool[data-chat-tool="marketing-start"],
.chat-tool[data-chat-tool="marketing-stop"],
.chat-tool[data-chat-tool="sensitive-words"] {
  border-color: #d3adf7;
  background: #f9f0ff;
  color: #531dab;
}

.chat-tool[data-chat-tool="marketing-stop"],
.chat-tool[data-chat-tool="sensitive-words"] {
  border-color: #ffccc7;
  background: #fff1f0;
  color: #a8071a;
}

.interaction-status {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: -4px;
}

.interaction-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--muted);
  padding: 5px 9px;
  font-size: 12px;
  line-height: 1;
}

.interaction-pill.is-active {
  border-color: #a8c9ff;
  background: #eef6ff;
  color: var(--primary);
  font-weight: 700;
}

.script-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.script-panel.is-hidden {
  display: none;
}

.script-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.script-list {
  display: grid;
  gap: 8px;
  max-height: 178px;
  overflow: auto;
}

.script-row {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.ghost.danger {
  color: #b42318;
  border-color: #ffd1d1;
  background: #fff7f7;
}

.script-row strong,
.script-row small,
.script-row p {
  display: block;
}

.script-row small {
  color: var(--muted);
  margin-top: 2px;
}

.script-row p {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
}

.sensitive-panel {
  border-color: #ffccc7;
}

.domain-panel .status-box strong,
.domain-row strong {
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.live-config-panel {
  border-style: dashed;
  background: #fbfdff;
}

.live-config-panel .status-box strong,
.live-config-panel .status-box small,
.live-config-panel .script-row strong,
.live-config-panel .script-row p {
  overflow-wrap: anywhere;
}

.live-config-panel.is-collapsed .live-config-body {
  display: none;
}

.compact-head {
  padding: 0;
}

.sensitive-row strong {
  color: #a8071a;
}

.chat-area {
  height: 164px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fcfdff, #f8fbff);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.chat-line {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
}

.chat-time {
  color: var(--muted);
  white-space: nowrap;
}

.chat-text {
  background: #eef4ff;
  border: 1px solid #d6e3ff;
  padding: 8px 10px;
  border-radius: 10px;
  line-height: 1.45;
  word-break: break-word;
}

.chat-announcement .chat-text {
  background: #fff7e6;
  border-color: #ffd591;
  color: #7a3d00;
  font-weight: 700;
}

.chat-product .chat-text {
  background: #ecfdf3;
  border-color: #b7ebc6;
  color: #17663a;
}

.chat-coupon .chat-text {
  background: #fff1f0;
  border-color: #ffccc7;
  color: #a8071a;
}

.chat-system .chat-text,
.chat-emoji .chat-text {
  background: #f6f7fb;
  border-color: var(--line);
}

.chat-card {
  display: block;
  min-width: 180px;
}

.chat-image {
  width: min(100%, 220px);
  max-height: 130px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.message-compose {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
}

.message-compose input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mini-card {
  background: var(--panel-tint);
  border: 1px solid #d5edf4;
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 6px;
}

.mini-card span,
.mini-card small {
  color: var(--muted);
  font-size: 12px;
}

.mini-card strong {
  font-size: 22px;
}

.hero-metric {
  text-align: center;
  padding: 10px 0 4px;
}

.hero-value {
  font-size: 44px;
  font-weight: 900;
  line-height: 1;
  margin-top: 8px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.tool-card {
  padding: 12px;
  font-weight: 700;
  background: #f6fbff;
}

.tool-form {
  display: grid;
  gap: 8px;
}

.tool-form select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}

.segmented {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.segment {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.segment.is-active {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: #bfd5f7;
}

.sidebar-cta {
  margin-top: 6px;
  border: 1px dashed #bfd5f7;
  border-radius: 14px;
  padding: 16px;
  display: grid;
  gap: 8px;
  place-items: center;
  background: #f8fcff;
}

.robot {
  font-size: 42px;
}

.toggle-row {
  color: var(--muted);
  font-size: 12px;
}

.switch {
  position: relative;
  display: inline-flex;
  width: 42px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 999px;
  transition: 0.15s ease;
}

.switch span::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  transition: 0.15s ease;
}

.switch input:checked + span {
  background: var(--primary);
}

.switch input:checked + span::before {
  transform: translateX(18px);
}

.empty {
  padding: 18px;
  border: 1px dashed #c7d6e6;
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
  text-align: center;
}

.toast-host {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  display: grid;
  gap: 10px;
}

.toast {
  min-width: 220px;
  max-width: 420px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  box-shadow: var(--shadow);
}

.room-grid {
  grid-template-columns: minmax(260px, 0.9fr) minmax(430px, 1.6fr) minmax(300px, 1fr);
  min-height: calc(100vh - 150px);
  align-items: stretch;
}

body[data-page="room"] {
  padding: 0;
  background: #edf4fb;
  overflow-x: hidden;
}

body[data-page="room"] .admin-shell {
  gap: 10px;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body[data-page="room"] .admin-topbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(260px, 0.9fr) auto;
  min-height: 54px;
  border-radius: 0;
  border-width: 0 0 1px;
  box-shadow: none;
  background: #e7f1fb;
  padding: 8px 28px;
}

body[data-page="room"] .brand-name {
  font-size: 20px;
}

body[data-page="room"] .brand-sub {
  color: #020617;
  font-weight: 700;
  overflow-wrap: anywhere;
}

body[data-page="room"] .live-pill {
  padding: 6px 18px;
  border-radius: 10px;
}

body[data-page="room"] .console-grid {
  padding: 0 10px;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  overflow: clip;
}

body[data-page="room"] .room-grid {
  grid-template-columns: minmax(250px, 0.92fr) minmax(360px, 1.45fr) minmax(270px, 1fr);
}

body[data-page="room"] .panel {
  border-radius: 8px;
  box-shadow: none;
}

body[data-page="room"] .panel-head {
  min-height: 50px;
  padding: 10px 14px;
  background: #fff;
}

body[data-page="room"] .panel-body {
  padding: 10px;
}

body[data-page="room"] .left-body,
body[data-page="room"] .right-body,
body[data-page="room"] .center-body {
  align-content: start;
}

body[data-page="room"] .left-pane,
body[data-page="room"] .center-pane,
body[data-page="room"] .right-pane {
  min-height: calc(100vh - 128px);
}

.workbench-audience-tabs {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.workbench-audience-tabs .status-box {
  text-align: center;
  padding: 9px 6px;
}

.workbench-audience-tabs .status-box strong {
  font-size: 20px;
}

.workbench-live-layout {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(300px, 0.95fr);
  gap: 12px;
  min-height: 560px;
}

.workbench-message-pane,
.workbench-video-pane {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}

.workbench-chat-feed {
  height: 560px;
  border: 0;
  border-radius: 0;
  background: #f8fafc;
}

.workbench-video-pane {
  display: grid;
  align-content: center;
  background: #050505;
  color: #fff;
  min-height: 560px;
}

.workbench-video {
  width: 100%;
  height: 560px;
  display: block;
  object-fit: contain;
  background: #000;
}

.workbench-video-title {
  position: absolute;
  left: 16px;
  bottom: 14px;
  color: #fff;
  font-weight: 800;
}

.workbench-video-empty {
  min-height: 560px;
  display: grid;
  place-items: center;
  gap: 8px;
  text-align: center;
  color: #cbd5e1;
}

.workbench-tools {
  padding: 8px 4px 0;
  border-top: 1px solid var(--line);
}

.workbench-compose {
  grid-template-columns: 1fr auto;
  padding-top: 4px;
}

.workbench-revenue {
  text-align: center;
  background: #dffafa;
  border-radius: 8px;
  padding: 16px 10px;
}

.workbench-revenue .hero-value {
  font-size: 44px;
}

.workbench-metrics-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.revenue-scope-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.revenue-scope-card {
  min-height: 66px;
  background: #f8fcff;
}

.revenue-scope-card strong {
  font-size: 18px;
}

.workbench-metrics-grid .mini-card {
  text-align: center;
  min-height: 70px;
}

.workbench-tool-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body[data-page="room"] .bottom-panel {
  margin: 0 10px 10px;
  border-radius: 8px;
  width: auto;
  max-width: calc(100% - 20px);
}

.room-left .left-empty {
  min-height: 420px;
  display: grid;
  place-items: center;
}

.audience-workbench {
  display: grid;
  gap: 10px;
  min-height: 0;
}

.audience-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.audience-tab {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-height: 48px;
  padding: 7px 6px;
  display: grid;
  place-items: center;
  gap: 2px;
  color: var(--muted);
  cursor: pointer;
}

.audience-tab.is-active {
  border-color: #20b8c7;
  background: #e9fbfd;
  color: var(--text);
}

.audience-tab span {
  font-size: 12px;
}

.audience-tab strong {
  font-size: 17px;
  line-height: 1;
}

.audience-filter-label,
.audience-room-row {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

.audience-search-row,
.audience-select-grid,
.audience-ops-row {
  display: grid;
  gap: 8px;
}

.audience-search-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.audience-select-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.audience-action-select,
.audience-search-row input,
.audience-select-grid select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px 10px;
  font: inherit;
  color: var(--text);
}

.audience-ops-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}

.audience-list {
  display: grid;
  gap: 8px;
  min-height: 280px;
  max-height: calc(100vh - 430px);
  overflow: auto;
  padding-right: 2px;
}

.audience-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 9px;
}

.audience-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #dffafa;
  color: #0f6f78;
  font-weight: 800;
}

.audience-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.audience-row,
.audience-meta,
.audience-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.audience-row {
  justify-content: space-between;
}

.audience-row strong,
.audience-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audience-row strong {
  font-size: 13px;
}

.audience-row span,
.audience-meta {
  color: var(--muted);
  font-size: 12px;
}

.chip.success {
  background: #e8f8ef;
  color: #167342;
}

.chip.muted {
  background: #eef2f7;
  color: #64748b;
}

.audience-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
}

.lead-groups {
  display: grid;
  gap: 12px;
}

.lead-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.lead-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lead-group-head h3 {
  margin: 0;
  font-size: 14px;
}

.lead-group-head span {
  font-size: 12px;
  color: var(--muted);
}

.lead-list {
  display: grid;
  gap: 10px;
}

.lead-card {
  background: var(--panel-soft);
}

.lead-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lead-meta {
  color: var(--muted);
  font-size: 12px;
}

.lead-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.bottom-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.bottom-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.bottom-head h3 {
  margin: 0;
  font-size: 16px;
}

.bottom-body {
  padding: 12px 14px 14px;
}

.bottom-body.is-collapsed {
  display: none;
}

.bottom-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.bottom-card {
  border: 1px dashed #c9d6e5;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  display: grid;
  gap: 6px;
}

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

.bottom-card strong {
  font-size: 16px;
}

.dashboard-block {
  display: grid;
  gap: 8px;
}

.dashboard-block + .dashboard-block {
  margin-top: 14px;
}

.dashboard-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-card {
  border: 1px dashed #c9d6e5;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 6px;
}

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

.dashboard-card strong {
  font-size: 18px;
  line-height: 1.2;
}

.dashboard-card small,
.log-row small,
.log-row p {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-logs {
  grid-column: 1 / -1;
}

.sales-link-block {
  grid-column: 1 / -1;
}

.sales-link-list {
  display: grid;
  gap: 8px;
}

.sales-link-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(360px, 2fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

.sales-link-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.sales-link-main small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sales-link-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(64px, 1fr));
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.sales-link-metrics strong {
  color: var(--text);
  font-size: 14px;
  text-align: right;
}

.log-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
}

.log-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px 10px;
  display: grid;
  gap: 3px;
}

.log-row strong,
.log-row small,
.log-row p {
  overflow-wrap: anywhere;
}

.log-row p {
  margin: 0;
}

@media (max-width: 1280px) {
  .stats-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body[data-page="room"] .admin-topbar {
    grid-template-columns: minmax(240px, 1fr) minmax(220px, 0.8fr) auto;
    padding-inline: 20px;
  }

  body[data-page="room"] .brand-name {
    font-size: 18px;
  }

  body[data-page="room"] .brand-sub,
  body[data-page="room"] .session-meta {
    font-size: 12px;
  }

  body[data-page="room"] .session-meta {
    gap: 10px;
  }

  body[data-page="room"] .primary.small,
  body[data-page="room"] .ghost.small {
    padding: 7px 10px;
  }

  .console-grid {
    grid-template-columns: minmax(230px, 0.9fr) minmax(330px, 1.4fr) minmax(250px, 1fr);
  }

  .room-grid,
  body[data-page="room"] .room-grid {
    grid-template-columns: minmax(230px, 0.9fr) minmax(330px, 1.4fr) minmax(250px, 1fr);
  }

  .room-topbar,
  .product-strip,
  .bottom-grid,
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sales-link-row {
    grid-template-columns: 1fr;
  }

  .sales-link-metrics {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .console-grid,
  .room-grid,
  body[data-page="room"] .room-grid {
    grid-template-columns: 1fr;
  }

  body[data-page="room"] .admin-topbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

@media (max-width: 760px) {
  body {
    padding: 10px;
  }

  .admin-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .session-meta {
    justify-content: flex-start;
  }

  .stats-row,
  .mini-grid,
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .room-topbar,
  .product-strip,
  .bottom-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .sales-link-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sales-link-metrics strong {
    text-align: left;
  }

  .room-header {
    flex-direction: column;
    align-items: stretch;
  }

  .message-compose {
    grid-template-columns: 1fr;
  }

  .video-frame,
  .video-frame video,
  .video-placeholder,
  .room-left .left-empty {
    min-height: 280px;
  }
}

@media (max-width: 640px) {
  .live-main {
    padding: 0 8px 80px;
  }

  .live-actions {
    padding: 8px;
  }
}
