/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-primary: #0e0e10;
  --bg-secondary: #18181b;
  --bg-tertiary: #1f1f23;
  --bg-hover: #26262c;
  --text-primary: #efeff1;
  --text-secondary: #adadb8;
  --text-muted: #7a7a85;
  --accent: #9147ff;
  --accent-hover: #772ce8;
  --border: #2f2f35;
  --positive: #00c853;
  --neutral: #ffc107;
  --negative: #ff5252;
  --confused: #7c4dff;
  --online: #00c853;
  --offline: #ff5252;
}

html {
  height: 100%;
}

body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* === Utility === */
.hidden { display: none !important; }

/* === Skeleton Loading === */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, #2a2a30 50%, var(--bg-tertiary) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.5s infinite ease-in-out;
  border-radius: 4px;
}

.skeleton-gauge {
  height: 90px;
  border-radius: 8px;
  margin: 8px 0;
}

.skeleton-bar {
  height: 8px;
  border-radius: 4px;
  margin: 8px 0;
}

.skeleton-dots {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 4px 0;
}

.skeleton-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.skeleton-picker-row {
  display: flex;
  gap: 8px;
  margin: 8px 0;
}

.skeleton-picker-btn {
  height: 30px;
  width: 80px;
  border-radius: 4px;
}

.skeleton-text {
  height: 14px;
  width: 60%;
  margin: 6px 0;
}

.skeleton-text.short {
  width: 35%;
}

/* === Login Screen === */
.login-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.login-screen.hidden { display: none; }

.login-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 48px 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-width: 340px;
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.login-logo-large {
  display: block;
  width: 240px;
  max-width: 100%;
  height: auto;
}

.login-logo-small {
  display: none;
  width: 48px;
  height: auto;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 8px;
}

.google-signin-container {
  min-height: 44px;
}

/* === Category Selection Screen === */
.category-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 1900;
  overflow-y: auto;
  padding: 40px 20px 60px;
}

.category-screen.hidden { display: none; }

.category-container {
  max-width: 1100px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.category-header {
  text-align: center;
  margin-bottom: 32px;
}

.category-logo {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.5px;
  margin-bottom: 16px;
}

.category-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.category-header p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 520px;
  margin: 0 auto;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  width: 100%;
  margin-bottom: 24px;
}

.category-card {
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  text-align: left;
  cursor: pointer;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: inherit;
  color: inherit;
}

.category-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(145, 71, 255, 0.15);
}

.category-card:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(145, 71, 255, 0.3);
}

.category-icon {
  font-size: 32px;
  line-height: 1;
  margin-bottom: 4px;
}

.category-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.category-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.category-examples {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}

.category-examples li {
  font-size: 12px;
  color: #b8c0de;
  padding-left: 18px;
  position: relative;
}

.category-examples li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 600;
}

.category-badge {
  font-size: 11px;
  color: var(--accent);
  background: rgba(145, 71, 255, 0.12);
  padding: 4px 10px;
  border-radius: 20px;
  margin-top: 4px;
  align-self: flex-start;
}

.btn-skip-category {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 8px 16px;
  transition: color .15s;
  font-family: inherit;
}

.btn-skip-category:hover {
  color: var(--text-primary);
}

/* === User Info (Top Bar) === */
.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 0;
  padding: 2px 10px 2px 2px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-tertiary);
  cursor: pointer;
  font-family: inherit;
}

.user-info:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.user-info:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.user-info.hidden { display: none; }

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
}

.user-name {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


.user-menu {
  position: relative;
  display: flex;
  align-items: center;
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 140px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  z-index: 80;
}

.user-menu-dropdown.hidden { display: none; }

.user-menu-item {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}

.user-menu-item:hover {
  background: var(--bg-hover);
}

/* === Modal === */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.hidden { display: none; }

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px;
  width: 400px;
  max-width: 90vw;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-content h2 {
  font-size: 20px;
  font-weight: 600;
}

.modal-content p {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.modal-content input {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}

.modal-content input:focus {
  border-color: var(--accent);
}

.error-text {
  color: var(--negative);
  font-size: 13px;
  min-height: 18px;
}

/* === Buttons === */
.btn {
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover { background: var(--bg-hover); }

.btn-icon {
  background: none;
  color: var(--text-secondary);
  font-size: 18px;
  padding: 6px 10px;
  border: none;
  cursor: pointer;
}

.btn-icon:hover { color: var(--text-primary); }

.btn-live {
  background: var(--negative);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-live:hover { background: #e04848; }

.btn-live.is-live {
  background: var(--bg-tertiary);
  border: 1px solid var(--negative);
  color: var(--negative);
}

.btn-live.is-live:hover { background: var(--negative); color: #fff; }

/* === Privacy Banner === */
.privacy-banner {
  position: sticky;
  top: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: #1a2332;
  border-bottom: 1px solid #264060;
  font-size: 12px;
  color: #8cb4e0;
  line-height: 1.4;
}

.privacy-banner svg {
  flex-shrink: 0;
  stroke: #5b9bd5;
}

.privacy-dismiss {
  flex-shrink: 0;
  margin-left: auto;
  background: none;
  border: none;
  color: #5b9bd5;
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.privacy-dismiss:hover {
  color: #8cb4e0;
}

/* === Top Bar === */
.top-bar {
  height: 50px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  line-height: 0;
  flex-shrink: 0;
}

.logo-large {
  display: block;
  width: 170px;
  max-width: 100%;
  height: auto;
}

.logo-small {
  display: none;
  width: 34px;
  height: auto;
}

.stream-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.status-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.status-badge.online { background: var(--online); color: #000; }
.status-badge.offline { background: var(--offline); color: #fff; }

.top-bar-actions {
  margin-left: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* === Main Layout === */
.layout {
  display: flex;
  flex: 1;
  min-height: 0;
}

.stream-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

/* === Video Container === */
.video-container {
  position: relative;
  background: #000;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.video-container video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.6);
}

.video-overlay.hidden { display: none; }

.stream-controls {
  display: flex;
  gap: 12px;
}

.video-delay-banner {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px 0;
  background: rgba(0,0,0,.7);
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
  z-index: 2;
}

/* === Post-Stream Overlay === */
.post-stream-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.75);
  z-index: 20;
}

.post-stream-overlay.hidden { display: none; }

.post-stream-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 340px;
  text-align: center;
}

.post-stream-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.post-stream-report {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.post-stream-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn-view-report {
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  padding: 10px 32px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: background .15s, transform .15s;
  text-decoration: none;
  display: inline-block;
}

.btn-view-report:hover {
  background: var(--accent-hover);
  transform: scale(1.05);
}

.btn-view-report.hidden { display: none; }

.btn-go-live-again {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s, color .15s;
}

.btn-go-live-again:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.post-stream-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--text-muted);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === End Stream Overlay Button === */
.btn-end-stream-overlay {
  position: absolute;
  top: 46px;
  right: 12px;
  z-index: 35;
  background: rgba(255, 82, 82, 0.85);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  pointer-events: auto;
  transition: background .15s;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.btn-end-stream-overlay:hover {
  background: rgba(255, 82, 82, 1);
}

.btn-end-stream-overlay.hidden { display: none; }

.scene-description {
  position: absolute;
  bottom: 24px;
  left: 0;
  right: 0;
  padding: 8px 12px;
  background: rgba(0,0,0,.7);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.4;
  max-height: 60px;
  overflow-y: auto;
  display: none;
}

.scene-description.visible { display: block; }

/* === Emoji Reactions === */
.reactions-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 10;
}

.emoji-reaction {
  position: absolute;
  bottom: -40px;
  font-size: 28px;
  opacity: 0;
}

.emoji-float {
  animation: emojiFloat 2s ease-out forwards;
}

@keyframes emojiFloat {
  0% {
    opacity: 1;
    transform: scale(0.5) translateY(0) translateX(0);
  }
  20% {
    opacity: 1;
    transform: scale(1) translateY(-64px) translateX(calc(var(--drift) * 0.3));
  }
  70% {
    opacity: 1;
    transform: scale(1) translateY(-224px) translateX(var(--drift));
  }
  100% {
    opacity: 0;
    transform: scale(1) translateY(-320px) translateX(var(--drift));
  }
}

/* === Coaching Nudges === */
.nudge-container {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 15;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nudge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 13px;
  color: var(--text-primary);
  animation: nudgeSlideIn 0.3s ease-out forwards;
  pointer-events: auto;
}

.nudge-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.nudge-text {
  line-height: 1.4;
}

.nudge-tip {
  background: rgba(145, 71, 255, 0.25);
  border: 1px solid rgba(145, 71, 255, 0.4);
}

.nudge-warning {
  background: rgba(255, 193, 7, 0.2);
  border: 1px solid rgba(255, 193, 7, 0.35);
}

.nudge-positive {
  background: rgba(0, 200, 83, 0.2);
  border: 1px solid rgba(0, 200, 83, 0.35);
}

.nudge-out {
  animation: nudgeSlideOut 0.3s ease-in forwards;
}

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

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

/* === Countdown Overlay === */
.countdown-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .6);
  font-size: 120px;
  font-weight: 700;
  color: white;
  z-index: 20;
  text-shadow: 0 0 40px rgba(145, 71, 255, .8), 0 0 80px rgba(145, 71, 255, .4);
}

.countdown-overlay.pop {
  animation: countPop .6s ease-out;
}

@keyframes countPop {
  0% { transform: scale(1.6); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* === Preview Banner === */
.preview-banner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.35);
  z-index: 3;
  gap: 10px;
}

.preview-banner.hidden { display: none; }

.preview-badge {
  font-size: 14px;
  font-weight: 700;
  color: var(--neutral);
  background: rgba(0,0,0,.7);
  padding: 4px 16px;
  border-radius: 4px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.preview-text {
  font-size: 12px;
  color: var(--text-secondary);
  background: rgba(0,0,0,.7);
  padding: 2px 12px;
  border-radius: 4px;
}

.btn-go-live-overlay {
  background: var(--negative);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  padding: 10px 32px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
  transition: background .15s, transform .15s;
}

.btn-go-live-overlay:hover {
  background: #e04848;
  transform: scale(1.05);
}

/* === Session Timer === */
.session-timer {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.session-timer.hidden { display: none; }

.session-timer.warning {
  color: var(--neutral);
  border-color: var(--neutral);
}

.session-timer.critical {
  color: var(--negative);
  border-color: var(--negative);
  animation: timerPulse 1s infinite;
}

@keyframes timerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .6; }
}



/* === Live Insights Drawer === */
.live-insights {
  width: 100%;
  border-top: 1px solid rgba(145, 71, 255, 0.35);
  border-bottom: 1px solid rgba(124, 58, 237, 0.42);
  box-shadow: inset 0 1px 0 rgba(196, 181, 253, 0.16), 0 8px 18px rgba(6, 10, 22, 0.35);
  background: linear-gradient(180deg, rgba(34, 16, 62, 0.85) 0%, rgba(15, 10, 30, 0.92) 100%);
}

.stream-section-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: linear-gradient(180deg, rgba(8, 12, 22, 0.98) 0%, rgba(11, 16, 28, 0.95) 100%);
  border-top: 1px solid rgba(71, 85, 105, 0.32);
  border-bottom: 1px solid rgba(71, 85, 105, 0.32);
}

.stream-section-divider::before,
.stream-section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0), rgba(99, 102, 241, 0.55), rgba(99, 102, 241, 0));
}

.stream-section-divider span {
  color: #c4b5fd;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.live-insights-toggle {
  width: 100%;
  border: 0;
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.95) 0%, rgba(107, 33, 168, 0.95) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
}

