:root {
  --bg-main: #070a12;
  --bg-card: #0f172a;
  --bg-card-hover: #1e293b;
  --bg-elevated: #162036;
  --border-color: rgba(255, 255, 255, 0.1);
  --border-glow: rgba(0, 242, 254, 0.25);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-cyan: #00f2fe;
  --accent-blue: #3b82f6;
  --accent-pink: #ff0050;
  --accent-purple: #a855f7;
  --accent-green: #10b981;
  --accent-yellow: #fbbf24;
  --font-base: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: var(--font-base);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ============================================================
   PIN AUTH MODAL OVERLAY
   ============================================================ */
.pin-gate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 10, 18, 0.95);
  backdrop-filter: blur(12px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.pin-gate-box {
  background: var(--bg-card);
  border: 1.5px solid var(--accent-purple);
  box-shadow: 0 0 40px rgba(168, 85, 247, 0.25);
  border-radius: 20px;
  width: 100%;
  max-width: 400px;
  padding: 28px 24px;
  text-align: center;
}

.pin-gate-box h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pin-gate-box p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 24px;
}

.pin-input-group {
  margin-bottom: 18px;
  text-align: left;
}

.pin-input-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.pin-input {
  width: 100%;
  background: #080c16;
  border: 2px solid #334155;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 4px;
  text-align: center;
  color: var(--accent-cyan);
  outline: none;
  transition: all 0.2s;
}

.pin-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.3);
}

.pin-submit-btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #000;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
}

.pin-submit-btn:active {
  transform: scale(0.98);
}

.pin-error-text {
  color: #f87171;
  font-size: 0.84rem;
  font-weight: 700;
  margin-top: 12px;
  min-height: 20px;
}

/* ============================================================
   HOST APP WRAPPER
   ============================================================ */
.host-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

/* ============================================================
   STATUS HEADER
   ============================================================ */
.host-header {
  background: #0d1322;
  border-bottom: 1px solid var(--border-color);
  padding: 6px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  z-index: 50;
}

.header-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.history-count-badge {
  background: rgba(0, 242, 254, 0.2);
  color: var(--accent-cyan);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 800;
  margin-left: 2px;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: rgba(255, 0, 80, 0.15);
  border: 1px solid rgba(255, 0, 80, 0.4);
  color: var(--accent-pink);
}

.live-badge.is-live {
  background: rgba(255, 0, 80, 0.25);
  border-color: var(--accent-pink);
}

.live-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.live-badge.is-live .dot {
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 10px var(--accent-pink); }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.host-profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #c084fc;
  font-size: 0.78rem;
  font-weight: 700;
}

.header-center-kpi {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}
.header-center-kpi::-webkit-scrollbar { display: none; }

.kpi-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.85rem;
  font-weight: 800;
}