.live-insights-toggle:hover {
  filter: brightness(1.06);
}

.live-insights-chevron {
  font-size: 16px;
  line-height: 1;
  transition: transform .25s ease;
}

.live-insights.open .live-insights-chevron {
  transform: rotate(180deg);
}

.live-insights-drawer {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease;
  background: rgba(9, 12, 20, 0.95);
}

.live-insights.open .live-insights-drawer {
  max-height: min(46vh, 420px);
}

.live-insights-inner {
  padding: 10px 10px 12px;
  display: grid;
  gap: 8px;
  max-height: calc(min(46vh, 420px) - 2px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.live-insights-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.live-insights-mode {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.live-insights-mode-btn {
  border: 0;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 12px;
  cursor: pointer;
}

.live-insights-mode-btn.active {
  background: rgba(145, 71, 255, 0.28);
  color: #fff;
}

.live-insights-controls {
  display: inline-flex;
  gap: 8px;
}

.live-insights-action-btn {
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  padding: 7px 10px;
  cursor: pointer;
}

.live-insights-action-btn:hover {
  border-color: rgba(145, 71, 255, 0.7);
  color: var(--text-primary);
}

.live-insights-replay-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-insights-scrubber {
  flex: 1;
}

.live-insights-scrubber-time {
  color: var(--text-secondary);
  font-size: 12px;
  min-width: 48px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.live-insights-timeline {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(19, 22, 34, 0.95);
  padding: 6px;
}

.li-timeline-viewport {
  overflow-x: auto;
  overflow-y: hidden;
}

.li-timeline-track {
  position: relative;
  min-height: 48px;
  height: 48px;
}

.li-timeline-ticks {
  position: absolute;
  inset: 0;
}

.li-tick {
  position: absolute;
  top: 27px;
  width: 1px;
  height: 8px;
  background: rgba(148, 163, 184, 0.35);
}

.li-tick span {
  position: absolute;
  top: 8px;
  left: -16px;
  color: var(--text-muted);
  font-size: 10px;
  white-space: nowrap;
}

.li-timeline-segments {
  position: absolute;
  left: 0;
  right: 0;
  top: 2px;
  height: 22px;
}

.li-segment-bar {
  position: absolute;
  top: 0;
  height: 20px;
  border: 1px solid rgba(139, 92, 246, 0.42);
  border-radius: 5px;
  background: rgba(91, 33, 182, 0.35);
  color: #f5f3ff;
  font-size: 10px;
  padding: 0 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  cursor: pointer;
}

.li-segment-bar.active {
  background: rgba(124, 58, 237, 0.65);
  border-color: rgba(216, 180, 254, 0.95);
}

.li-segment-bar span {
  pointer-events: none;
}

.li-timeline-playhead {
  position: absolute;
  top: 0;
  width: 2px;
  height: 34px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.7);
}

.live-insights-chart {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(19, 22, 34, 0.95);
  padding: 6px;
}

.li-chart-shell {
  position: relative;
}

.li-chart-scroll {
  overflow-x: auto;
  overflow-y: hidden;
}

.li-chart-svg {
  display: block;
}

.li-grid-line {
  stroke: rgba(148, 163, 184, 0.25);
  stroke-width: 1;
}

.li-grid-tick {
  stroke: rgba(148, 163, 184, 0.35);
  stroke-width: 1;
}

.li-grid-label {
  fill: var(--text-muted);
  font-size: 10px;
}

.li-segment-boundary {
  stroke: rgba(148, 163, 184, 0.45);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.li-active-segment {
  fill: rgba(139, 92, 246, 0.15);
}

.li-chart-playhead {
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 1.5;
}

.li-chart-tooltip {
  position: absolute;
  width: 210px;
  background: rgba(7, 11, 20, 0.96);
  border: 1px solid rgba(124, 58, 237, 0.8);
  border-radius: 8px;
  padding: 8px 10px;
  color: #e2e8f0;
  font-size: 11px;
  line-height: 1.45;
  pointer-events: none;
  z-index: 3;
}

.li-chart-tooltip.hidden {
  display: none;
}

.live-insights-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.live-insights-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(19, 22, 34, 0.95);
  padding: 8px 9px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.4;
}

#live-insights-segment-panel {
  max-height: none;
  overflow: visible;
  align-self: start;
}

#live-insights-overall-panel {
  max-height: 196px;
  overflow: auto;
}

.live-insights-panel h4 {
  color: #f8fafc;
  font-size: 12px;
  margin-bottom: 6px;
}

.live-insights-panel h5 {
  color: #e2e8f0;
  font-size: 11px;
  margin: 6px 0 3px;
}

.li-panel-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.li-panel-meta strong {
  color: #f8fafc;
}

.li-panel-thumb {
  border: 1px dashed rgba(148, 163, 184, 0.5);
  border-radius: 6px;
  min-height: 52px;
  max-height: 98px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 10px;
  overflow: hidden;
  background: rgba(8, 12, 20, 0.85);
  padding: 2px;
}

#live-insights-segment-panel .li-panel-thumb {
  min-height: 78px;
  max-height: 118px;
}

.li-panel-thumb img {
  width: 100%;
  height: 92px;
  object-fit: contain;
  display: block;
}

#live-insights-segment-panel .li-panel-thumb img {
  height: 108px;
  max-height: 108px;
  object-fit: contain;
}

.li-panel-snippet {
  color: #cbd5e1;
  margin-bottom: 8px;
}

.li-panel-grid-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.li-panel-grid-metrics strong {
  color: #f8fafc;
}

.li-panel-list-wrap ul,
.li-overall-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 3px;
}

.li-panel-sentiment,
.li-panel-summary {
  margin-top: 8px;
  color: #cbd5e1;
}

@media (max-width: 900px) {
  .live-insights-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .live-insights-controls {
    width: 100%;
  }

  .live-insights-action-btn {
    flex: 1;
  }

  .live-insights-panels {
    grid-template-columns: 1fr;
  }
}

/* === Meter Container === */
.meter-container {
  background: var(--bg-secondary);
  border-top: 0;
  padding: 10px 16px 10px;
  flex-shrink: 0;
}

.meter-sections {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.meter-section {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 0;
}

.meter-section-dial {
  padding: 10px 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.meter-section-dial .meter-section-header {
  margin-bottom: 4px;
  width: 100%;
}

.meter-section-dial .meter-value-center {
  display: block;
  width: 100%;
  text-align: center;
}

.meter-section-dial .meter-gauge {
  max-width: 230px;
  max-height: 68px;
}

.meter-section-sentiment {
  padding: 10px 14px;
}

.meter-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.meter-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.2px;
}

.meter-help-anchor {
  position: relative;
  display: inline-flex;
}

.meter-value-center {
  display: inline-block;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}

.meter-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}

.meter-help:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

/* === Meter Help Popup === */
.meter-help-popup {
  position: fixed;
  left: 0;
  top: 0;
  width: min(320px, calc(100vw - 24px));
  max-height: min(380px, calc(100vh - 24px));
  overflow: auto;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}

.meter-help-popup.hidden { display: none; }

.meter-help-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.meter-help-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}

.meter-help-close:hover { color: var(--text-primary); }

.meter-help-popup p {
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.meter-help-popup p strong {
  color: var(--text-primary);
}

.meter-help-colors {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 4px;
}

.meter-help-color-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
}

.meter-help-color-row strong {
  color: var(--text-primary);
}

.meter-help-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 6px;
  margin-bottom: 4px;
}

.meter-gauge {
  width: 100%;
  max-height: 80px;
}

/* === Sentiment Bar === */
.sentiment-bar {
  display: flex;
  height: 8px;
  border-radius: 6px;
  overflow: hidden;
  margin: 6px 0 8px;
}

.sentiment-segment {
  transition: width .5s ease;
}

.sentiment-segment.positive { background: var(--positive); }
.sentiment-segment.neutral { background: var(--neutral); }
.sentiment-segment.negative { background: var(--negative); }
.sentiment-segment.confused { background: var(--confused); }

.sentiment-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

.sentiment-hint {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: auto;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot.positive { background: var(--positive); }
.dot.neutral { background: var(--neutral); }
.dot.negative { background: var(--negative); }
.dot.confused { background: var(--confused); }

/* === Persona Dots === */
.persona-dots {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.persona-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  transition: transform .2s, background .5s;
  cursor: default;
  position: relative;
}

.persona-dot:hover {
  transform: scale(1.2);
}

.persona-dot .tooltip {
  display: none;
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 400;
  white-space: nowrap;
  color: var(--text-primary);
  pointer-events: none;
}

.persona-dot:hover .tooltip { display: block; }

/* === Chat Column === */
.chat-column {
  width: 340px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
}

.btn-switch-source {
  width: 100%;
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-bottom: 1px solid var(--border);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-switch-source:hover {
  background: var(--accent-hover);
}

.btn-switch-source.hidden { display: none; }

.chat-header {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
}

.chat-count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

.chat-delay-banner {
  padding: 4px 16px;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.delay-highlight {
  color: var(--neutral);
  font-weight: 600;
}

/* === Chat Messages === */
.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--bg-hover);
  border-radius: 3px;
}

.chat-msg {
  padding: 4px 0;
  font-size: 13px;
  line-height: 1.4;
  animation: chatIn .2s ease;
}

@keyframes chatIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-msg .avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  vertical-align: middle;
  margin-right: 4px;
}

.chat-msg .username {
  font-weight: 600;
  cursor: default;
}

.chat-msg .role-tag {
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 2px;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  margin-left: 4px;
  vertical-align: middle;
}

.chat-msg .sentiment-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  vertical-align: middle;
  margin: 0 3px 0 2px;
}

.chat-msg .msg-text {
  color: var(--text-secondary);
  margin-left: 2px;
}

/* System message */
.chat-msg.system {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 8px 0;
}

/* === Chat Footer === */
.chat-footer {
  border-top: 1px solid var(--border);
  padding: 8px 16px;
  min-height: 36px;
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.typing-indicator[hidden] { display: none; }

.typing-dots span {
  animation: blink 1.4s infinite;
  font-weight: 700;
}

.typing-dots span:nth-child(2) { animation-delay: .2s; }
.typing-dots span:nth-child(3) { animation-delay: .4s; }

@keyframes blink {
  0%, 60%, 100% { opacity: .2; }
  30% { opacity: 1; }
}

/* === Scrollbar for stream column === */
.stream-column::-webkit-scrollbar {
  width: 6px;
}

.stream-column::-webkit-scrollbar-thumb {
  background: var(--bg-hover);
  border-radius: 3px;
}

/* === Mode Panel === */
.mode-toggle-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.mode-toggle-right .meter-help {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.8);
}

.mode-toggle-right .meter-help:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.5);
  color: #fff;
}

.mode-help-popup {
  position: absolute;
  bottom: 100%;
  right: 0;
  width: 300px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  z-index: 20;
  box-shadow: 0 -4px 24px rgba(0,0,0,.5);
  margin-bottom: 6px;
}

.mode-help-popup.hidden { display: none; }

.mode-help-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mode-help-item {
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.mode-help-item strong {
  color: var(--text-primary);
}

#mode-btns {
  flex-wrap: wrap;
}

/* === Audience Panel === */
.audience-panel {
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.audience-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 13px;
  color: #fff;
  background: var(--accent);
  transition: background .15s;
  position: relative;
}

.audience-toggle:hover {
  background: var(--accent-hover);
}

.audience-toggle-icon {
  stroke: #fff;
  flex-shrink: 0;
}

.audience-toggle-text {
  flex: 1;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audience-toggle-current {
  font-weight: 400;
  opacity: 0.85;
}

#audience-label {
  font-weight: 400;
}

.audience-arrow {
  font-size: 10px;
  flex-shrink: 0;
  transition: transform .2s;
  opacity: 0.8;
}

.audience-panel.open .audience-arrow {
  transform: rotate(180deg);
}

.audience-picker {
  padding: 10px 16px 14px;
  border-top: 1px solid rgba(255,255,255,0.1);
  background: var(--bg-tertiary);
  overflow-y: auto;
  max-height: min(420px, 60vh);
}

.audience-picker.hidden {
  display: none;
}

.picker-heading {
  padding: 4px 16px;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  margin: -10px -16px 10px -16px;
}

.picker-section {
  margin-bottom: 10px;
}

.picker-section:last-of-type {
  margin-bottom: 8px;
}

.picker-section.hidden {
  display: none;
}

.picker-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.picker-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.picker-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.picker-btn {
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all .15s;
  font-weight: 500;
}

.picker-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  background: var(--bg-hover);
}

.picker-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.btn-sm {
  font-size: 12px;
  padding: 5px 14px;
  width: 100%;
  margin-top: 4px;
}

.btn-load-audience {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
  border: 1px solid rgba(255,255,255,0.2);
}

.btn-load-audience:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
}

.btn-pulse {
  animation: btnPulse 2s ease-in-out infinite;
}

@keyframes btnPulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 6px 2px rgba(255,255,255,0.15);
  }
  50% {
    opacity: 0.7;
    box-shadow: 0 0 12px 4px rgba(255,255,255,0.25);
  }
}

/* === Settings Panel === */
.chat-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-settings {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color .15s, background .15s;
}

.btn-settings:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.settings-panel {
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-panel.hidden { display: none; }

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
}

.settings-label {
  user-select: none;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-hover);
  border-radius: 20px;
  transition: background .2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 16px;
  height: 16px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform .2s, background .2s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(16px);
  background: #fff;
}