.kpi-chip.viewers { color: #38bdf8; }
.kpi-chip.likes { color: #f472b6; }
.kpi-chip.orders { color: #34d399; }
.kpi-chip.timer { 
  background: rgba(251, 191, 36, 0.18);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #fbbf24;
  padding: 3px 8px;
  border-radius: 6px;
}
.kpi-chip.quota {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  padding: 3px 8px;
  border-radius: 6px;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.15s;
}

.btn-icon:active {
  transform: scale(0.94);
  background: rgba(255, 255, 255, 0.18);
}

.btn-icon.active {
  background: rgba(0, 242, 254, 0.2);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn-icon.ai-engine-on {
  background: rgba(168, 85, 247, 0.25) !important;
  border-color: #a855f7 !important;
  color: #c084fc !important;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
}

.btn-icon.ai-engine-off {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #94a3b8 !important;
  box-shadow: none !important;
}

/* ============================================================
   TELEPROMPTER / DIRECTION BANNER
   ============================================================ */
.direction-banner {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(24, 34, 58, 0.98));
  border-bottom: 2px solid var(--accent-cyan);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.direction-banner.urgent {
  background: linear-gradient(135deg, rgba(69, 10, 10, 0.95), rgba(40, 10, 25, 0.95));
  border-bottom-color: var(--accent-pink);
}

.direction-banner.has-new {
  animation: flash-direction 1.8s ease-out 1;
}

@keyframes flash-direction {
  0% { transform: scale(1.02); filter: brightness(1.6); box-shadow: 0 0 35px var(--accent-cyan); }
  50% { transform: scale(1); filter: brightness(1.2); }
  100% { filter: brightness(1); }
}

.direction-banner.urgent.has-new {
  animation: flash-urgent 1.8s ease-out 1;
}

@keyframes flash-urgent {
  0% { transform: scale(1.02); filter: brightness(1.8); box-shadow: 0 0 40px var(--accent-pink); }
  50% { transform: scale(1); filter: brightness(1.2); }
  100% { filter: brightness(1); }
}

.direction-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
}

.dir-meta-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.dir-meta-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.direction-source {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(0, 242, 254, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.3);
}

.direction-source.ai {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.5);
}

.direction-urgent-badge {
  background: rgba(255, 0, 80, 0.25);
  color: #ff4d79;
  border: 1px solid var(--accent-pink);
  padding: 2px 7px;
  border-radius: 4px;
}

.direction-time {
  color: var(--text-muted);
  font-weight: 600;
}

.direction-text {
  font-size: calc(var(--font-base) * 1.15);
  font-weight: 800;
  line-height: 1.35;
  color: #fff;
  letter-spacing: -0.2px;
  transition: all 0.2s ease;
}

.direction-extra-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.direction-banner.collapsed {
  padding: 5px 12px;
  gap: 2px;
}

.direction-banner.collapsed .direction-text {
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
  color: #e2e8f0;
}

.direction-banner.collapsed .direction-extra-row {
  display: none !important;
}

.dir-toggle-icon {
  font-size: 0.72rem;
  color: #94a3b8;
  transition: transform 0.2s ease;
  user-select: none;
}

.direction-banner.collapsed .dir-toggle-icon {
  transform: rotate(-90deg);
}

/* AI Mood Badge & Hype Bar in Teleprompter */
.ai-mood-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 10px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.ai-mood-badge.mood-positive {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.ai-mood-badge.mood-hype {
  background: rgba(255, 0, 80, 0.25);
  color: #ff4d79;
  border: 1px solid var(--accent-pink);
  animation: pulse-badge 1.5s infinite;
}
.ai-mood-badge.mood-complaint {
  background: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.5);
}
.ai-mood-badge.mood-neutral {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.ai-hype-group {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: 2px;
}
.ai-hype-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #94a3b8;
}
.ai-hype-val {
  font-size: 0.8rem;
  font-weight: 800;
  color: #00f2fe;
}
.ai-mini-bar {
  width: 44px;
  height: 5px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  overflow: hidden;
}
.ai-mini-fill {
  height: 100%;
  background: linear-gradient(90deg, #00f2fe, #a855f7, #ff0055);
  transition: width 0.4s ease;
}

/* Hot Topics Pills */
.ai-hot-topics-container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}
.ai-sublabel {
  font-size: 0.68rem;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.2px;
}
.ai-hot-topics-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.ai-topic-pill {
  background: rgba(168, 85, 247, 0.2);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.45);
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.ai-alerts-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ai-alert-item {
  color: #fbbf24;
  font-size: 0.72rem;
  font-weight: 700;
}

/* Floating Direction Toast for Zen Mode */
.direction-toast {
  position: fixed;
  top: 60px;
  left: 12px;
  right: 12px;
  z-index: 9999;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(24, 34, 58, 0.98));
  border: 1.5px solid var(--accent-cyan);
  border-radius: 10px;
  padding: 8px 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.7), 0 0 15px rgba(0, 242, 254, 0.3);
  animation: slide-toast-in 0.25s ease-out;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.direction-toast.urgent {
  border-color: var(--accent-pink);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.7), 0 0 20px rgba(255, 0, 80, 0.4);
}

@keyframes slide-toast-in {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Zen Mode (Chat Focus) */
.host-app.zen-mode .direction-banner,
.host-app.zen-mode .active-product-box {
  display: none !important;
}

/* Teleprompter Banner remains visible for Operator directions even if AI is off */
.host-app .direction-banner {
  display: flex !important;
}

.host-app.zen-mode #btnZenMode {
  background: rgba(0, 242, 254, 0.25);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.4);
}

/* ============================================================
   ACTIVE PRODUCT WIDGET
   ============================================================ */
.active-product-box {
  background: #0d1527;
  border-bottom: 1px solid var(--border-color);
  padding: 8px 12px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s;
}

.active-product-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.product-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.product-tag {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  flex-shrink: 0;
}

.product-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-price-stock {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.product-price {
  color: var(--accent-yellow);
  font-weight: 800;
  font-size: 0.9rem;
}

.product-stock {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
}

.product-talking-points {
  font-size: 0.85rem;
  color: #cbd5e1;
  line-height: 1.35;
  background: rgba(0, 0, 0, 0.25);
  padding: 6px 10px;
  border-radius: 6px;
  border-left: 3px solid var(--accent-green);
}

.active-product-box.collapsed .product-talking-points {
  display: none;
}

/* ============================================================
   TABS & FILTER BAR
   ============================================================ */
.filter-tabs {
  background: #090e1a;
  border-bottom: 1px solid var(--border-color);
  padding: 6px 10px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}
.filter-tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.tab-btn:active {
  transform: scale(0.96);
}

.tab-btn.active {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--accent-cyan);
  color: #fff;
  font-weight: 800;
}

.tab-btn .badge-count {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 0.7rem;
}

.tab-btn.active .badge-count {
  background: var(--accent-cyan);
  color: #000;
  font-weight: 800;
}

/* ============================================================
   COMMENT STREAM CONTAINER & COCKPIT-STYLE BUBBLES
   ============================================================ */
.comment-stream-wrapper {
  position: relative;
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.comment-stream {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scroll-behavior: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* Identical Cockpit Chat Bubble */
.cockpit-chat-bubble {
  padding: 6px 9px;
  border-radius: 8px;
  background: rgba(18, 26, 44, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.88rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: all 0.12s ease;
  position: relative;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.cockpit-chat-bubble:active {
  transform: scale(0.985);
}

.cockpit-chat-bubble:hover {
  background: rgba(30, 42, 68, 0.98);
  border-color: rgba(0, 242, 254, 0.4);
}

.cockpit-chat-bubble.is-co {
  background: rgba(251, 191, 36, 0.16) !important;
  border-left: 3.5px solid #fbbf24 !important;
  border-color: rgba(251, 191, 36, 0.55) !important;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.2) !important;
}

.cockpit-chat-bubble.is-follow {
  background: rgba(168, 85, 247, 0.15) !important;
  border-left: 3.5px solid #a855f7 !important;
  border-color: rgba(168, 85, 247, 0.5) !important;
}

.cockpit-chat-bubble.is-question {
  border-left: 3.5px solid #00f2fe !important;
  background: rgba(0, 242, 254, 0.07);
}

.repeat-count-badge {
  background: rgba(251, 191, 36, 0.25);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.5);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 800;
  margin-left: 4px;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.3);
  display: inline-flex;
  align-items: center;
  animation: pulse-repeat 0.3s ease-out;
}

@keyframes pulse-repeat {
  0% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.cockpit-chat-bubble.is-pinned {
  border: 1.5px solid #fbbf24 !important;
  background: rgba(251, 191, 36, 0.1) !important;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.25) !important;
}

.cockpit-chat-bubble.is-answered {
  opacity: 0.35 !important;
  filter: grayscale(0.6) !important;
  border-left-color: #475569 !important;
}

.bubble-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
  gap: 6px;
}

.bubble-who {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1;
}

.bubble-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #00f2fe;
  flex-shrink: 0;
  background: #1e293b;
}

.bubble-name {
  color: #00f2fe;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.1px;
  white-space: nowrap;
}

.bubble-uid {
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 600;
}

.bubble-time {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.bubble-datetime {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 0.72rem;
  line-height: 1.25;
  white-space: nowrap;
  user-select: none;
  transition: all 0.2s ease;
}

.bubble-datetime:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(56, 189, 248, 0.4);
}

.bubble-datetime .dt-date {
  color: #38bdf8;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.bubble-datetime .dt-sep {
  color: #64748b;
  font-size: 0.65rem;
  opacity: 0.8;
}

.bubble-datetime .dt-time {
  color: #f8fafc;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.3px;
}

.bubble-right-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.cockpit-chat-text {
  color: #ffffff;
  line-height: 1.35;
  word-break: break-word;
  font-size: var(--font-base, 1rem);
  font-weight: 700;
  letter-spacing: 0.2px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  margin-top: 1px;
}

.badge-answered-indicator {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(16, 185, 129, 0.22);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.5);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.25);
  user-select: none;
  white-space: nowrap;
}

.size-rec-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(168, 85, 247, 0.18);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #e9d5ff;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 800;
  margin-top: 4px;
  align-self: flex-start;
}