/* === Pace Tracker HUD === */
.pace-overlay {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 15;
  background: rgba(30, 30, 35, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 14px;
  display: flex;
  gap: 16px;
  pointer-events: none;
}

.pace-overlay.hidden { display: none; }

.pace-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 40px;
}

.pace-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.pace-number {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.pace-good { color: var(--positive); }
.pace-warn { color: var(--neutral); }
.pace-bad { color: var(--negative); }

/* === Hand-Raise Queue === */
.hand-raise-queue {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-tertiary);
  min-height: 0;
}

.hand-raise-queue.hidden { display: none; }

.hand-raise-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px 3px 3px;
  border-radius: 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 12px;
  transition: border-color .15s, background .15s;
  animation: handIn .25s ease-out;
}

.hand-raise-item:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.hand-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

@keyframes handIn {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 1; transform: scale(1); }
}

/* === Responsive === */
@media (max-width: 768px) {
  body {
    overflow: auto;
  }

  .logo-large,
  .login-logo-large {
    display: none;
  }

  .logo-small,
  .login-logo-small {
    display: block;
  }

  .layout {
    flex-direction: column;
    flex: none;
    min-height: calc(100vh - 50px);
  }

  .meter-sections {
    grid-template-columns: 1fr;
  }

  .stream-column {
    overflow: visible;
  }

  .chat-column {
    width: 100%;
    height: auto;
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .chat-messages {
    min-height: 200px;
    max-height: 300px;
  }

  .video-container {
    aspect-ratio: auto;
    height: 40vh;
  }

  .meter-container {
    overflow: visible;
  }

  .audience-picker {
    max-height: none;
  }

  .category-screen {
    padding: 24px 16px 40px;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .category-header h2 {
    font-size: 20px;
  }
}


.stream-status-overlay {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 6;
  pointer-events: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
}

/* === App Left Nav + SaaS Insights === */
.left-nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 76px;
  background: #121219;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 14px 8px;
  gap: 10px;
  z-index: 3000;
}

.left-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  color: var(--text-muted);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 6px;
  min-height: 62px;
  transition: border-color .15s, color .15s, background .15s;
}

.left-nav-link:hover {
  color: var(--text-primary);
  border-color: #3f3f48;
  background: #1c1c25;
}

.left-nav-link.active {
  color: #fff;
  border-color: rgba(145, 71, 255, 0.8);
  background: rgba(145, 71, 255, 0.2);
}

.left-nav-link.active .left-nav-icon {
  background: #9147ff;
  color: #ffffff;
}

.left-nav-separator {
  height: 1px;
  margin: 4px 6px;
  background: linear-gradient(90deg, transparent 0%, #43485e 20%, #43485e 80%, transparent 100%);
}

.left-nav-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #232736;
  color: #e3e7fa;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2px;
  line-height: 1;
}

.left-nav-label {
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
}

body.with-left-nav .privacy-banner,
body.with-left-nav .top-bar,
body.with-left-nav .layout,
body.with-left-nav .saas-insights-page,
body.with-left-nav .email-marketing-page,
body.with-left-nav .audience-builder-page,
body.with-left-nav .docs-page {
  margin-left: 76px;
  width: calc(100% - 76px);
}

body.route-saas .privacy-banner,
body.route-saas .top-bar,
body.route-saas .layout {
  display: none;
}

body.route-builder .privacy-banner,
body.route-builder .top-bar,
body.route-builder .layout,
body.route-builder .saas-insights-page,
body.route-builder .email-marketing-page,
body.route-builder .docs-page {
  display: none;
}

body.route-docs .privacy-banner,
body.route-docs .top-bar,
body.route-docs .layout,
body.route-docs .saas-insights-page,
body.route-docs .email-marketing-page,
body.route-docs .audience-builder-page {
  display: none;
}

body.route-builder,
body.route-docs {
  overflow-y: auto;
}

.saas-insights-page {
  display: none;
  min-height: 100vh;
  background: radial-gradient(circle at 15% 0%, rgba(86, 43, 142, 0.28), transparent 45%), #0b0c11;
  color: var(--text-primary);
  overflow-y: auto;
  padding: 18px;
}

body.route-saas .saas-insights-page {
  display: block !important;
}

.email-marketing-page {
  display: none;
  min-height: 100vh;
  background: radial-gradient(circle at 15% 0%, rgba(86, 43, 142, 0.28), transparent 45%), #0b0c11;
  color: var(--text-primary);
  overflow-y: auto;
  padding: 18px;
}

body.route-email {
  overflow: hidden;
}

body.route-email .saas-insights-page,
body.route-email .audience-builder-page,
body.route-email .docs-page,
body.route-email .email-marketing-page {
  display: none !important;
}

body.route-builder .audience-builder-page {
  display: block !important;
}

body.route-docs .docs-page {
  display: block !important;
}

.saas-shell {
  max-width: 1480px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.saas-header {
  background: rgba(16, 17, 26, 0.92);
  border: 1px solid #2f3142;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  gap: 12px;
}

.saas-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.saas-header-brand img {
  width: 150px;
  height: auto;
}

.saas-header-kicker {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #a687e8;
}

.saas-header h1 {
  font-size: 24px;
}

.saas-header p {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12px;
}

.saas-header-badge {
  font-size: 11px;
  font-weight: 700;
  border: 1px solid #493279;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.25);
  color: #e6ddff;
  padding: 6px 12px;
  white-space: nowrap;
}

.saas-muted {
  color: var(--text-secondary);
  font-size: 13px;
}

.saas-empty,
.saas-setup-card,
.saas-sidebar-card,
.saas-thumb-panel,
.saas-main-feed,
.saas-step-timeline {
  background: rgba(16, 17, 26, 0.94);
  border: 1px solid #2f3142;
  border-radius: 12px;
}

.saas-setup-card {
  padding: 20px;
}

.saas-setup-card h2 {
  font-size: 22px;
  margin-bottom: 8px;
}

.saas-form-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.saas-form-grid label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.saas-form-grid input,
.saas-form-grid textarea,
.saas-form-grid select {
  background: #10131d;
  border: 1px solid #33374a;
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  padding: 9px 10px;
}

.saas-form-wide {
  grid-column: 1 / -1;
}

.saas-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.saas-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #3a3f56;
  background: #131726;
  color: #d4d9e8;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
}

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

.saas-tech-item {
  display: flex !important;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid #353a52;
  background: #121729;
  border-radius: 10px;
  padding: 8px;
}

.saas-tech-item strong {
  font-size: 12px;
  color: #e8eaf2;
}

.saas-tech-item small {
  color: #98a2be;
  font-size: 11px;
}

.saas-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.saas-status-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid #3c3f55;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  color: #d4d8e9;
  background: #151a2a;
}

.saas-status-pill.ok {
  border-color: rgba(0, 200, 83, 0.7);
  color: #7df4ae;
}

.saas-status-pill.warn {
  border-color: rgba(255, 193, 7, 0.7);
  color: #ffe59a;
}

.saas-form-actions {
  display: flex;
  justify-content: flex-end;
}

.saas-run-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
}

.saas-main-pane {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.saas-main-feed {
  overflow: hidden;
}

.saas-main-feed-media {
  position: relative;
  background: #0a0a0a;
  aspect-ratio: 16 / 8.8;
  overflow: hidden;
}

.saas-main-feed-media img,
.saas-main-feed-media video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0a0d16;
}

.saas-main-feed-media-empty {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

.saas-real-feed-empty {
  width: 100%;
  padding: 14px;
  display: grid;
  gap: 8px;
  align-content: start;
  background: radial-gradient(circle at top, rgba(26, 36, 58, 0.65), rgba(10, 14, 22, 0.95));
}

.saas-real-feed-empty h3 {
  margin: 0;
  font-size: 14px;
  color: #f2f5ff;
}

.saas-real-feed-empty p {
  margin: 0;
  font-size: 12px;
  color: #aeb8d6;
}

.saas-real-feed-debug {
  width: 100%;
  min-height: 150px;
  max-height: 210px;
  resize: vertical;
  border-radius: 8px;
  border: 1px solid #3f4a67;
  background: #0c1322;
  color: #dce6ff;
  font-size: 11px;
  line-height: 1.35;
  padding: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, monospace;
}

.saas-real-feed-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.saas-main-cursor {
  position: absolute;
  width: 0;
  height: 0;
  border-left: 9px solid #f8fbff;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.75));
  transform: translate(-50%, -50%);
  transition: left 1s linear, top 1s linear;
  pointer-events: none;
}

.saas-main-cursor::after {
  content: "";
  position: absolute;
  left: -15px;
  top: -10px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid rgba(124, 58, 237, 0.55);
  opacity: 0;
}

.saas-main-cursor.click::after {
  opacity: 1;
}

.saas-main-feed-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 5px 10px;
}