.size-rec-chip strong {
  color: var(--accent-cyan);
  font-size: 0.9rem;
}

/* ============================================================
   PAUSE SCROLL / NEW COMMENTS FLOATING PILL
   ============================================================ */
.scroll-resume-pill {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #000;
  font-size: 0.85rem;
  font-weight: 800;
  padding: 8px 18px;
  border-radius: 30px;
  border: none;
  box-shadow: 0 4px 20px rgba(0, 242, 254, 0.4);
  cursor: pointer;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-resume-pill:active {
  transform: translateX(-50%) scale(0.94);
}

/* ============================================================
   MODALS: DIRECTION HISTORY
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.open {
  display: flex;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.modal-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
}

.modal-body {
  padding: 14px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-item.urgent {
  border-left: 3px solid var(--accent-pink);
}

.history-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.history-item-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

/* User Chat History Modal Styles */
.user-history-dialog {
  max-width: 540px;
  max-height: 85vh;
  background: #0f172a;
  border: 1px solid rgba(0, 242, 254, 0.35);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(0, 242, 254, 0.15);
}

.user-history-header {
  background: rgba(15, 23, 42, 0.98);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 16px;
}

.user-history-ribbon {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.45);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.ribbon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.ribbon-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.ribbon-divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.1);
}

.user-history-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(8, 12, 20, 0.6);
  -webkit-overflow-scrolling: touch;
}

.user-history-card {
  padding: 9px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.15s;
}

.user-history-card.is-co {
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(251, 191, 36, 0.45);
}

.user-history-card.is-question {
  border-left: 3px solid var(--accent-cyan);
}

.btn-user-history {
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.3);
  color: var(--accent-cyan);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.btn-user-history:hover {
  background: rgba(0, 242, 254, 0.22);
  border-color: var(--accent-cyan);
  color: #fff;
}

.btn-user-history:active {
  transform: scale(0.93);
}

/* ============================================================
   RESPONSIVE MODES
   ============================================================ */

/* 1. Mode Mobile & Split View (Width <= 768px, HP & Vertical Screens) */
@media (max-width: 768px) {
  :root {
    --font-base: 15px;
  }
  .host-header {
    padding: 6px 8px;
    gap: 6px;
  }
  .header-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 5px;
    min-width: 0;
  }
  .header-left {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    flex-shrink: 0;
  }
  .live-badge {
    padding: 3px 7px;
    font-size: 0.72rem;
    white-space: nowrap;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
  }
  #liveStatusText {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .host-profile-pill {
    padding: 3px 7px;
    font-size: 0.72rem;
    white-space: nowrap;
    max-width: 95px;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
  }
  #hostNameText {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  #hostAccountText {
    display: none !important;
  }
  .header-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1 1 auto;
    justify-content: flex-end;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .header-right::-webkit-scrollbar {
    display: none;
  }
  .header-right .btn-icon {
    padding: 3px 8px;
    font-size: 0.78rem;
    height: 32px;
    min-width: 32px;
    border-radius: 7px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 242, 254, 0.25);
  }
  #btnFontDec, #btnFontInc {
    font-weight: 800;
    font-size: 0.82rem;
    background: rgba(0, 242, 254, 0.12);
    border-color: rgba(0, 242, 254, 0.35);
    color: #00f2fe;
  }
  #btnFontDec:active, #btnFontInc:active {
    background: rgba(0, 242, 254, 0.35);
    transform: scale(0.92);
  }
  .btn-wakelock-label,
  .btn-history-label,
  .btn-speed-label {
    display: none;
  }
  .header-center-kpi {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 5px 8px;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .header-center-kpi::-webkit-scrollbar {
    display: none;
  }
  .kpi-chip {
    font-size: 0.8rem;
    flex-shrink: 0;
    white-space: nowrap;
  }
  .kpi-chip.viewers {
    font-size: 0.86rem;
    font-weight: 800;
  }

  /* Direction Banner & Teleprompter Mobile (Scales with --font-base) */
  .direction-banner {
    padding: 6px 10px;
    gap: 3px;
  }
  .direction-banner.collapsed {
    padding: 4px 10px;
    gap: 2px;
  }
  .direction-text {
    font-size: calc(var(--font-base, 15px) * 1.1) !important;
    line-height: 1.3;
  }
  .direction-banner.collapsed .direction-text {
    font-size: calc(var(--font-base, 15px) * 0.85) !important;
  }

  /* Gimmick Urgency Timer Bar Mobile */
  .gimmick-timer-bar {
    margin: 4px 6px 6px 6px;
    padding: 6px 8px;
    border-radius: 10px;
  }
  .gt-digits {
    font-size: 1.55rem;
  }
  .gt-presets-row {
    gap: 3px;
  }
  .gt-preset-btn {
    padding: 3px 6px;
    min-height: 28px;
    touch-action: manipulation;
  }
  .gt-preset-btn .gt-num {
    font-size: 0.86rem;
  }
  .gt-action-btn {
    padding: 3px 7px;
  }

  /* Active Product Box Mobile */
  .active-product-box {
    padding: 5px 10px;
    gap: 4px;
  }
  .active-product-box.collapsed {
    padding: 4px 10px;
    gap: 0;
  }
  .product-name {
    font-size: 0.86rem;
  }
  .product-price {
    font-size: 0.84rem;
  }
  .product-stock {
    font-size: 0.74rem;
    padding: 1px 5px;
  }

  /* Filter Tabs Mobile */
  .filter-tabs {
    padding: 3px 8px;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .tab-btn {
    padding: 4px 8px;
    font-size: 0.74rem;
    border-radius: 6px;
    gap: 4px;
    white-space: nowrap;
    touch-action: manipulation;
  }
  .badge-count {
    padding: 1px 5px;
    font-size: 0.65rem;
  }

  /* Comment Stream & Bubbles Mobile (Scales with --font-base) */
  .comment-stream {
    padding: 4px 6px;
    gap: 4px;
  }
  .cockpit-chat-bubble {
    padding: 4px 7px;
    gap: 2px;
    border-radius: 6px;
    touch-action: manipulation;
  }
  .bubble-head {
    gap: 4px;
  }
  .bubble-avatar {
    width: 18px;
    height: 18px;
  }
  .bubble-name {
    font-size: calc(var(--font-base, 15px) * 0.82);
  }
  .bubble-uid {
    font-size: calc(var(--font-base, 15px) * 0.7);
  }
  .cockpit-chat-text {
    font-size: var(--font-base, 15px) !important;
    line-height: 1.35;
  }
  .bubble-datetime {
    font-size: 0.65rem;
  }
  .btn-user-history {
    font-size: 0.65rem;
    padding: 2px 6px;
    touch-action: manipulation;
  }
  .badge-answered-indicator {
    font-size: 0.65rem;
    padding: 1px 5px;
  }
  .chat-card {
    padding: 6px 8px;
  }
}

@media (max-width: 480px) {
  .live-badge {
    max-width: 115px;
    padding: 3px 6px;
    font-size: 0.7rem;
  }
  .host-profile-pill {
    max-width: 75px;
    padding: 3px 5px;
    font-size: 0.7rem;
  }
  .btn-ai-label {
    display: none;
  }
}

@media (max-width: 380px) {
  .live-badge {
    max-width: 95px;
  }
  .host-profile-pill {
    max-width: 65px;
  }
  .header-right .btn-icon {
    padding: 2px 5px;
    font-size: 0.72rem;
    height: 30px;
    min-width: 30px;
  }
  .kpi-chip {
    font-size: 0.74rem;
    gap: 3px;
  }
}

/* 2. Mode Wide / Second Monitor (Width >= 1024px) */
@media (min-width: 1024px) {
  :root {
    --font-base: 18px;
  }
  .host-app {
    max-width: 1600px;
    margin: 0 auto;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
  }
  .host-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 8px 18px;
  }
  .header-top-bar {
    width: auto;
    flex: 0 0 auto;
    gap: 12px;
  }
  .header-center-kpi {
    width: auto;
    flex: 1 1 auto;
    justify-content: center;
    gap: 16px;
    margin: 0 16px;
  }
  .direction-banner {
    padding: 14px 20px;
  }
  .direction-text {
    font-size: 1.5rem;
  }
  .comment-stream {
    padding: 14px 20px;
    gap: 12px;
  }
  .chat-card {
    padding: 12px 16px;
  }
}

/* ============================================================
   GIMMICK URGENCY TIMER BAR STYLING (TABLET & SPLIT VIEW READY)
   ============================================================ */
.gimmick-timer-bar {
  margin: 6px 12px 8px 12px;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(0, 242, 254, 0.25);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: all 0.3s ease;
  position: relative;
  z-index: 10;
}