.saas-main-feed-badge.live {
  color: #0a2a13;
  background: #4fd07f;
}

.saas-main-feed-badge.done {
  color: #fff;
  background: #574f66;
}

.saas-main-feed-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.saas-main-feed-meta h2 {
  font-size: 16px;
}

.saas-main-feed-meta p {
  margin-top: 3px;
  color: #a6aec6;
  font-size: 12px;
}

.saas-main-feed-step {
  text-align: right;
  font-size: 12px;
  color: #c9d0e8;
}

.saas-main-feed-step strong {
  display: block;
  color: #8f9cc2;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.saas-step-timeline {
  padding: 12px;
}

.saas-step-timeline-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.saas-step-timeline-head h3 {
  font-size: 14px;
}

.saas-step-track {
  position: relative;
  height: 34px;
  border-radius: 8px;
  border: 1px solid #32364a;
  background: #111423;
  overflow: hidden;
}

.saas-step-bar {
  position: absolute;
  top: 4px;
  height: 26px;
  border: 1px solid #4f4b6b;
  background: #242841;
  color: #d6d9e8;
  font-size: 11px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  padding: 0 8px;
  text-align: left;
}

.saas-step-bar.active {
  border-color: #9f74ff;
  background: #47307f;
  color: #fff;
}

.saas-step-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #f5d4ff;
  box-shadow: 0 0 0 1px rgba(245, 212, 255, 0.2);
}

.saas-thumb-panel {
  padding: 12px;
}

.saas-thumb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.saas-thumb-header h3 {
  font-size: 14px;
}

.saas-thumb-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.saas-thumb-controls button {
  width: 28px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid #464b65;
  background: #14182a;
  color: #d9dff2;
  cursor: pointer;
}

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

.saas-thumb {
  border: 1px solid #3a3f57;
  border-radius: 8px;
  background: #121728;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  color: inherit;
  padding: 0;
}

.saas-thumb.selected {
  border-color: #9163ff;
  box-shadow: 0 0 0 1px rgba(145, 99, 255, 0.45);
}

.saas-thumb img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: #0a0d16;
  display: block;
}

.saas-thumb-empty {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #0e1526, #0a101f);
  color: #95a4cb;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid #232d45;
}

.saas-thumb-meta {
  padding: 6px;
  display: grid;
  gap: 4px;
}

.saas-thumb-name {
  font-size: 11px;
  color: #dce1f1;
  line-height: 1.2;
}

.saas-thumb-step {
  font-size: 10px;
  color: #9ca7c7;
}

.saas-thumb-status,
.saas-thumb-sentiment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 10px;
  padding: 2px 6px;
  width: fit-content;
}

.saas-thumb-status.stuck {
  background: rgba(255, 82, 82, 0.2);
  color: #ff8f8f;
}

.saas-thumb-status.completed {
  background: rgba(0, 200, 83, 0.22);
  color: #89f2b4;
}

.saas-thumb-status.in_step {
  background: rgba(124, 58, 237, 0.2);
  color: #ceb6ff;
}

.saas-thumb-sentiment.positive {
  background: rgba(0, 200, 83, 0.2);
  color: #8af1b5;
}

.saas-thumb-sentiment.neutral {
  background: rgba(255, 193, 7, 0.2);
  color: #ffe391;
}

.saas-thumb-sentiment.negative {
  background: rgba(255, 82, 82, 0.22);
  color: #ff9a9a;
}

.saas-thumb-sentiment.confused {
  background: rgba(124, 58, 237, 0.25);
  color: #d8c3ff;
}

.saas-sidebar {
  display: grid;
  gap: 10px;
  align-content: start;
}

.saas-sidebar-card {
  padding: 12px;
  display: grid;
  gap: 8px;
}

.saas-sidebar-card h3 {
  font-size: 14px;
}

.saas-sidebar-card p,
.saas-sidebar-card label,
.saas-sidebar-card a {
  font-size: 12px;
  color: #d6dced;
}

.saas-sidebar-card label span {
  display: block;
  margin-bottom: 5px;
  color: #9ca8c9;
}

.saas-sidebar-card select {
  width: 100%;
  background: #11162a;
  border: 1px solid #37405d;
  border-radius: 8px;
  color: #e9edf9;
  padding: 8px;
}

.saas-checkbox-row {
  display: flex !important;
  align-items: center;
  gap: 8px;
}

.saas-highlights,
.saas-agent-feedback {
  max-height: 340px;
  overflow-y: auto;
  padding-right: 2px;
}

.saas-highlights {
  display: grid;
  gap: 8px;
  align-content: start;
}

.saas-stream-empty {
  margin: 0;
  font-size: 12px;
  color: #9aa7ca;
}

.saas-highlight-item {
  border: 1px solid #38405b;
  background: #111829;
  border-radius: 10px;
  padding: 9px;
  display: grid;
  gap: 7px;
}

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

.saas-highlight-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.saas-highlight-name {
  font-size: 12px;
  font-weight: 700;
  color: #eef2ff;
}

.saas-highlight-rolelevel {
  font-size: 11px;
  color: #95a3ca;
}

.saas-highlight-time {
  font-size: 11px;
  color: #98a6cd;
  white-space: nowrap;
}

.saas-highlight-meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.saas-highlight-step,
.saas-highlight-sentiment {
  font-size: 10px;
  border-radius: 999px;
  padding: 2px 7px;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.saas-highlight-step {
  background: #1b243b;
  color: #ccd7f5;
}

.saas-highlight-sentiment.positive {
  background: rgba(0, 200, 83, 0.2);
  color: #8af1b5;
}

.saas-highlight-sentiment.negative {
  background: rgba(255, 82, 82, 0.24);
  color: #ffacac;
}

.saas-highlight-message {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: #dee6ff;
}

.saas-feedback-stream {
  display: grid;
  gap: 8px;
}

.saas-feedback-row {
  border: 1px solid #2f364b;
  border-radius: 8px;
  background: #101625;
  padding: 8px;
  display: grid;
  gap: 6px;
}

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

.saas-feedback-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.saas-feedback-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

.saas-feedback-dot.positive {
  background: #36d37e;
  box-shadow: 0 0 0 2px rgba(54, 211, 126, 0.2);
}

.saas-feedback-dot.negative {
  background: #ff6464;
  box-shadow: 0 0 0 2px rgba(255, 100, 100, 0.22);
}

.saas-feedback-name {
  font-size: 12px;
  font-weight: 700;
  color: #f0f3ff;
}

.saas-feedback-rolelevel {
  font-size: 11px;
  color: #9eabd0;
}

.saas-feedback-meta {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}

.saas-feedback-section {
  font-size: 10px;
  border-radius: 999px;
  padding: 2px 7px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: #1b2236;
  color: #c4d0ef;
}

.saas-feedback-time {
  font-size: 11px;
  color: #9aabd4;
  white-space: nowrap;
}

.saas-feedback-message {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: #e0e7fb;
}

.saas-tech-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.saas-tech-logo {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .02em;
  border: 1px solid rgba(200, 210, 245, 0.22);
  color: #edf1ff;
  background: #1b2540;
}

.saas-tech-logo.chrome {
  background: #263b24;
  color: #b6f1ad;
  border-color: rgba(122, 211, 115, 0.35);
}

.saas-tech-logo.safari {
  background: #1e3448;
  color: #9fd8ff;
  border-color: rgba(99, 176, 240, 0.38);
}

.saas-tech-logo.firefox {
  background: #472c1f;
  color: #ffd2a3;
  border-color: rgba(255, 173, 104, 0.4);
}

.saas-tech-logo.edge {
  background: #173d3b;
  color: #a5fff4;
  border-color: rgba(95, 212, 197, 0.4);
}

.saas-tech-platform,
.saas-tech-extra {
  font-size: 10px;
  color: #a8b4d8;
  line-height: 1;
}

.saas-thumb-role {
  font-size: 10px;
  color: #93a1c8;
}

.saas-thumb-tech {
  display: inline-flex;
  align-items: center;
}

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

.saas-metric-card {
  border: 1px solid #343951;
  background: rgba(18, 22, 36, 0.95);
  border-radius: 10px;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.saas-metric-card span {
  color: #95a3c8;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.saas-metric-card strong {
  font-size: 26px;
  line-height: 1;
  color: #f2f5ff;
}

@media (max-width: 1180px) {
  .saas-run-grid {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 860px) {
  .left-nav {
    width: 62px;
    padding: 10px 6px;
  }

  .left-nav-label {
    display: none;
  }

  body.with-left-nav .privacy-banner,
  body.with-left-nav .top-bar,
  body.with-left-nav .layout,
  body.with-left-nav .saas-insights-page,
  body.with-left-nav .email-marketing-page,
  body.with-left-nav .audience-builder-page,
body.with-left-nav .docs-page {
    margin-left: 62px;
    width: calc(100% - 62px);
  }

  .saas-form-grid,
  .saas-tech-grid,
  .saas-sidebar {
    grid-template-columns: 1fr;
  }

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

  .saas-metrics-strip {
    grid-template-columns: 1fr;
  }
}

/* SaaS run control updates */
.saas-header-run-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.saas-run-btn {
  border: 1px solid #4b5070;
  background: #1a2036;
  color: #e7ecff;
  border-radius: 8px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.saas-run-btn:hover {
  border-color: #6f76a3;
}

.saas-run-btn.danger {
  border-color: rgba(255, 82, 82, 0.55);
  color: #ffb0b0;
  background: rgba(95, 27, 27, 0.45);
}

.saas-run-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.saas-main-feed-badge.paused {
  color: #f6e9a8;
  background: #4a3f1f;
}

.saas-main-feed-url {
  margin-top: 4px;
  display: block;
  color: #93a6d2;
  font-size: 11px;
  font-style: normal;
}

.saas-thumb-url {
  color: #97a9d4;
  font-size: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  opacity: 0.9;
}


/* === Audience Builder === */
.ab-shell {
  max-width: 1480px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.ab-header {
  background: rgba(16, 17, 26, 0.92);
  border: 1px solid #2f3142;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
}

.ab-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ab-header-brand img {
  width: 150px;
  height: auto;
}

.ab-kicker {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #a687e8;
}

.ab-header h1 {
  font-size: 24px;
}

.ab-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(520px, 1.35fr);
  gap: 14px;
}

.ab-card {
  background: rgba(13, 14, 21, 0.95);
  border: 1px solid #2f3142;
  border-radius: 12px;
  padding: 14px;
}

.ab-card h2,
.ab-card h3 {
  font-size: 15px;
  margin-bottom: 10px;
}

.ab-muted {
  color: var(--text-secondary);
  font-size: 12px;
}

.ab-audience-list {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
}

.ab-audience-item {
  border: 1px solid #36384a;
  border-radius: 10px;
  padding: 10px;
  background: #151726;
  cursor: pointer;
}

.ab-audience-item.active {
  border-color: #8e57ff;
  background: rgba(145, 71, 255, 0.16);
}

.ab-item-name {
  font-size: 13px;
  font-weight: 700;
}

.ab-item-meta {
  margin-top: 4px;
  color: #a8aabc;
  font-size: 11px;
}

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

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

.ab-field.full {
  grid-column: 1 / -1;
}

.ab-label {
  color: #cfd2e4;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.ab-input,
.ab-select,
.ab-textarea {
  width: 100%;
  background: #12131d;
  border: 1px solid #333549;
  color: #f6f7ff;
  border-radius: 8px;
  padding: 10px;
  font-size: 13px;
}

.ab-textarea {
  min-height: 90px;
  resize: vertical;
}

.ab-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ab-chip {
  border: 1px solid #3b3f5a;
  background: #181a2a;
  color: #d9dcf1;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.ab-chip.active {
  border-color: #8d5cff;
  background: rgba(145, 71, 255, 0.22);
  color: #fff;
}

.ab-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ab-btn {
  border: 1px solid #3d4058;
  background: #1b1e2f;
  color: #f5f6ff;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.ab-btn.primary {
  border-color: #8f58ff;
  background: linear-gradient(90deg, #7f45f2, #9f57ff);
}

.ab-btn.danger {
  border-color: #7a3a52;
  background: #3b1c28;
}

.ab-api-box {
  background: #11131f;
  border: 1px solid #313448;
  border-radius: 10px;
  padding: 10px;
  overflow: auto;
}

.ab-api-box pre {
  margin: 0;
  color: #e3e6fa;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre;
}

.ab-observability {
  max-height: 260px;
  overflow: auto;
  display: grid;
  gap: 8px;
}

.ab-log-item {
  border: 1px solid #35384d;
  border-radius: 10px;
  padding: 9px;
  background: #131624;
}

.ab-log-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #b5b8ca;
  font-size: 11px;
}

.ab-log-body {
  margin-top: 6px;
  color: #ecefff;
  font-size: 12px;
}

.ab-analyze-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ab-json {
  max-height: 280px;
  overflow: auto;
  background: #10121b;
  border: 1px solid #2f3347;
  border-radius: 8px;
  padding: 10px;
  color: #e8ebff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  line-height: 1.5;
  white-space: pre-wrap;
}

@media (max-width: 1200px) {
  .ab-grid,
  .ab-analyze-grid {
    grid-template-columns: 1fr;
  }
}

/* === Email Marketing Insights === */
.emi-shell {
  max-width: 1520px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.emi-live-shell {
  max-width: 1540px;
  margin: 0 auto;
}

.emi-live-layout {
  display: grid;
  grid-template-columns: minmax(760px, 1.45fr) minmax(420px, 0.9fr);
  gap: 14px;
}

.emi-main-column {
  display: grid;
  gap: 14px;
}

.emi-side-column {
  display: grid;
  gap: 14px;
  align-content: start;
}

.emi-stage-card {
  border: 1px solid #2f3446;
  border-radius: 12px;
  background: rgba(16, 20, 34, 0.95);
  box-shadow: 0 10px 24px rgba(2, 6, 20, 0.34);
  overflow: hidden;
}

.emi-stage-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #2d3446;
  background: rgba(12, 15, 25, 0.72);
}

.emi-stage-kicker {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9eb1de;
  font-weight: 700;
}

.emi-stage-top h1 {
  margin: 6px 0 0;
  font-size: 24px;
  color: #eef3ff;
}

.emi-stage-top-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.emi-user-pill {
  font-size: 11px;
  color: #c7d4f7;
  border: 1px solid #3a425a;
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(21, 26, 40, 0.95);
}

.emi-muted {
  color: #aebad9;
  font-size: 12px;
  line-height: 1.4;
}

body.email-live-shell #stream-video,
body.email-live-shell #frame-canvas,
body.email-live-shell #reactions-container,
body.email-live-shell #video-overlay,
body.email-live-shell #post-stream-overlay,
body.email-live-shell #preview-banner,
body.email-live-shell #btn-end-stream-overlay,
body.email-live-shell #scene-description,
body.email-live-shell #nudge-container,
body.email-live-shell #pace-overlay,
body.email-live-shell .video-delay-banner,
body.email-live-shell .chat-delay-banner,
body.email-live-shell #hand-raise-queue,
body.email-live-shell #typing-indicator,
body.email-live-shell #settings-btn,
body.email-live-shell #settings-panel {
  display: none !important;
}

body.email-live-shell .video-container {
  background: radial-gradient(circle at 8% 8%, rgba(60, 80, 130, 0.32), rgba(9, 11, 20, 0.98) 52%);
}

.emi-stage-host {
  position: absolute;
  inset: 0;
  z-index: 6;
  overflow: auto;
  padding: 14px;
}

.emi-stage-host.emi-awaiting-email {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 30% 24%, rgba(111, 150, 255, 0.18), rgba(11, 16, 31, 0.08) 46%),
    radial-gradient(circle at 72% 74%, rgba(83, 225, 196, 0.14), rgba(11, 16, 31, 0.05) 50%);
  animation: emiAwaitingPulse 2.2s ease-in-out infinite;
}

.emi-stage-host.emi-email-loaded {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.emi-stage-host::-webkit-scrollbar {
  width: 8px;
}

.emi-stage-host::-webkit-scrollbar-thumb {
  background: rgba(108, 122, 160, 0.5);
  border-radius: 999px;
}

.emi-stage-overlay-card {
  width: min(980px, 96%);
  max-width: 980px;
  margin: 0;
  border: 1px solid #3a4463;
  border-radius: 12px;
  background: rgba(11, 16, 31, 0.92);
  box-shadow: 0 12px 28px rgba(2, 8, 22, 0.46);
  padding: 28px;
  text-align: center;
}

.emi-stage-overlay-title {
  color: #cddafc;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-transform: none;
  line-height: 1.15;
  margin-bottom: 8px;
}

.emi-stage-inline-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 0;
  flex: 0 0 auto;
}

.emi-stage-inline-bar .emi-address-actions {
  margin-top: 0;
}

.emi-preview-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 12px 0;
  background: linear-gradient(180deg, #f9fbff 0%, #f1f5fb 100%);
}

.emi-preview-group {
  border: 1px solid #d6deee;
  background: #ffffff;
  border-radius: 8px;
  padding: 8px;
  display: grid;
  gap: 6px;
}

.emi-preview-group-label {
  font-size: 10px;
  font-weight: 700;
  color: #5c6b8d;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.emi-preview-group-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.emi-preview-btn {
  border: 1px solid #d2dbef;
  background: #f7f9ff;
  color: #334155;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 8px;
  cursor: pointer;
}

.emi-preview-btn:hover {
  border-color: #9fb4e4;
}

.emi-preview-btn.active {
  border-color: #5f76b5;
  background: #e9effd;
  color: #1d2f59;
}

.emi-ask-panel {
  display: grid;
  gap: 8px;
}

.emi-audience-status-inline {
  margin-top: 6px;
}

.chat-msg.emi-chat-msg {
  display: grid;
  grid-template-columns: auto auto auto 1fr;
  column-gap: 6px;
  row-gap: 4px;
  align-items: center;
}

.chat-msg.emi-chat-msg .msg-text {
  grid-column: 2 / -1;
  margin-left: 0;
  color: #d4deef;
}

.chat-msg.emi-chat-msg .emi-comment-context {
  grid-column: 2 / -1;
  display: block;
  width: 100%;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #77829d;
  background: #586177;
  color: #f8fbff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.emi-chat-marker {
  width: 4px;
  height: 18px;
  border-radius: 999px;
  display: inline-block;
}

@keyframes emiAwaitingPulse {
  0% {
    box-shadow: inset 0 0 0 0 rgba(121, 158, 255, 0.08);
    filter: brightness(0.98);
  }
  50% {
    box-shadow: inset 0 0 0 28px rgba(121, 158, 255, 0.14);
    filter: brightness(1.04);
  }
  100% {
    box-shadow: inset 0 0 0 0 rgba(121, 158, 255, 0.08);
    filter: brightness(0.98);
  }
}

.emi-stage-wrap {
  position: relative;
  min-height: 540px;
  max-height: 640px;
  overflow: auto;
  background: #0f1525;
}

.emi-stage-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(11, 15, 28, 0.84) 0%, rgba(11, 15, 28, 0.9) 100%);
  padding: 18px;
}

.emi-stage-overlay.hidden {
  display: none;
}

.emi-overlay-panel {
  width: min(640px, 100%);
  border: 1px solid #454f6b;
  border-radius: 12px;
  background: rgba(13, 18, 31, 0.95);
  padding: 16px;
  text-align: center;
}

.emi-overlay-title {
  color: #d8e2ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.emi-overlay-session {
  margin-top: 10px;
  color: #d6e0ff;
  font-size: 12px;
}

.emi-email-preview {
  padding: 12px;
}

.emi-email-card {
  border: 1px solid #cfd8ea;
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 10px 18px rgba(4, 10, 26, 0.15);
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.emi-email-meta {
  border-bottom: 1px solid #d8e1ee;
  background: linear-gradient(180deg, #ffffff 0%, #f4f7fc 100%);
  padding: 12px;
  color: #1e2a44;
  display: grid;
  gap: 4px;
  font-size: 12px;
}

.emi-email-body {
  padding: 14px;
  display: grid;
  gap: 10px;
  background: #ffffff;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.emi-email-render-body {
  padding: 10px;
  background: #ecf2fb;
}

.emi-email-preview-shell {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.emi-email-preview-frame {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: var(--emi-preview-ratio, 16 / 10);
  min-height: 300px;
  border: 1px solid #d1dbee;
  border-radius: 12px;
  overflow: hidden;
  background: #f8fbff;
}

.emi-device-phone .emi-email-preview-frame {
  width: min(100%, 430px);
}

.emi-email-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

.emi-email-overlays {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.emi-email-body::-webkit-scrollbar {
  width: 10px;
}

.emi-email-body::-webkit-scrollbar-thumb {
  background: rgba(90, 105, 148, 0.45);
  border-radius: 999px;
}

.emi-empty-email {
  padding: 36px 20px;
  text-align: center;
  color: #384a71;
}

.emi-empty-email h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.emi-empty-email p {
  margin: 0;
  color: #5f7098;
}

.emi-email-block {
  position: relative;
  border: 1px solid #d4deee;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(241, 245, 255, 0.55);
  padding: 12px 12px 14px;
  min-height: 90px;
}

.emi-email-block.active {
  border-color: rgba(196, 181, 253, 0.95);
}

.emi-email-section-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 8px;
}

.emi-email-block-index {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #5e6e9c;
  text-transform: uppercase;
}

.emi-section-pill {
  border-radius: 999px;
  border: 1px solid var(--tone);
  color: #1a253f;
  background: var(--tone-soft);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
}

.emi-email-block p {
  color: #1f2b43;
  font-size: 13px;
  line-height: 1.45;
  white-space: normal;
}

.emi-overlay-btn {
  position: absolute;
  border: 2px solid var(--tone);
  border-radius: 8px;
  background: color-mix(in srgb, var(--tone-bg) 82%, transparent);
  color: #0f1b31;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex;
  justify-content: flex-start;
  align-items: flex-start;
  padding: 4px 6px;
  opacity: 0.82;
  cursor: pointer;
  transition: opacity .15s ease, transform .12s ease, box-shadow .12s ease;
  pointer-events: auto;
  z-index: 3;
  overflow: hidden;
}

.emi-overlay-btn.hidden {
  opacity: 0;
  pointer-events: none;
}

.emi-overlay-btn:hover,
.emi-overlay-btn.active {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--tone) 55%, white);
}

.emi-overlay-btn.main-cta {
  border-width: 3px;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--tone) 55%, #fff);
}

.emi-overlay-btn.main-cta span::before {
  content: 'CTA';
  display: inline-block;
  margin-right: 6px;
  padding: 1px 4px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--tone) 82%, #fff);
  color: #0e172b;
  font-size: 9px;
  letter-spacing: 0.02em;
}