.gimmick-timer-bar.is-running {
  border-color: rgba(0, 242, 254, 0.6);
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.15);
}

.gimmick-timer-bar.is-warning {
  border-color: #f59e0b;
  box-shadow: 0 0 22px rgba(245, 158, 11, 0.25);
}

.gimmick-timer-bar.is-panic {
  border-color: #ef4444;
  animation: gtPanicPulse 0.8s infinite alternate;
}

@keyframes gtPanicPulse {
  0% {
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.08);
  }
  100% {
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.85);
    background: rgba(239, 68, 68, 0.2);
  }
}

.gt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.gt-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.gt-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.4);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.gt-status {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gimmick-timer-bar.is-running .gt-status {
  color: #00f2fe;
}

.gimmick-timer-bar.is-warning .gt-status {
  color: #fbbf24;
}

.gimmick-timer-bar.is-panic .gt-status {
  color: #f87171;
  font-weight: 800;
}

.gt-controls-quick {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.gt-btn-icon {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  border-radius: 6px;
  width: 28px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.gt-btn-icon:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.gt-btn-icon.is-muted {
  opacity: 0.5;
  filter: grayscale(1);
}

.gt-btn-sm {
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 800;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.btn-gt-reset {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}

.btn-gt-reset:hover {
  background: rgba(239, 68, 68, 0.35);
  color: #fff;
}

.gt-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.gt-countdown-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-shrink: 0;
}

.gt-digits {
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, monospace;
  font-size: 1.65rem;
  font-weight: 900;
  letter-spacing: 1px;
  color: #00f2fe;
  line-height: 1;
  text-shadow: 0 0 14px rgba(0, 242, 254, 0.45);
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.gimmick-timer-bar.is-warning .gt-digits {
  color: #fbbf24;
  text-shadow: 0 0 18px rgba(251, 191, 36, 0.55);
}

.gimmick-timer-bar.is-panic .gt-digits {
  color: #ef4444;
  text-shadow: 0 0 24px rgba(239, 68, 68, 0.9);
  animation: gtDigitPulse 0.5s infinite alternate;
}

@keyframes gtDigitPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

.gt-sublabel {
  font-size: 0.58rem;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.gt-presets-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.gt-preset-btn {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 5px 9px;
  color: #cbd5e1;
  cursor: pointer;
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 32px;
  user-select: none;
}

.gt-preset-btn:hover {
  background: rgba(0, 242, 254, 0.15);
  border-color: rgba(0, 242, 254, 0.5);
  color: #fff;
  transform: translateY(-1px);
}

.gt-preset-btn:active {
  transform: translateY(1px);
}

.gt-preset-btn.active {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.3), rgba(16, 185, 129, 0.25));
  border-color: #00f2fe;
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.4);
}

.gt-preset-btn .gt-num {
  font-size: 0.95rem;
  font-weight: 800;
}

.gt-preset-btn .gt-unit {
  font-size: 0.68rem;
  font-weight: 700;
  color: #94a3b8;
}

.gt-preset-btn.active .gt-unit {
  color: #00f2fe;
}

.gt-action-btn {
  background: rgba(168, 85, 247, 0.2);
  border-color: rgba(168, 85, 247, 0.4);
  color: #c084fc;
}

.gt-action-btn:hover {
  background: rgba(168, 85, 247, 0.35);
  border-color: #c084fc;
  color: #fff;
}

.gt-progress-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}

.gt-progress-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #00f2fe, #10b981);
  border-radius: 2px;
  transition: width 0.9s linear, background 0.3s ease;
}

.gimmick-timer-bar.is-warning .gt-progress-fill {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.gimmick-timer-bar.is-panic .gt-progress-fill {
  background: #ef4444;
}

.gt-modal-chip {
  padding: 10px 6px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0, 242, 254, 0.2);
}

.gt-modal-chip:hover {
  background: rgba(0, 242, 254, 0.15);
  border-color: rgba(0, 242, 254, 0.45);
  color: #fff;
  transform: translateY(-1px);
}

.gt-modal-chip.active {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.3), rgba(59, 130, 246, 0.3));
  border-color: #00f2fe;
  color: #00f2fe;
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.4);
}

@media (max-width: 480px) {
  .gt-modal-chip {
    padding: 8px 3px;
    font-size: 0.72rem;
  }
}