.emi-overlay-btn span {
  background: color-mix(in srgb, var(--tone) 24%, white);
  border: 1px solid color-mix(in srgb, var(--tone) 68%, #334);
  border-radius: 6px;
  padding: 2px 6px;
  line-height: 1.15;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.emi-insights-card {
  border: 1px solid #2f3448;
  border-radius: 12px;
  background: rgba(15, 19, 30, 0.95);
  padding: 12px;
  box-shadow: 0 8px 20px rgba(5, 9, 18, 0.28);
}

.emi-insights-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #e8eefc;
  font-weight: 700;
}

.emi-insights-head-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.emi-section-insights {
  margin-top: 10px;
  max-height: 360px;
  overflow: auto;
  display: grid;
  gap: 8px;
  padding-right: 2px;
}

.emi-insight-card {
  border: 1px solid #36415f;
  border-left: 4px solid var(--tone);
  border-radius: 10px;
  background: #121a2d;
  color: #e7ecfd;
  text-align: left;
  padding: 10px;
  cursor: pointer;
  display: grid;
  gap: 8px;
}

.emi-insight-card.active {
  border-color: #8f8df5;
  box-shadow: 0 0 0 1px rgba(143, 141, 245, 0.32);
}

.emi-insight-thumb {
  border-radius: 8px;
  border: 1px solid rgba(205, 214, 245, 0.3);
  background: linear-gradient(180deg, var(--tone-soft) 0%, rgba(12, 16, 28, 0.2) 100%);
  color: #d9e4ff;
  padding: 6px;
  font-size: 11px;
  line-height: 1.35;
  min-height: 118px;
}

.emi-insight-thumb-frame {
  position: relative;
  width: 100%;
  height: 104px;
  border-radius: 6px;
  border: 1px solid rgba(213, 224, 255, 0.34);
  overflow: hidden;
  background: #f1f6ff;
}

.emi-insight-thumb-fallback {
  padding: 8px;
  color: #33415e;
  line-height: 1.35;
}

.emi-insight-thumb-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
  pointer-events: none;
}

.emi-insight-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.emi-insight-label {
  font-size: 12px;
  font-weight: 700;
  color: #f0f4ff;
}

.emi-insight-sentiment {
  font-size: 10px;
  color: #b2c4ef;
}

.emi-insight-summary,
.emi-insight-action,
.emi-insight-copy {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: #d4e0ff;
}

.emi-overall-preview-shell {
  margin: 8px 0 10px;
  border: 1px solid #354565;
  border-radius: 10px;
  overflow: hidden;
  background: #0f1525;
}

.emi-overall-preview-frame {
  width: 100%;
  height: 164px;
  border: 0;
  background: #fff;
}

.emi-chat-card {
  border: 1px solid #2f3448;
  border-radius: 12px;
  background: rgba(15, 20, 33, 0.95);
  overflow: hidden;
}

.emi-chat-feed {
  max-height: 460px;
  min-height: 320px;
}

.emi-card {
  background: rgba(19, 22, 34, 0.95);
  border: 1px solid var(--border);
  box-shadow: 0 8px 18px rgba(6, 10, 22, 0.24);
  border-radius: 12px;
  padding: 14px;
}

.emi-card h2 {
  font-size: 15px;
  margin-bottom: 6px;
}

.emi-speak-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.emi-btn {
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.emi-btn:hover {
  border-color: rgba(145, 71, 255, 0.7);
  color: var(--text-primary);
}

.emi-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.emi-btn.primary {
  border-color: rgba(145, 71, 255, 0.82);
  background: rgba(145, 71, 255, 0.28);
  color: #ffffff;
}

.emi-btn.subtle {
  border-color: #3a3d4f;
  background: rgba(15, 18, 30, 0.85);
  color: #cbd5e1;
}

.emi-field {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.emi-label {
  color: #cfd6ea;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.emi-input {
  width: 100%;
  border: 1px solid #39435e;
  background: #12182a;
  color: #eef4ff;
  border-radius: 8px;
  padding: 10px;
  font-size: 13px;
}

.emi-textarea {
  min-height: 78px;
  resize: vertical;
}

.emi-speech-live {
  margin-top: 10px;
  border: 1px solid #2c7fba;
  background: rgba(45, 140, 200, 0.16);
  border-radius: 8px;
  padding: 10px;
  color: #d4ecff;
  font-size: 12px;
  line-height: 1.4;
}

.emi-session-email {
  margin-top: 8px;
  display: inline-block;
  color: #ffd54f;
  font-size: 17px;
  font-weight: 800;
  background: rgba(8, 12, 20, 0.82);
  border: 1px dashed rgba(196, 181, 253, 0.75);
  border-radius: 10px;
  padding: 8px 12px;
}

.emi-session-email-display .emi-email-at {
  color: #ffffff;
}

.emi-address-actions {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.emi-track {
  margin-top: 8px;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(51, 65, 85, 0.72);
  overflow: hidden;
}

.emi-track span {
  display: block;
  height: 100%;
  width: 50%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7c3aed, #22c55e);
}

.emi-sentiment-track {
  margin-top: 8px;
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #3b4560;
}

.emi-sentiment-track span {
  min-width: 6px;
}

.emi-sentiment-track .positive {
  background: #35c36f;
}

.emi-sentiment-track .neutral {
  background: #f2c66f;
}

.emi-sentiment-track .negative {
  background: #f06a6a;
}

.emi-feed-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px;
  background: rgba(16, 21, 36, 0.92);
}

.emi-feed-item.audience {
  border-left: 4px solid var(--tone);
}

.emi-name-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.emi-comment-color {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.emi-feed-item.marketer {
  border-color: rgba(145, 71, 255, 0.8);
  background: rgba(145, 71, 255, 0.18);
}

.emi-feed-item-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  color: #dce6ff;
}

.emi-feed-item-head strong {
  font-size: 12px;
}

.emi-feed-item-head span {
  display: block;
  color: #9fb0d6;
  font-size: 11px;
}

.emi-feed-meta {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.emi-chip {
  border: 1px solid #3b445e;
  border-radius: 999px;
  font-size: 10px;
  padding: 3px 7px;
  color: #d9e3fb;
}

.emi-chip.positive {
  border-color: #299e57;
  color: #74df9b;
}

.emi-chip.neutral {
  border-color: #a78843;
  color: #f4d487;
}

.emi-chip.negative {
  border-color: #a94a4a;
  color: #ff9898;
}

.emi-feed-item p {
  margin-top: 7px;
  color: #e5edff;
  font-size: 12px;
  line-height: 1.45;
}

.emi-empty-feed {
  border: 1px dashed #3a455f;
  border-radius: 10px;
  padding: 18px 12px;
  color: #b3c0df;
  text-align: center;
  font-size: 12px;
}

.emi-focus-grid {
  display: grid;
  gap: 12px;
}

.emi-focus-value {
  display: block;
  font-size: 26px;
  color: #f0f6ff;
}

.emi-persona-dots {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.emi-persona-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #3a425a;
  background: rgba(14, 19, 32, 0.9);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 10px;
  color: #d8e3ff;
}

.emi-persona-dot-level {
  width: 7px;
  height: 7px;
  border-radius: 999px;
}

.emi-persona-dot-level.ic {
  background: #6dc0ff;
}

.emi-persona-dot-level.management {
  background: #f3c267;
}

.emi-persona-dot-level.c_suite {
  background: #9a83ff;
}

@media (max-width: 1380px) {
  .emi-live-layout {
    grid-template-columns: 1fr;
  }

  .emi-chat-feed {
    max-height: 340px;
  }

  .emi-stage-wrap {
    min-height: 420px;
  }

  .emi-preview-controls {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .emi-stage-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .emi-stage-top-right {
    width: 100%;
    justify-content: space-between;
  }
}


/* === Docs === */
.docs-shell {
  max-width: 1480px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.docs-header {
  background: rgba(16, 17, 26, 0.92);
  border: 1px solid #2f3142;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
}

.docs-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.docs-header-brand img {
  width: 150px;
  height: auto;
}

.docs-kicker {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #a687e8;
}

.docs-header h1 {
  font-size: 24px;
}

.docs-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(580px, 1.5fr);
  gap: 14px;
}

.docs-card {
  background: rgba(13, 14, 21, 0.95);
  border: 1px solid #2f3142;
  border-radius: 12px;
  padding: 14px;
}

.docs-card h2,
.docs-card h3 {
  font-size: 15px;
  margin-bottom: 10px;
}

.docs-muted {
  color: var(--text-secondary);
  font-size: 12px;
}

.docs-nav {
  display: grid;
  gap: 8px;
}

.docs-nav-btn {
  border: 1px solid #36384a;
  border-radius: 10px;
  padding: 9px 10px;
  text-align: left;
  background: #151726;
  color: #f5f7ff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.docs-nav-btn.active {
  border-color: #8e57ff;
  background: rgba(145, 71, 255, 0.18);
}

.docs-block {
  display: none;
  gap: 10px;
}

.docs-block.active {
  display: grid;
}

.docs-snippet {
  border: 1px solid #32374b;
  border-radius: 10px;
  overflow: hidden;
  background: #10121b;
}

.docs-snippet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #2f3347;
  padding: 8px 10px;
  background: #15182a;
}

.docs-snippet-title {
  font-size: 12px;
  font-weight: 700;
  color: #ebeefe;
}

.docs-copy-btn {
  border: 1px solid #3d4158;
  background: #1c1f31;
  color: #f4f7ff;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.docs-snippet pre {
  margin: 0;
  padding: 10px;
  color: #e5e9ff;
  font-size: 11px;
  line-height: 1.5;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
}

.docs-step-list {
  display: grid;
  gap: 8px;
}

.docs-step-item {
  border: 1px solid #31364c;
  border-radius: 10px;
  padding: 9px;
  background: #121526;
  color: #d8def2;
  font-size: 12px;
}

.docs-step-item strong {
  color: #f2f5ff;
}

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

@media (max-width: 1200px) {
  .docs-grid,
  .docs-mini-grid {
    grid-template-columns: 1fr;
  }
}
