:root {
  --bg: #eff3fb;
  --surface: #ffffff;
  --border: #d4dbe8;
  --text: #0f172a;
  --text-muted: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --outline: #94a3b8;
  --success: #16a34a;
  --error: #dc2626;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(15,23,42,0.06);
  --shadow-card: 0 6px 18px rgba(15,23,42,0.08);
  --font: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --ease-out: cubic-bezier(.2,.8,.2,1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* Flow guides (user/admin plain-language) */
.flow-guide {
  margin: 0 0 1rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.08) 0%, rgba(255, 255, 255, 0.95) 100%);
}

.flow-guide summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--primary);
  list-style-position: outside;
}

.flow-guide-body {
  margin-top: 0.65rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.flow-guide-body p {
  margin: 0.35rem 0;
}

.admin-report-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  margin-right: 0.35rem;
}

.admin-report-badge-video {
  background: rgba(37, 99, 235, 0.15);
  color: #1d4ed8;
}

.admin-report-badge-live {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}

/* Live stream — active streams dashboard */
.live-active-panel {
  background: linear-gradient(145deg, rgba(220, 38, 38, 0.07) 0%, rgba(37, 99, 235, 0.06) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem 1.1rem;
  margin-bottom: 1.1rem;
}

.live-active-panel .subheading {
  margin-top: 0;
  margin-bottom: 0.35rem;
}

.live-active-tip {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.live-active-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.live-active-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.live-stat-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
}

.live-stat-pill-you {
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary);
}

.live-stat-pill-signal.is-on {
  background: rgba(22, 163, 74, 0.14);
  color: var(--success);
}

.live-stat-pill-signal.is-off {
  background: rgba(100, 116, 139, 0.14);
  color: var(--text-muted);
}

.live-active-toolbar {
  margin-bottom: 0.85rem;
  align-items: center;
}

.live-auto-refresh-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.live-streams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.live-streams-empty {
  grid-column: 1 / -1;
  padding: 1.25rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.92rem;
  background: rgba(255, 255, 255, 0.55);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.live-stream-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 0.95rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.live-stream-card.is-joined {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.live-stream-card.is-host {
  border-color: rgba(220, 38, 38, 0.35);
}

.live-card-top {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}

.live-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border);
}

.live-card-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
}

.live-card-head-text {
  flex: 1;
  min-width: 0;
}

.live-card-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.live-card-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
  animation: live-pulse 1.4s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.65; transform: scale(0.92); }
}

.live-card-host {
  font-size: 0.98rem;
}

.live-card-sub {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.live-card-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
}

.live-card-badge-host {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}

.live-card-badge-joined {
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary);
}

.live-card-viewers {
  margin-left: auto;
  text-align: right;
  flex-shrink: 0;
}

.live-viewer-count {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--primary);
}

.live-viewer-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.live-card-meta {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.live-card-meta dt {
  margin: 0;
  color: var(--text-muted);
  font-weight: 600;
}

.live-card-meta dd {
  margin: 0.1rem 0 0;
  word-break: break-word;
}

.live-card-meta code {
  font-size: 0.75em;
}

.live-card-coords {
  color: var(--text-muted);
  font-size: 0.92em;
}

.live-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.15rem;
}

.live-activity-details {
  margin-top: 0.25rem;
  font-size: 0.88rem;
}

.live-activity-details summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.live-activity-log {
  max-height: 200px;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  font-size: 0.8rem;
}

.live-activity-row {
  padding: 0.28rem 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.live-activity-row:last-child {
  border-bottom: none;
}

.live-activity-time {
  color: var(--text-muted);
  font-size: 0.76rem;
}

.live-activity-event {
  font-weight: 700;
  color: var(--primary);
}

.live-activity-summary {
  color: var(--text);
}

/* LiveStreamParticipantsUpdated — colour-coded event badges */
.live-event-join  { color: #16a34a !important; }
.live-event-leave { color: #ea580c !important; }
.live-event-end   { color: #dc2626 !important; }

/* In-stream participant count pill (host included) */
.live-participant-count {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.08);
  border-radius: 20px;
  padding: 1px 7px;
  white-space: nowrap;
}

/* Participant IDs list in card meta */
.live-card-participant-ids {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.live-card-participant-ids code {
  font-size: 0.7em;
  word-break: break-all;
}

.live-card-participant-ids code.participant-host {
  color: #7c3aed;
  font-weight: 700;
}

/* Live stream — event linking tester */
.live-event-link-panel {
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.07) 0%, rgba(15, 23, 42, 0.04) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-bottom: 1.1rem;
}

.live-event-link-panel .subheading {
  margin-top: 0;
  margin-bottom: 0.35rem;
}

.live-event-tip {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.live-event-tip code {
  font-size: 0.82em;
  background: rgba(15, 23, 42, 0.06);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* Live stream — follow & go-live request tester */
.live-social-panel {
  background: linear-gradient(145deg, rgba(22, 163, 74, 0.08) 0%, rgba(15, 23, 42, 0.04) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-bottom: 1.1rem;
}

.live-social-panel .subheading {
  margin-top: 0;
  margin-bottom: 0.35rem;
}

.live-social-tip {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.live-social-tip code {
  font-size: 0.82em;
  background: rgba(15, 23, 42, 0.06);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.live-social-panel input[readonly] {
  background: rgba(15, 23, 42, 0.04);
  color: var(--text-muted);
}

/* Request Live test bench (Notifications §6) */
.request-live-bench {
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.09) 0%, rgba(15, 23, 42, 0.04) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem 1.2rem;
  margin-bottom: 0.75rem;
}

.request-live-bench .subheading {
  margin-top: 0;
}

.request-live-tip {
  margin-bottom: 0.85rem;
}

.request-live-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.rl-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.rl-badge-ok {
  color: #166534;
  background: #dcfce7;
  border-color: #86efac;
}

.rl-badge-warn {
  color: #92400e;
  background: #fef3c7;
  border-color: #fcd34d;
}

.rl-badge-err {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fca5a5;
}

.rl-badge-neutral {
  color: var(--text-muted);
}

.request-live-hub-user {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 0.85rem;
  word-break: break-all;
}

.request-live-actions {
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.request-live-verdict {
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  margin-bottom: 0.85rem;
  border: 1px solid var(--border);
  background: var(--surface);
}

.rl-verdict-ok {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #065f46;
}

.rl-verdict-warn {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #92400e;
}

.rl-verdict-err {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

.rl-verdict-neutral {
  color: var(--text);
}

.request-live-log-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0.5rem 0 0.35rem;
}

.request-live-log {
  min-height: 140px;
  max-height: 280px;
  overflow: auto;
  font-size: 0.78rem;
  line-height: 1.45;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  padding: 0.75rem;
  margin: 0 0 0.5rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.live-event-attach-summary {
  margin-top: 0.85rem;
  padding: 0.7rem 0.9rem;
  background: var(--surface);
  border-radius: 10px;
  border: 1px dashed var(--border);
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.live-event-attach-summary strong {
  color: var(--text);
}

.live-event-attach-summary.is-attached {
  border-color: rgba(22, 163, 74, 0.5);
  border-style: solid;
  color: #166534;
  background: rgba(22, 163, 74, 0.06);
}

.live-event-attach-summary.is-none {
  border-color: rgba(148, 163, 184, 0.6);
}

.live-event-attach-summary.is-error {
  border-color: rgba(220, 38, 38, 0.45);
  color: #b91c1c;
  background: rgba(254, 226, 226, 0.35);
}

.event-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

/* App shell (sidebar + content + request panel) */
.app-shell {
  height: 100vh;
  display: flex;
  overflow: hidden;
}

.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #0b1225 0%, #0a1021 100%);
  color: #e2e8f0;
  border-right: 1px solid rgba(148, 163, 184, 0.15);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.sidebar-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(89, 194, 248, 0.12);
  border: 1px solid rgba(89, 194, 248, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-title {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sidebar-subtitle {
  font-size: 0.8rem;
  color: rgba(226, 232, 240, 0.72);
}

.sidebar-nav {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(89, 194, 248, 0.25) transparent;
}
.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(89, 194, 248, 0.25);
  border-radius: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(89, 194, 248, 0.45);
}

.nav-item {
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.35);
  color: #e2e8f0;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.nav-item:hover {
  transform: translateY(-1px);
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(148, 163, 184, 0.24);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.45), rgba(89, 194, 248, 0.25));
  border-color: rgba(89, 194, 248, 0.35);
}

.sidebar-footer {
  margin-top: auto;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  color: rgba(226, 232, 240, 0.72);
  font-size: 0.8rem;
}

.sidebar-footer code {
  background: rgba(226, 232, 240, 0.08);
  padding: 0.05rem 0.35rem;
  border-radius: 6px;
  color: rgba(226, 232, 240, 0.92);
}

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: relative;
}

.topbar-progress {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  opacity: 0;
  background: linear-gradient(90deg, rgba(37,99,235,0), rgba(37,99,235,0.85), rgba(89,194,248,0.85), rgba(37,99,235,0));
  background-size: 200% 100%;
  animation: topbar-progress 1.1s linear infinite;
  transition: opacity 120ms var(--ease-out);
}

.topbar-progress.active {
  opacity: 1;
}

@keyframes topbar-progress {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

.topbar-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.command-bar {
  margin-top: 0.6rem;
  width: min(560px, 100%);
}

.command-bar input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.58rem 0.75rem;
  font-size: 0.88rem;
  font-family: inherit;
  background: #fff;
}

.command-bar-meta {
  margin-top: 0.25rem;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.topbar-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.topbar-right.api-bar {
  gap: 0.6rem;
}

.topbar .env-row {
  width: auto;
  margin: 0;
}

.topbar .api-bar label,
.topbar .env-label {
  color: var(--text-muted);
  opacity: 1;
}

.topbar .api-bar input {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.topbar .env-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.topbar .env-btn:hover {
  background: rgba(37, 99, 235, 0.06);
}

.topbar .env-btn.active {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.35);
  color: var(--primary);
}

.topbar .auth-pill {
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: var(--text);
}

.topbar .auth-dot {
  background: rgba(15, 23, 42, 0.35);
}

.topbar .auth-pill.logged-in .auth-dot {
  background: #16a34a;
}

.module-hidden {
  display: none !important;
}

.main-content {
  animation: fadeInUp 220ms var(--ease-out);
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.global-loader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.global-loader-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
}

.global-loader-box {
  position: relative;
  z-index: 1;
  width: min(520px, 92vw);
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.22);
  border-radius: 18px;
  padding: 1.1rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  animation: popIn 180ms var(--ease-out);
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.global-spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 4px solid rgba(37, 99, 235, 0.18);
  border-top-color: rgba(37, 99, 235, 0.9);
  border-right-color: rgba(89, 194, 248, 0.7);
  animation: spin 0.9s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.global-loader-title {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.global-loader-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.mode-auth .sidebar,
.mode-auth .last-request-panel {
  display: none !important;
}

.mode-auth .topbar {
  position: sticky;
  top: 0;
  z-index: 50;
}

.mode-auth .main-one-screen {
  flex-direction: column;
}

.mode-auth .main-one-screen .main-content {
  max-width: 980px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.mode-auth .topbar-right.api-bar {
  max-width: 760px;
}

.mode-auth .card {
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.12);
}

/* Auth landing (single card with tabs) */
.auth-landing {
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: radial-gradient(circle at 10% 0%, rgba(191, 219, 254, 0.55), transparent 42%),
              radial-gradient(circle at 90% 20%, rgba(89, 194, 248, 0.25), transparent 46%),
              var(--surface);
}

.auth-tabs {
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.03);
  margin-bottom: 1rem;
}

.auth-tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-weight: 800;
  font-size: 0.88rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 140ms var(--ease-out), color 140ms var(--ease-out), transform 140ms var(--ease-out);
}

.auth-tab:hover {
  background: rgba(37, 99, 235, 0.08);
  color: var(--text);
}

.auth-tab.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(89, 194, 248, 0.14));
  color: var(--text);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.06);
}

.sub-platform-bar {
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(37, 99, 235, 0.04);
}

.sub-platform-bar .btn-row {
  margin-top: 0.35rem;
}

.auth-panes {
  position: relative;
}

.auth-pane {
  display: none;
  animation: authPaneIn 220ms var(--ease-out);
}

.auth-pane.active {
  display: block;
}

@keyframes authPaneIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.link-btn {
  border: none;
  background: transparent;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
  padding: 0.25rem 0.2rem;
  font-family: inherit;
}

.link-btn:hover {
  text-decoration: underline;
}

.auth-foot {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.4rem;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.auth-social-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.auth-social-box {
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(255, 255, 255, 0.75);
  border-radius: 16px;
  padding: 0.9rem;
}

.auth-social-title {
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

@media (min-width: 980px) {
  .auth-social-grid {
    grid-template-columns: 1.1fr 1fr 1fr;
    align-items: start;
  }
}

/* Docs viewer */
.docs-toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.docs-toolbar .field {
  min-width: 180px;
}

.docs-toolbar select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--surface);
}

.docs-meta {
  margin-bottom: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.docs-view {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
}

.docs-render {
  padding: 1rem 1.1rem;
  max-height: 65vh;
  overflow: auto;
}

.docs-render h1, .docs-render h2, .docs-render h3 {
  letter-spacing: -0.02em;
}

.docs-render h1 { font-size: 1.35rem; margin-top: 0; }
.docs-render h2 { font-size: 1.15rem; margin-top: 1.25rem; }
.docs-render h3 { font-size: 1.0rem; margin-top: 1.1rem; }

.docs-render p, .docs-render li {
  color: var(--text);
}

.docs-render code {
  background: rgba(15, 23, 42, 0.06);
  padding: 0.05rem 0.35rem;
  border-radius: 6px;
}

.docs-render pre {
  background: #0b1225;
  color: #e2e8f0;
  padding: 0.9rem;
  border-radius: 12px;
  overflow: auto;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.docs-render pre code {
  background: transparent;
  padding: 0;
}

.docs-render a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}
.docs-render a:hover { text-decoration: underline; }

.docs-render table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.9rem;
}
.docs-render th, .docs-render td {
  border: 1px solid var(--border);
  padding: 0.45rem 0.55rem;
  text-align: left;
}
.docs-render th {
  background: rgba(15, 23, 42, 0.03);
}

@media (max-width: 900px) {
  .docs-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

.hero {
  position: relative;
  padding: 2rem 1.5rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, #bfdbfe 0%, transparent 50%),
              linear-gradient(135deg, #1d4ed8 0%, #2563eb 45%, #1e3a8a 100%);
  opacity: 0.96;
}

.hero-content {
  position: relative;
  z-index: 1;
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.brand-icon {
  font-size: 2rem;
}

.brand h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tagline {
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  background: rgba(255,255,255,0.2);
  border-radius: 999px;
  font-weight: 500;
  margin-left: 0.25rem;
}

.hero-desc {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  opacity: 0.95;
}

.api-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.env-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  margin-bottom: 0.25rem;
}

.env-label {
  font-size: 0.8rem;
  opacity: 0.9;
}

.env-buttons {
  display: flex;
  gap: 0.35rem;
}

.env-btn {
  padding: 0.4rem 0.85rem;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  background: rgba(255,255,255,0.15);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.env-btn:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.7);
}

.env-btn.active {
  background: rgba(255,255,255,0.95);
  color: var(--primary);
  border-color: rgba(255,255,255,0.95);
}

.api-bar label {
  font-size: 0.8rem;
  opacity: 0.9;
}

.api-bar input {
  flex: 1;
  min-width: 200px;
  padding: 0.5rem 0.85rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  background: rgba(255,255,255,0.95);
  color: var(--text);
}

.api-bar input::placeholder {
  color: var(--text-muted);
}

.auth-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  background: rgba(255,255,255,0.2);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
}

.auth-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
}

.auth-pill.logged-in .auth-dot {
  background: #86efac;
}

.main {
  flex: 1;
  padding: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* One-screen layout: main content left, request/response panel right */
.main-one-screen {
  flex-direction: row;
  padding: 0;
}
.main-one-screen .main-content {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 1.5rem;
}
.last-request-panel {
  width: 380px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  background: var(--bg);
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.request-panel-toggle {
  margin-left: auto;
}

.request-panel-collapsed .last-request-panel {
  width: 74px;
  padding: 0.5rem;
}

.request-panel-collapsed .last-request-panel .card-head p,
.request-panel-collapsed .last-request-panel .card-body,
.request-panel-collapsed .last-request-panel .card-head .card-icon {
  display: none;
}

.request-panel-collapsed .last-request-panel .card-head {
  padding: 0.6rem;
}

.request-panel-collapsed .last-request-panel .card-head h2 {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.8rem;
}
.last-request-panel .last-request-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.last-request-panel .card-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.last-request-panel .request-block,
.last-request-panel .response-block {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.last-request-panel .last-request-pre,
.last-request-panel .last-response-pre {
  flex: 1;
  max-height: 160px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.25rem 0.5rem;
}

.card-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #1d4ed8;
  border-radius: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  flex-shrink: 0;
}

.card-head h2 {
  margin: 0 0 0.2rem;
  font-size: 1.15rem;
  font-weight: 600;
}

.card-head p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.card-body {
  padding: 0 1.25rem 1.25rem;
}

.overview-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.overview-stat {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  background: #f8fbff;
}

.overview-stat-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.overview-stat strong {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.88rem;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.field {
  flex: 1;
  min-width: 140px;
}

.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
}

.field textarea {
  resize: vertical;
  min-height: 80px;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  cursor: pointer;
}

.checkboxes {
  margin-bottom: 1rem;
}

.checkboxes .checkbox-label {
  display: flex;
  margin-bottom: 0.5rem;
}

.tip {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

/* ── Quest create: free/premium controls ─────────────────────── */
.quest-balance-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 0.78rem;
  font-weight: 600;
}
.tier-badge {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  vertical-align: middle;
}
.tier-free { background: #dcfce7; color: #15803d; }
.tier-premium { background: #fef3c7; color: #b45309; }
.quest-tier-filter {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.25rem;
}
.radio-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
}
.quest-icon-info {
  margin: 0 0 0.9rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  color: var(--text);
  line-height: 1.6;
}
.quest-icon-info-free { background: #f0fdf4; border-color: #bbf7d0; }
.quest-icon-info-premium { background: #fffbeb; border-color: #fde68a; }
.quest-afford-ok { color: #15803d; font-weight: 600; }
.quest-afford-bad { color: #b91c1c; font-weight: 600; }
.quest-advanced {
  margin: 0 0 0.75rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  background: #fafafa;
}
.quest-advanced > summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.quest-ar-checks {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  align-items: center;
}

.step-tags {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.step-tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  background: var(--bg);
  border-radius: 6px;
  color: var(--text-muted);
  font-weight: 500;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.btn {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: background 0.15s, color 0.15s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-outline:hover {
  background: rgba(37, 99, 235, 0.08);
}

.btn-danger {
  background: #dc2626;
  color: #fff;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-xsmall {
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
}

.response {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 2.5rem;
}

.response.empty {
  background: var(--bg);
  color: var(--text-muted);
}

.response.success {
  background: #ecfdf5;
  color: var(--success);
  border: 1px solid #a7f3d0;
}

.response.error {
  background: #fef2f2;
  color: var(--error);
  border: 1px solid #fecaca;
}

.response.small {
  min-height: 1.5rem;
  font-size: 0.8rem;
}

.card-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.card.half {
  flex: 1;
  min-width: 280px;
}

.video-divider {
  margin: 1.5rem 0 1rem;
  border: none;
  border-top: 1px solid var(--border);
}

.credits-overview-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 1rem;
  margin: 0.75rem 0;
  font-size: 0.9rem;
}
.credits-overview-grid strong { color: var(--primary); }

.credits-overview-subhead {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7dd3fc;
}
.credits-overview-quest { margin-top: 0.35rem; }
.credits-overview-quest strong { color: #fbbf24; }
.credits-overview-note {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #94a3b8;
}

.credits-sku-panel {
  margin: 0 0 1rem;
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid #103051;
  background: radial-gradient(circle at 20% 0%, rgba(25, 56, 99, 0.45), rgba(8, 19, 37, 0.96));
}

.credits-sku-title {
  color: #f8fafc;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 0.9rem;
}

.credits-sku-list {
  display: grid;
  gap: 0.75rem;
}

.credits-sku-item {
  width: 100%;
  border: 1px solid rgba(14, 174, 255, 0.4);
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(20, 31, 54, 0.96), rgba(12, 24, 44, 0.98));
  color: #f8fafc;
  cursor: pointer;
  text-align: left;
  padding: 0.95rem 1.1rem;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.7rem;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.credits-sku-item:hover {
  transform: translateY(-1px);
  border-color: rgba(47, 210, 255, 0.8);
}

.credits-sku-item.active {
  border-color: #40d9ff;
  box-shadow: 0 0 0 1px rgba(64, 217, 255, 0.5), 0 8px 22px rgba(24, 185, 255, 0.18);
}

.credits-sku-main {
  min-width: 0;
}

.credits-sku-credits {
  display: block;
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
}

.credits-sku-label {
  display: block;
  font-size: 1.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.9;
}

.credits-sku-side {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.credits-sku-discount {
  background: #e7ff4f;
  color: #0f172a;
  border-radius: 10px;
  padding: 0.22rem 0.55rem;
  font-size: 1.45rem;
  font-weight: 700;
  box-shadow: 0 0 18px rgba(231, 255, 79, 0.72);
}

.credits-sku-price {
  font-size: 3.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #2dd2ff;
  white-space: nowrap;
}

.credits-sku-empty {
  border-radius: 10px;
  border: 1px dashed rgba(148, 163, 184, 0.45);
  color: rgba(226, 232, 240, 0.85);
  padding: 0.8rem;
  font-size: 0.86rem;
}

.payment-intent-result {
  margin-top: 1rem;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: var(--radius);
}
.payment-intent-result label { display: block; margin-top: 0.5rem; font-size: 0.85rem; color: var(--text-muted); }
.payment-intent-result pre { margin: 0.25rem 0 0; font-size: 0.75rem; word-break: break-all; }
.stripe-card-element { margin-top: 0.5rem; padding: 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); min-height: 40px; }
.stripe-card-element .StripeElement { width: 100%; }

.videos-toolbar {
  margin-bottom: 1rem;
}

.my-videos-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1rem;
}

.admin-report-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 0.85rem;
  min-height: 64px;
}

.admin-report-empty {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 0.75rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.admin-report-tile {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.admin-report-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-report-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #e2e8f0;
}

.admin-report-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.admin-report-thumb-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: #f1f5f9;
}

.admin-report-blurhash {
  position: absolute;
  left: 0.45rem;
  bottom: 0.45rem;
  max-width: calc(100% - 0.9rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.7rem;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.68);
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
}

.admin-report-tile.is-selected {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.admin-report-tile-clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-report-tile-clickable:hover {
  border-color: rgba(37, 99, 235, 0.35);
}

.admin-report-detail-panel {
  margin-top: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f8fafc;
  padding: 0.85rem 1rem;
  min-height: 4rem;
}

.admin-report-detail-panel.is-error {
  border-color: rgba(220, 38, 38, 0.45);
  background: #fef2f2;
}

.admin-report-detail-placeholder,
.admin-report-detail-loading,
.admin-report-detail-empty {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.admin-report-detail-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.admin-report-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.45rem 1rem;
  margin-bottom: 0.75rem;
}

.admin-report-detail-row {
  font-size: 0.82rem;
}

.admin-report-detail-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.12rem;
}

.admin-report-detail-value {
  color: var(--text);
  word-break: break-word;
}

.admin-report-detail-section {
  margin-top: 0.65rem;
}

.admin-report-detail-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.admin-report-detail-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.82rem;
}

.admin-report-detail-muted {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.admin-report-detail-thumb {
  max-width: 280px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.admin-report-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.admin-report-detail-table th,
.admin-report-detail-table td {
  border: 1px solid var(--border);
  padding: 0.35rem 0.45rem;
  text-align: left;
  vertical-align: top;
}

.admin-report-detail-table th {
  background: #e2e8f0;
  font-weight: 700;
}

.admin-report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.admin-report-id {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.admin-report-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

.admin-report-meta strong {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 0.05rem;
}

.admin-report-details {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text);
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
}

.admin-report-summary {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  padding: 0.45rem 0.5rem;
}

.admin-report-summary-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.admin-report-summary-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 0.5rem;
  align-items: center;
  margin-bottom: 0.3rem;
}

.admin-report-summary-label {
  font-size: 0.76rem;
  color: var(--text);
}

.admin-report-summary-count {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 700;
}

.admin-report-summary-bar {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.admin-report-summary-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #38bdf8, #2563eb);
}

.admin-report-urls {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  font-size: 0.76rem;
}

.admin-report-urls strong {
  color: var(--text-muted);
  margin-right: 0.3rem;
}

.admin-report-url {
  color: #1d4ed8;
  text-decoration: none;
  word-break: break-all;
}

.admin-report-url:hover {
  text-decoration: underline;
}

.admin-report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.admin-report-actions .btn {
  font-size: 0.76rem;
  padding: 0.32rem 0.62rem;
}

.admin-user-select-card {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.admin-user-select-meta {
  min-width: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.admin-user-select-meta strong {
  color: var(--text);
}

.video-proc.status-pending {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.25);
  color: #92400e;
}

.video-proc.status-allowed {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.25);
  color: #166534;
}

.video-proc.status-removed {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.25);
  color: #991b1b;
}

.video-shared-legend {
  grid-column: 1 / -1;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}

.video-tile {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.video-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
  border-color: rgba(148, 163, 184, 0.7);
}

.video-thumb-wrap {
  position: relative;
}

.video-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--bg);
}

.video-thumb-variants {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.35rem 0 0.25rem;
}

.video-thumb-variant {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  align-items: flex-start;
}

.video-thumb-variant-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.video-thumb-variant-img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.video-thumb-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 0.4rem 0.6rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  background: linear-gradient(to top, rgba(15,23,42,0.9), rgba(15,23,42,0.4), transparent);
}

.video-info {
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.video-proc {
  display: inline-flex;
  align-self: flex-start;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}

.video-proc.status-processing {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.25);
  color: #1d4ed8;
}

.video-proc.status-ready {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.25);
  color: #166534;
}

.video-proc.status-completed {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.3);
  color: #065f46;
}

.video-proc.status-recording {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.3);
  color: #9f1239;
}

.video-proc.status-failed {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.25);
  color: #991b1b;
}

.video-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #f9fafb;
}

.video-user {
  font-size: 0.75rem;
  color: #e5e7eb;
}

.video-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.video-location {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-confidence {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Location suggestions (Google Places) */
.location-suggest-wrap {
  position: relative;
}
.location-suggestions {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 2px;
  max-height: 240px;
  overflow-y: auto;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 10;
}
.location-suggestions.open {
  display: block;
}
.location-suggestion-item {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
}
.location-suggestion-item:last-child {
  border-bottom: none;
}
.location-suggestion-item:hover {
  background: var(--hover-bg, #f1f5f9);
}
.location-suggestion-item.location-suggestion-loading,
.location-suggestion-item.location-suggestion-empty {
  cursor: default;
  color: var(--text-muted);
  font-style: italic;
}
.location-suggestion-item.location-suggestion-loading:hover,
.location-suggestion-item.location-suggestion-empty:hover {
  background: transparent;
}

/* Map search suggestions */
.map-search-suggest-wrap {
  position: relative;
}
.map-search-suggestions {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 2px;
  max-height: 220px;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(2, 6, 23, 0.16);
  z-index: 10;
}
.map-search-suggestions.open {
  display: block;
}
.map-search-suggestion-item {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-bottom: 1px solid var(--border, #e2e8f0);
}
.map-search-suggestion-item:last-child {
  border-bottom: none;
}
.map-search-suggestion-item:hover {
  background: var(--hover-bg, #f1f5f9);
}
.map-search-suggestion-item.map-search-suggestion-loading,
.map-search-suggestion-item.map-search-suggestion-empty {
  cursor: default;
  color: var(--text-muted);
  font-style: italic;
}
.map-search-suggestion-item.map-search-suggestion-loading:hover,
.map-search-suggestion-item.map-search-suggestion-empty:hover {
  background: transparent;
}
.field-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.video-play {
  font-size: 0.85rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  margin-top: 0.25rem;
}

.video-play:hover {
  text-decoration: underline;
}

.video-info .video-delete {
  margin-top: 0.5rem;
  align-self: flex-start;
}

.video-stats {
  display: flex;
  gap: 0.75rem;
  margin: 0.35rem 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.video-stat {
  white-space: nowrap;
}

.video-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.video-actions-main,
.video-actions-secondary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.video-actions-secondary-compact {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  width: 100%;
  padding-top: 0.35rem;
  border-top: 1px dashed var(--border);
}

.video-actions-secondary-compact .video-rate-feedback,
.video-actions-secondary-compact .video-report-details {
  width: 100%;
  max-width: 360px;
}

.video-actions-secondary-compact .video-rate-select,
.video-actions-secondary-compact .video-rate-categories,
.video-actions-secondary-compact .video-report-reason {
  width: 100%;
  max-width: none;
}

.video-actions-main {
  width: 100%;
}

.video-actions .video-action,
.video-actions-playback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.video-play-hls-manifest {
  font-size: 0.8rem;
  white-space: nowrap;
}

.video-play-cdn {
  font-size: 0.8rem;
}

.video-actions .video-play {
  flex-shrink: 0;
}

.video-rate-label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.video-rate-select {
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  background: var(--surface);
}

.video-rate-categories,
.video-report-reason {
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  background: var(--surface);
}

.video-rate-categories {
  min-height: 3.2rem;
}

.video-rate-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-width: 420px;
}

.video-rate-icons-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.1rem;
}

.video-rate-icons-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.video-rate-icon-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.5rem;
  border: 1px solid #b7c4da;
  border-radius: 999px;
  background: #f7faff;
  font-size: 0.76rem;
  color: #334155;
}

.video-rate-icon-svg {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex: 0 0 16px;
  background: #334155;
  border: 1px solid #1e293b;
  border-radius: 999px;
  padding: 2px;
  box-sizing: content-box;
  filter: drop-shadow(0 0 0.5px rgba(15, 23, 42, 0.25));
}

.video-rate-icon-fallback {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  line-height: 1;
  font-weight: 700;
  color: #0f172a;
  background: #dbeafe;
  border: 1px solid #93c5fd;
}

.video-rate-icon-name {
  max-width: 130px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-rate-feedback {
  width: 220px;
  max-width: 100%;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-family: inherit;
  background: var(--surface);
  resize: vertical;
  min-height: 36px;
}

.video-report-details {
  width: 220px;
  max-width: 100%;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-family: inherit;
  background: var(--surface);
  resize: vertical;
  min-height: 36px;
}

.video-play {
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: #0f172a;
  color: #f9fafb;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.35);
}

.video-play:hover {
  text-decoration: none;
  background: #020617;
}

.videos-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

/* SignalR card */
.signalr-status {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 1rem;
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.signalr-status.connected {
  background: #ecfdf5;
  color: var(--success);
  border-color: #a7f3d0;
}
.signalr-log-wrap {
  margin-top: 0.5rem;
}
.signalr-log-wrap label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.signalr-log {
  margin: 0 0 0.5rem;
  padding: 0.75rem;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 8px;
  font-size: 0.8rem;
  line-height: 1.45;
  max-height: 280px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

#infra-monitor .infra-tabs {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  position: relative;
  z-index: 12;
  pointer-events: auto;
  margin-bottom: 1rem;
}

#infra-monitor .infra-tabs .auth-tab {
  position: relative;
  z-index: 1;
  pointer-events: auto;
  cursor: pointer;
  flex: 0 0 auto;
}

#infra-monitor .auth-panes {
  position: relative;
  z-index: 0;
  clear: both;
}

#infra-monitor .auth-pane {
  display: none !important;
}

#infra-monitor .auth-pane.active {
  display: block !important;
}

#infra-monitor .auth-pane[hidden] {
  display: none !important;
}

.infra-live-instance {
  margin: 0.5rem 0 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
  font-size: 0.82rem;
  font-weight: 600;
}

.infra-live-subhead {
  margin: 0.75rem 0 0.35rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
}

.btn-link {
  border: none;
  background: none;
  padding: 0;
  color: var(--primary);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.infra-filter-row {
  align-items: flex-end;
  margin-top: 0.75rem;
}

.infra-table-wrap {
  margin-top: 0.5rem;
  max-height: min(420px, 52vh);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.infra-hub-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.infra-hub-table th,
.infra-hub-table td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.infra-hub-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  font-weight: 700;
  color: var(--text-muted);
}

.infra-hub-table tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.03);
}

.infra-hub-table .infra-row-hidden {
  display: none;
}

.infra-cat {
  display: inline-block;
  font-weight: 700;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  white-space: nowrap;
}

.infra-cat-delete {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.infra-cat-live {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.infra-cat-upload {
  background: #f0fdf4;
  color: #15803d;
  border-color: #bbf7d0;
}

.infra-cat-warn {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.infra-cat-system {
  background: #f8fafc;
  color: #475569;
}

.infra-cat-data {
  background: #faf5ff;
  color: #6b21a8;
}

.infra-event-cell {
  font-weight: 600;
  max-width: 200px;
  word-break: break-word;
}

.infra-payload-cell {
  max-width: 220px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.infra-health-log {
  max-height: 360px;
}

.chunked-upload-id {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  word-break: break-all;
}

.google-button-wrap {
  margin-bottom: 1rem;
  min-height: 44px;
}

/* Profile summary (email + picture) */
.profile-summary {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.profile-pic-wrap {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-no-pic {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.25rem;
  text-align: center;
}

.profile-meta {
  flex: 1;
  min-width: 0;
}

.profile-meta .field {
  margin-bottom: 0;
}

.field input.readonly {
  background: var(--bg);
  color: var(--text-muted);
  cursor: default;
}

/* Last request & response panel */
.last-request-card .request-block,
.last-request-card .response-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.last-request-card .request-block label,
.last-request-card .response-block label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.last-request-pre,
.last-response-pre {
  margin: 0;
  padding: 0.75rem;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 8px;
  font-size: 0.8rem;
  line-height: 1.45;
  overflow-x: auto;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
.last-response-status {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 0.25rem;
}

@media (max-width: 900px) {
  .app-shell {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }
  .sidebar-brand {
    border-bottom: none;
    border-right: 1px solid rgba(148, 163, 184, 0.14);
    padding: 0.75rem 0.9rem;
    flex-shrink: 0;
  }
  .sidebar-nav {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    flex: 1;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .nav-item {
    white-space: nowrap;
  }
  .sidebar-footer {
    display: none;
  }
  .main-one-screen {
    flex-direction: column;
  }
  .main-one-screen .main-content {
    flex: 0 0 auto;
    max-height: 50vh;
  }
  .last-request-panel {
    width: 100%;
    flex: 1;
    min-height: 200px;
  }
  .last-request-panel .last-request-pre,
  .last-request-panel .last-response-pre {
    max-height: 120px;
  }

  .request-panel-collapsed .last-request-panel {
    width: 100%;
    min-height: auto;
    padding: 1rem;
  }
  .request-panel-collapsed .last-request-panel .card-head p,
  .request-panel-collapsed .last-request-panel .card-body,
  .request-panel-collapsed .last-request-panel .card-head .card-icon {
    display: initial;
  }
  .request-panel-collapsed .last-request-panel .card-head h2 {
    writing-mode: initial;
    transform: none;
    font-size: 1.15rem;
  }

  .overview-stats {
    grid-template-columns: 1fr;
  }

  .my-videos-list {
    grid-template-columns: 1fr;
  }
}

.footer {
  padding: 1rem 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* HLS video player modal */
.video-player-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.video-player-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  cursor: pointer;
}
.video-player-box {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.video-player-close {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  z-index: 1;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background: var(--text);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.video-player-close:hover {
  background: var(--primary);
}
.video-player-wrap {
  width: 100%;
  max-width: 720px;
  background: #000;
  border-radius: var(--radius) var(--radius) 0 0;
}
.video-player-wrap video {
  width: 100%;
  display: block;
}
.video-player-source {
  margin: 0.35rem 0 0;
  font-size: 0.7rem;
  color: var(--text-muted);
  word-break: break-all;
  max-height: 3.6em;
  overflow: auto;
}

.video-player-hint {
  margin: 0;
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Events world map */
.scanmode-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1rem;
}

.scanmode-manual-title {
  margin: 0.75rem 0 0.5rem;
  font-size: 0.92rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field-required {
  color: #ef4444;
  font-weight: 700;
}

.events-map-card { overflow: hidden; }
.events-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: stretch;
  border: 1px solid rgba(37, 99, 235, 0.16);
  background: radial-gradient(circle at 12% 20%, rgba(89, 194, 248, 0.24), transparent 28%), linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(15, 23, 42, 0.03));
  border-radius: 18px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.events-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.25rem;
}
.events-hero h3 { margin: 0 0 0.25rem; font-size: 1.2rem; letter-spacing: -0.03em; }
.events-hero p { margin: 0; color: var(--text-muted); font-size: 0.88rem; }
.events-metric-grid { display: grid; grid-template-columns: repeat(3, minmax(76px, 1fr)); gap: 0.55rem; min-width: 260px; }
.events-metric {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  padding: 0.75rem;
  text-align: center;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
}
.events-metric span { display: block; font-size: 1.25rem; font-weight: 900; color: var(--text); }
.events-metric small { color: var(--text-muted); font-weight: 700; text-transform: uppercase; font-size: 0.65rem; }
.events-country-panel {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(16, 185, 129, 0.05));
}
.events-country-panel h3 { margin: 0 0 0.35rem; font-size: 0.95rem; }
.events-country-panel p { margin: 0 0 0.75rem; font-size: 0.82rem; color: var(--text-muted); }
.events-country-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; }
.events-country-chip {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.72rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.events-country-chip:hover { border-color: #2563eb; background: #eff6ff; }
.events-country-chip.active { border-color: #16a34a; background: rgba(22, 163, 74, 0.12); color: #166534; }
.events-country-summary {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-bottom: 0.65rem; font-size: 0.78rem;
}
.events-country-summary span {
  padding: 0.25rem 0.55rem;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.25);
}
.events-map-shell {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  background: linear-gradient(135deg, #eef6ff, #ffffff);
  margin-top: 1rem;
}
.events-map-toolbar {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  color: #e2e8f0;
  backdrop-filter: blur(12px);
  font-size: 0.78rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
}
.events-map-toolbar strong { color: #93c5fd; }
.events-state-focus {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 500;
  min-width: 220px;
  padding: 0.75rem 0.9rem;
  border-radius: 18px;
  color: #eaf2ff;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.84), rgba(30, 64, 175, 0.72));
  border: 1px solid rgba(147, 197, 253, 0.32);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}
.events-state-focus span {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #93c5fd;
  font-weight: 800;
}
.events-state-focus strong {
  display: block;
  margin-top: 0.1rem;
  font-size: 1rem;
  letter-spacing: -0.02em;
}
.events-live-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: events-pulse-dot 1.5s infinite;
}
@keyframes events-pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
.events-world-map { height: 560px; min-height: 420px; background: #edf4ff; }
.events-map-shell .leaflet-container { background: #edf4ff; font-family: var(--font); }
.events-map-shell .leaflet-interactive { cursor: pointer; }
.events-map-shell .leaflet-control-zoom {
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
}
.events-map-shell .leaflet-control-zoom a {
  border: 0;
  color: #0f172a;
}
.events-map-shell .leaflet-popup-content-wrapper {
  border-radius: 18px;
  padding: 0;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.24);
  overflow: hidden;
}
.events-map-shell .leaflet-popup-content {
  margin: 0;
}
.events-map-shell .leaflet-popup-tip {
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.16);
}
.events-marker {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  border: 3px solid #fff;
  box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.18), 0 18px 35px rgba(37, 99, 235, 0.4);
  position: relative;
  animation: events-marker-float 2.4s ease-in-out infinite;
}
.events-marker::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.55);
  animation: events-marker-ring 2s ease-out infinite;
}
@keyframes events-marker-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-5px) scale(1.04); }
}
@keyframes events-marker-ring {
  0% { transform: scale(0.7); opacity: 0.8; }
  100% { transform: scale(1.55); opacity: 0; }
}
.events-popup { min-width: 260px; padding: 0.85rem; background: linear-gradient(180deg, #fff, #f8fbff); }
.events-popup h4 { margin: 0 0 0.3rem; font-size: 0.95rem; }
.events-popup p { margin: 0.18rem 0; font-size: 0.78rem; color: var(--text-muted); }
.events-popup .btn { margin-top: 0.55rem; width: 100%; justify-content: center; }
.events-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr); gap: 1rem; margin-top: 1rem; }
.events-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0.8rem; }
.event-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.9rem;
  background: linear-gradient(180deg, #fff, #f8fafc);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  transition: transform 0.16s var(--ease-out), box-shadow 0.16s var(--ease-out);
}
.event-card:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(15, 23, 42, 0.1); }
.event-card-title { font-weight: 800; margin-bottom: 0.35rem; letter-spacing: -0.02em; }
.event-card-meta { color: var(--text-muted); font-size: 0.78rem; margin: 0.18rem 0; }
.events-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 999px;
  padding: 0.25rem 0.5rem;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
}
.events-empty { color: var(--text-muted); border: 1px dashed var(--border); border-radius: 14px; padding: 1rem; background: #fff; }
.event-venue-modal {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.event-venue-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.62); backdrop-filter: blur(7px); }
.event-venue-box {
  position: relative;
  width: min(980px, 94vw);
  max-height: 92vh;
  background: var(--surface);
  border-radius: 24px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.36);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.event-venue-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  z-index: 3;
  font-size: 1.4rem;
}
.event-venue-head { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.event-venue-head h2 { margin: 0 0 0.2rem; font-size: 1.2rem; }
.event-venue-head p { margin: 0; color: var(--text-muted); font-size: 0.84rem; }
.event-venue-map { height: 500px; background: #071122; }
.event-venue-meta {
  margin: 0;
  max-height: 140px;
  overflow: auto;
  background: #0f172a;
  color: #dbeafe;
  padding: 0.9rem 1.2rem;
  font-size: 0.78rem;
}
@media (max-width: 900px) {
  .events-hero, .events-layout { grid-template-columns: 1fr; display: grid; }
  .events-metric-grid { min-width: 0; }
  .events-world-map, .event-venue-map { height: 380px; }
}

/* ── Quest Map ─────────────────────────────────────────────── */
.quests-world-map {
  height: 480px;
  min-height: 320px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #edf4ff;
  margin-bottom: 0.5rem;
}
.quest-map-stats {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
}
.quest-map-stat {
  background: var(--surface-2, #f1f5f9);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
  font-weight: 600;
  color: var(--text-muted);
}
.quest-map-stat-std  { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.quest-map-stat-prem { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.quest-map-stat-status { font-weight: 400; }
.quest-map-auto-label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
}
/* Emoji icon overlaid on markers */
.quest-emoji-label {
  background: transparent !important;
  border: none !important;
  pointer-events: none;
}
.quest-emoji-label > div {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
/* Leaflet popup override for quest */
.quest-leaflet-popup .leaflet-popup-content-wrapper {
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,.18);
}
.quest-leaflet-popup .leaflet-popup-content { margin: 10px 12px; }

@media (max-width: 900px) {
  .quests-world-map { height: 320px; }
}

/* ── Participant Test Console ──────────────────────────────────────────────── */
.ptc-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1rem;
  align-items: start;
  margin-top: 0.75rem;
}

@media (max-width: 900px) {
  .ptc-layout { grid-template-columns: 1fr; }
}

/* Left: step-by-step controls */
.ptc-controls {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.ptc-step {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  background: var(--surface-2, #f8fafc);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
}

.ptc-step-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.ptc-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0.2rem 0 0.4rem;
  line-height: 1.45;
}

.ptc-end-btn {
  background: #dc2626 !important;
  border-color: #dc2626 !important;
}
.ptc-end-btn:hover { background: #b91c1c !important; }

/* Right: monitor panel */
.ptc-monitor {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* Current state box */
.ptc-state-box {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.ptc-state-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--surface-2, #f1f5f9);
  padding: 0.45rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

.ptc-state-title {
  font-weight: 700;
  font-size: 0.88rem;
  flex: 1;
}

.ptc-state-count {
  font-size: 1.4rem;
  font-weight: 800;
  color: #7c3aed;
  line-height: 1;
}

.ptc-state-peak {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.ptc-participant-list {
  list-style: none;
  margin: 0;
  padding: 0.4rem 0;
  max-height: 200px;
  overflow-y: auto;
}

.ptc-empty {
  padding: 0.55rem 0.85rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

.ptc-participant-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.85rem;
  border-bottom: 1px solid rgba(15,23,42,0.05);
  font-size: 0.8rem;
  transition: background 0.15s;
}

.ptc-participant-row:last-child { border-bottom: none; }

.ptc-participant-row.ptc-is-host {
  background: rgba(124, 58, 237, 0.06);
}

.ptc-participant-row.ptc-was-changed {
  background: rgba(22, 163, 74, 0.07);
}
.ptc-participant-row.ptc-was-changed.ptc-is-host {
  background: rgba(124, 58, 237, 0.08);
}

.ptc-role-badge {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 64px;
}

.ptc-participant-row.ptc-is-host .ptc-role-badge { color: #7c3aed; }

.ptc-uid {
  font-size: 0.7rem;
  word-break: break-all;
  flex: 1;
}

.ptc-changed-tag {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(22,163,74,0.12);
  color: #15803d;
  border-radius: 4px;
  padding: 1px 5px;
}

/* Console log */
.ptc-console-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 0 0.2rem;
}

.ptc-console-badge {
  background: var(--primary);
  color: #fff;
  border-radius: 20px;
  padding: 1px 8px;
  font-size: 0.72rem;
  font-weight: 700;
}

.ptc-console {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 0.75rem;
  max-height: 340px;
  overflow-y: auto;
  padding: 0.4rem 0;
}

.ptc-console-empty {
  padding: 0.75rem 1rem;
  color: #64748b;
  font-style: italic;
}
.ptc-console-empty code { color: #7c3aed; background: rgba(124,58,237,.15); border-radius:3px; padding: 1px 4px; }

.ptc-console-row {
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: grid;
  grid-template-columns: 80px 72px 52px auto;
  grid-template-rows: auto auto;
  gap: 0 0.5rem;
  align-items: center;
}
.ptc-console-row:last-child { border-bottom: none; }

.ptc-console-ts    { color: #64748b; font-size: 0.7rem; }
.ptc-console-ct    { font-weight: 800; font-size: 0.78rem; }
.ptc-console-count { color: #94a3b8; font-size: 0.78rem; }
.ptc-console-changed { color: #f59e0b; font-size: 0.73rem; grid-column: 4; }

.ptc-ct-join   { color: #4ade80; }
.ptc-ct-leave  { color: #fb923c; }
.ptc-ct-end    { color: #f87171; }
.ptc-ct-update { color: #818cf8; }

.ptc-console-ids {
  grid-column: 1 / -1;
  margin-top: 0.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.ptc-console-uid {
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.68rem;
  color: #cbd5e1;
}

.ptc-console-uid.ptc-console-host {
  background: rgba(124,58,237,0.25);
  color: #c4b5fd;
  font-weight: 700;
}
/* ── /Participant Test Console ─────────────────────────────────────────────── */

/* ── Live Chat Room panel ─────────────────────────────────────────────────── */
.lcr-simple {
  margin-top: 0.5rem;
}

.lcr-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 0.75rem;
}

.lcr-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: #475569;
  background: #f8fafc;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  padding: 0.3rem 0.6rem;
}

.lcr-badge strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  color: #0f172a;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lcr-badge-on {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.lcr-badge-off {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.lcr-roster-box {
  margin-top: 0.75rem;
}

.lcr-remove-btn {
  background: #dc2626 !important;
  border-color: #dc2626 !important;
  color: #fff !important;
}

.lcr-remove-btn:hover { background: #b91c1c !important; }

.lcr-roster-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.lcr-roster-meta {
  flex: 1;
  min-width: 0;
}

.lcr-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.lcr-joined {
  font-size: 0.68rem;
  color: #94a3b8;
}

.lcr-row-remove {
  flex-shrink: 0;
  font-size: 0.7rem !important;
  padding: 2px 8px !important;
  color: #b91c1c !important;
  border-color: #fecaca !important;
}

/* ── Live Studio ──────────────────────────────────────────────────────────── */
.ls-studio {
  margin-top: 0.75rem;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 40%);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 16px;
  padding: 1rem 1.1rem 1.15rem;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.05);
}
.ls-studio-steps {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}
.ls-step {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.75rem 0.35rem 0.35rem;
  cursor: default;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 600;
}
.ls-step.is-active {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}
.ls-step.is-done {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}
.ls-step-num {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 800;
}
.ls-step.is-active .ls-step-num { background: #2563eb; color: #fff; }
.ls-step.is-done .ls-step-num { background: #16a34a; color: #fff; }
.ls-step-sep {
  width: 1.25rem;
  height: 2px;
  background: #e2e8f0;
  border-radius: 2px;
}
.ls-studio-meta {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) auto;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 0.75rem;
}
@media (max-width: 900px) {
  .ls-studio-meta { grid-template-columns: 1fr; }
}
.ls-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}
.ls-studio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}
.ls-end-btn { background: #dc2626 !important; border-color: #dc2626 !important; }
.ls-end-btn:hover { background: #b91c1c !important; }
.ls-studio-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(280px, 1.4fr) minmax(200px, 0.9fr);
  gap: 0.75rem;
  min-height: 420px;
}
@media (max-width: 1100px) {
  .ls-studio-grid { grid-template-columns: 1fr 1fr; }
  .ls-side-panel { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .ls-studio-grid { grid-template-columns: 1fr; }
}
.ls-circle-panel,
.ls-chat-panel,
.ls-side-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  min-height: 380px;
  overflow: hidden;
}
.ls-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 0.95rem 0.65rem;
  border-bottom: 1px solid #f1f5f9;
}
.ls-panel-head h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}
.ls-panel-sub {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: #94a3b8;
}
.ls-count-pill {
  min-width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0 0.45rem;
}
.ls-circle-list {
  list-style: none;
  margin: 0;
  padding: 0.4rem;
  overflow-y: auto;
  flex: 1;
}
.ls-circle-empty,
.ls-chat-empty {
  color: #94a3b8;
  font-size: 0.85rem;
  padding: 1.25rem 0.85rem;
  text-align: center;
  line-height: 1.45;
}
.ls-circle-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.55rem;
  border-radius: 12px;
  margin-bottom: 0.3rem;
  transition: background 0.15s;
}
.ls-circle-row:hover { background: #f8fafc; }
.ls-circle-row.is-host {
  background: linear-gradient(90deg, #f5f3ff, #fff);
  border: 1px solid #ede9fe;
}
.ls-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  object-fit: cover;
  background: #e2e8f0;
  flex-shrink: 0;
}
.ls-avatar-fallback {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.ls-circle-meta { min-width: 0; flex: 1; }
.ls-circle-meta strong {
  display: block;
  font-size: 0.86rem;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ls-circle-meta span {
  font-size: 0.72rem;
  color: #94a3b8;
}
.ls-host-tag {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.65rem;
  font-weight: 800;
  color: #7c3aed;
  background: #f3e8ff;
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
  vertical-align: middle;
}
.ls-circle-foot {
  padding: 0.55rem 0.85rem 0.75rem;
  border-top: 1px solid #f1f5f9;
}
.ls-hint {
  margin: 0.35rem 0 0;
  font-size: 0.74rem;
  color: #94a3b8;
  line-height: 1.4;
}
.ls-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.85rem;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.05), transparent 40%),
    #fcfcfd;
}
.ls-msg {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
  max-width: 92%;
}
.ls-msg.is-mine {
  margin-left: auto;
  flex-direction: row-reverse;
}
.ls-msg-bubble {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px 14px 14px 4px;
  padding: 0.45rem 0.7rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.ls-msg.is-mine .ls-msg-bubble {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
  border-radius: 14px 14px 4px 14px;
}
.ls-msg-name {
  font-size: 0.7rem;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 0.15rem;
}
.ls-msg.is-mine .ls-msg-name { color: rgba(255,255,255,0.8); }
.ls-msg-text { font-size: 0.88rem; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.ls-msg-time { font-size: 0.65rem; opacity: 0.65; margin-top: 0.2rem; text-align: right; }
.ls-chat-composer {
  display: flex;
  gap: 0.45rem;
  padding: 0.65rem 0.75rem;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}
.ls-chat-composer input {
  flex: 1;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  font-size: 0.9rem;
  outline: none;
}
.ls-chat-composer input:focus { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.ls-chat-composer input:disabled { background: #f1f5f9; color: #94a3b8; }
.ls-chat-panel > .ls-hint { padding: 0 0.85rem 0.65rem; }
.ls-pulse-console {
  flex: 1;
  min-height: 180px;
  max-height: 260px;
  margin: 0 0.6rem;
  border-radius: 10px;
}
.ls-advanced {
  padding: 0.65rem 0.85rem 0.85rem;
  border-top: 1px solid #f1f5f9;
}
.ls-advanced summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
}
.ls-advanced input {
  width: 100%;
  margin-top: 0.4rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  font-size: 0.82rem;
}
.ls-hidden-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  padding: 0 !important;
  margin: -1px !important;
}
#lsChatConnBadge.lcr-badge-on { background: #ecfdf5; border-color: #86efac; }
#lsChatConnBadge.lcr-badge-off { background: #fef2f2; border-color: #fecaca; }


/* legacy layout kept for quest module badges */
.lcr-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1rem;
  align-items: start;
  margin-top: 0.75rem;
}

@media (max-width: 900px) {
  .lcr-layout { grid-template-columns: 1fr; }
}

.lcr-controls {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.lcr-monitor {
  min-width: 0;
}

/* ── Quest Live Stream test module (light theme, high contrast) ─────────────── */
#questlivestream {
  color: var(--text);
}
#questlivestream .qls-section-title {
  margin: 1.25rem 0 0.5rem;
  font-size: 0.95rem;
  color: var(--primary);
  font-weight: 700;
}
#questlivestream .qls-role-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
@media (max-width: 640px) {
  #questlivestream .qls-role-row { grid-template-columns: 1fr; }
}
#questlivestream .qls-role-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.9rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
}
#questlivestream .qls-role-card strong {
  color: var(--text);
  font-size: 1rem;
}
#questlivestream .qls-role-card:hover {
  border-color: var(--primary);
}
#questlivestream .qls-role-card.qls-role-active {
  border-color: var(--primary);
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
#questlivestream .qls-role-icon { font-size: 1.4rem; line-height: 1; }
#questlivestream .qls-role-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

#questlivestream .qls-status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  padding: 0.7rem 1rem;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  font-size: 0.88rem;
  color: var(--text);
}
#questlivestream .qls-status-bar strong {
  color: #1e40af;
  font-weight: 700;
}

#questlivestream .qls-runall-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

#questlivestream .qls-roadmap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  padding: 0.65rem 0.9rem;
  margin-bottom: 1rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-weight: 600;
  color: #1e3a8a;
  line-height: 1.5;
}
#questlivestream .qls-roadmap-item {
  background: #fff;
  border: 1px solid #93c5fd;
  border-radius: 6px;
  padding: 2px 8px;
  color: #1e40af;
}
#questlivestream .qls-roadmap-arrow {
  color: #64748b;
  font-weight: 400;
}

#questlivestream .qls-layout {
  display: grid;
  grid-template-columns: 1fr minmax(300px, 360px);
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 1024px) {
  #questlivestream .qls-layout {
    grid-template-columns: 1fr;
  }
}

#questlivestream .qls-wizard {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

#questlivestream .qls-wizard-step {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem 0.95rem 3.25rem;
  margin-bottom: 0.75rem;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
}
#questlivestream .qls-wizard-step::before {
  content: '';
  position: absolute;
  left: 1.35rem;
  top: 2.6rem;
  bottom: -0.85rem;
  width: 2px;
  background: #cbd5e1;
  z-index: 0;
}
#questlivestream .qls-wizard-step:last-child::before {
  display: none;
}
#questlivestream .qls-wizard-step.qls-step-done {
  border-left: 4px solid var(--success);
  background: #f0fdf4;
}
#questlivestream .qls-wizard-step.qls-step-active {
  border-left: 4px solid var(--primary);
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}
#questlivestream .qls-wizard-step.qls-step-error {
  border-left: 4px solid var(--error);
  background: #fef2f2;
}

#questlivestream .qls-wizard-step-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}
#questlivestream .qls-wizard-step-title {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
#questlivestream .qls-wizard-step-title strong {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 700;
}

#questlivestream .qls-wizard-num {
  position: absolute;
  left: 0.85rem;
  top: 0.85rem;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.35);
}
#questlivestream .qls-wizard-step.qls-step-done .qls-wizard-num {
  background: var(--success);
}
#questlivestream .qls-wizard-step.qls-step-error .qls-wizard-num {
  background: var(--error);
}

#questlivestream .qls-step-status {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 9px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  border: 1px solid #cbd5e1;
}
#questlivestream .qls-step-status.qls-st-done {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}
#questlivestream .qls-step-status.qls-st-active {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #93c5fd;
}
#questlivestream .qls-step-status.qls-st-error {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}

#questlivestream .qls-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
  line-height: 1.5;
}
#questlivestream .qls-hint code {
  background: #f1f5f9;
  color: #334155;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.76rem;
}

#questlivestream .qls-bounds-preview {
  font-size: 0.72rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #475569;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.55rem;
  margin: 0 0 0.65rem;
  word-break: break-all;
  line-height: 1.45;
}

#questlivestream .qls-play-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
  line-height: 1.5;
}
#questlivestream .qls-play-hint code {
  font-size: 0.72rem;
  background: #f1f5f9;
  padding: 1px 4px;
  border-radius: 3px;
}
#questlivestream .qls-play-hint-ok {
  color: #15803d;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  padding: 0.4rem 0.55rem;
}
#questlivestream .qls-play-hint-warn {
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 0.4rem 0.55rem;
}
#questlivestream .qls-pick-card-meta .qls-dist-ok { color: #15803d; font-weight: 600; }
#questlivestream .qls-pick-card-meta .qls-dist-far { color: #b45309; font-weight: 600; }

#questlivestream .qls-live-map {
  height: 360px;
  width: 100%;
  min-height: 360px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 0.5rem 0;
  background: #e2e8f0;
  z-index: 1;
  position: relative;
  overflow: hidden;
}
#questlivestream .qls-live-map .leaflet-container {
  height: 100%;
  width: 100%;
  font-family: var(--font);
  background: #e2e8f0;
}
.qls-live-label {
  background: transparent !important;
  border: none !important;
}
#questlivestream .qls-map-node-detail {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.65rem;
  background: #fff;
  font-size: 0.8rem;
  line-height: 1.5;
}
#questlivestream .qls-map-node-detail .qls-map-detail-title {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}
#questlivestream .qls-map-node-detail .qls-map-detail-row {
  color: #475569;
  margin: 0.15rem 0;
}
#questlivestream .qls-map-node-detail .qls-map-detail-row code {
  font-size: 0.72rem;
  background: #f1f5f9;
  padding: 1px 4px;
  border-radius: 3px;
}
#questlivestream .qls-inline-check {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
#questlivestream .qls-map-toolbar {
  margin-top: 0.35rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.qls-live-pulse {
  animation: qls-pulse 1.6s ease-in-out infinite;
}
@keyframes qls-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.85; }
}

#questlivestream .qls-discover-feed {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.5rem;
}
#questlivestream .qls-discover-location {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
#questlivestream .qls-discover-location-head {
  background: #f1f5f9;
  padding: 0.45rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
}
#questlivestream .qls-discover-host {
  border-top: 1px solid var(--border);
  padding: 0.5rem 0.65rem;
}
#questlivestream .qls-discover-host-head {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: #1e293b;
}
#questlivestream .qls-discover-host-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
#questlivestream .qls-discover-streams {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.45rem;
}
#questlivestream .qls-participant-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.8rem;
}
#questlivestream .qls-participant-row img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: #e2e8f0;
}

#questlivestream .qls-quest-cards,
#questlivestream .qls-stream-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.55rem;
  margin-top: 0.55rem;
}
#questlivestream .qls-pick-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  cursor: pointer;
  background: #fff;
  color: var(--text);
  transition: border-color 0.12s, box-shadow 0.12s;
  text-align: left;
  font-family: inherit;
}
#questlivestream .qls-pick-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}
#questlivestream .qls-pick-card.qls-pick-selected {
  border-color: var(--primary);
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}
#questlivestream .qls-pick-card-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
  margin-bottom: 0.2rem;
}
#questlivestream .qls-pick-card-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.4;
}
#questlivestream .qls-pick-card-id {
  font-family: ui-monospace, monospace;
  font-size: 0.68rem;
  color: #64748b;
  word-break: break-all;
  margin-top: 0.25rem;
}
#questlivestream .qls-empty-card {
  grid-column: 1 / -1;
  padding: 0.75rem;
  font-size: 0.84rem;
  color: var(--text-muted);
  background: #f8fafc;
  border: 1px dashed var(--border);
  border-radius: 8px;
}

/* Quest participant cards */
#questlivestream .qls-participant-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.6rem;
  margin-top: 0.6rem;
}
#questlivestream .qls-participant-summary {
  grid-column: 1 / -1;
  font-size: 0.82rem;
  color: var(--text-muted);
}
#questlivestream .qls-ptc-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
#questlivestream .qls-ptc-card-live {
  border-color: #fca5a5;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.15);
}
#questlivestream .qls-ptc-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
#questlivestream .qls-ptc-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  background: #e2e8f0;
}
#questlivestream .qls-ptc-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #475569;
  font-size: 0.95rem;
}
#questlivestream .qls-ptc-headtext { min-width: 0; }
#questlivestream .qls-ptc-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
#questlivestream .qls-ptc-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}
#questlivestream .qls-ptc-live {
  font-size: 0.66rem;
  font-weight: 700;
  color: #dc2626;
  letter-spacing: 0.03em;
}
#questlivestream .qls-ptc-offline {
  font-size: 0.66rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.03em;
}
#questlivestream .qls-ptc-coord {
  font-size: 0.72rem;
  color: #64748b;
}
#questlivestream .qls-ptc-streamid {
  font-family: ui-monospace, monospace;
  font-size: 0.66rem;
  color: #94a3b8;
  word-break: break-all;
}
#questlivestream .qls-ptc-actions {
  margin-top: 0.2rem;
}
#questlivestream .qls-ptc-join {
  width: 100%;
}
#questlivestream .qls-ptc-count {
  font-weight: 600;
  color: #dc2626;
}

/* Live join count badge in the status bar (host + viewer) */
#questlivestream .qls-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.08rem 0.5rem;
  border-radius: 999px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-weight: 600;
}
#questlivestream .qls-live-badge strong { color: #dc2626; }
#questlivestream .qls-live-count {
  font-weight: 600;
  color: #dc2626;
}
#questlivestream .qls-inline-stat {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}
#questlivestream .qls-inline-stat strong {
  color: var(--text);
}

#questlivestream .qls-monitor {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  position: sticky;
  top: 1rem;
}
#questlivestream .qls-monitor-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  color: var(--text);
}
#questlivestream .qls-monitor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
}
#questlivestream .qls-monitor-badge {
  font-size: 0.75rem;
  background: var(--primary);
  color: #fff;
  padding: 2px 9px;
  border-radius: 999px;
  font-weight: 800;
}

#questlivestream .qls-flow-log {
  max-height: 150px;
  overflow-y: auto;
  padding: 0.55rem 0.85rem;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text);
  background: #fff;
}
#questlivestream .qls-log-line {
  padding: 0.2rem 0;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text);
}
#questlivestream .qls-log-ok { color: #15803d; font-weight: 600; }
#questlivestream .qls-log-warn { color: #b45309; font-weight: 600; }
#questlivestream .qls-log-err { color: #b91c1c; font-weight: 600; }
#questlivestream .qls-log-empty {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.8rem;
}

#questlivestream .qls-participant-list {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
  max-height: 160px;
  overflow-y: auto;
  background: #fff;
}
#questlivestream .qls-list-empty {
  padding: 0.55rem 0.85rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}
#questlivestream .qls-participant-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.84rem;
  color: var(--text);
  border-bottom: 1px solid #f1f5f9;
}
#questlivestream .qls-participant-row.qls-is-host {
  background: #f5f3ff;
}
#questlivestream .qls-role-pill {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: #e2e8f0;
  color: #334155;
}

#questlivestream .qls-event-console {
  min-height: 120px;
  max-height: 200px;
  overflow: auto;
  font-family: ui-monospace, monospace;
  font-size: 0.72rem;
  line-height: 1.5;
  background: #0f172a;
  border: none;
  border-radius: 0;
  padding: 0.65rem 0.75rem;
  margin: 0;
  color: #e2e8f0;
}

#questlivestream .qls-advanced {
  margin-top: 1rem;
  font-size: 0.88rem;
  color: var(--text);
}
#questlivestream .qls-advanced summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 700;
}
#questlivestream label {
  color: var(--text);
  font-weight: 600;
  font-size: 0.84rem;
}
#questlivestream input,
#questlivestream select {
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
}
/* ── /Quest Live Stream ────────────────────────────────────────────────────── */

/* ── Stories Strip ───────────────────────────────────────────────────────────── */
.stories-strip {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(255,255,255,0.96);
  border-bottom: 1px solid var(--border);
  padding: 0;
  flex-shrink: 0;
  min-height: 88px;
  overflow: hidden;
}

.stories-strip-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 10px 0 14px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  min-width: 58px;
  height: 100%;
  min-height: 88px;
}
.stories-strip-icon {
  font-size: 1.15rem;
  line-height: 1;
}
.stories-strip-title {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.stories-strip-refresh {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}
.stories-strip-refresh:hover { color: var(--primary); background: rgba(37,99,235,0.07); }

.stories-strip-track {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px 8px 10px;
  overflow-x: auto;
  flex: 1;
  scrollbar-width: none;
}
.stories-strip-track::-webkit-scrollbar { display: none; }

.stories-strip-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  padding: 0 4px;
}

/* Story circles — shared between strip */

.story-bubble {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 72px;
  transition: transform 0.15s var(--ease-out);
}
.story-bubble:hover { transform: scale(1.06); }
.story-bubble:focus-visible { outline: 2px solid var(--primary); border-radius: 50%; }

.story-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, #f97316, #e11d48, #9333ea);
  flex-shrink: 0;
}
.story-bubble.story-seen .story-ring {
  background: var(--border);
}

.story-thumb {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #1e293b;
  border: 2.5px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.story-thumb-icon {
  color: #fff;
  font-size: 1.2rem;
  opacity: 0.85;
}

.story-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-align: center;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

/* ── Stories full-screen viewer ─────────────────────────────────────────── */
.stories-viewer {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stories-viewer-inner {
  position: relative;
  width: 100%;
  max-width: 420px;
  height: 100%;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #0a0a0a;
}

/* Progress track */
.stories-progress-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  gap: 3px;
  padding: 10px 10px 0;
}
.stories-prog-seg {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  overflow: hidden;
}
.stories-prog-fill {
  height: 100%;
  background: #fff;
  border-radius: 2px;
  transition: width 0.05s linear;
}

/* Header */
.stories-viewer-header {
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
}
.stories-viewer-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}
.stories-viewer-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 1.5px solid rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  flex-shrink: 0;
  overflow: hidden;
}
.stories-viewer-info {
  display: flex;
  flex-direction: column;
}
.stories-viewer-name {
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1.2;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.stories-viewer-sub {
  color: rgba(255,255,255,0.7);
  font-size: 0.72rem;
}
.stories-close-btn {
  background: rgba(0,0,0,0.4);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: background 0.15s;
  flex-shrink: 0;
}
.stories-close-btn:hover { background: rgba(0,0,0,0.65); }

/* Dual video slots — both absolutely stacked, swap via sv-active */
.sv-slot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  opacity: 0;
  z-index: 1;
}
.sv-slot.sv-active {
  opacity: 1;
  z-index: 2;
}

/* Tap zones */
.stories-tap-prev,
.stories-tap-next {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 35%;
  z-index: 5;
  cursor: pointer;
}
.stories-tap-prev { left: 0; }
.stories-tap-next { right: 0; }

/* Spinner */
.stories-spinner {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.35);
  pointer-events: none;
}
.stories-spinner-ring {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  animation: storiesSpin 0.7s linear infinite;
}
@keyframes storiesSpin {
  to { transform: rotate(360deg); }
}

/* Preload badge */
.stories-preload-badge {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: rgba(0,0,0,0.55);
  color: rgba(255,255,255,0.8);
  font-size: 0.68rem;
  padding: 3px 10px;
  border-radius: 20px;
  pointer-events: none;
}
/* ── /Stories Module ─────────────────────────────────────────────────────────── */

/* ── Promotions module ─────────────────────────────────────────────────────── */
.promo-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.1fr);
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 900px) {
  .promo-layout { grid-template-columns: 1fr; }
}
.promo-form-panel,
.promo-map-panel {
  background: var(--surface-2, #f8fafc);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
}
.promo-map { height: 420px; }
.field-req { color: #ef4444; }
.promo-spotlight-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #1e293b;
  color: #f8fafc;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin: 0.75rem 0 1rem;
}
.promo-toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}
.promo-toggle input { opacity: 0; width: 0; height: 0; }
.promo-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #475569;
  border-radius: 28px;
  transition: 0.2s;
}
.promo-toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}
.promo-toggle input:checked + .promo-toggle-slider { background: #0A84FF; }
.promo-toggle input:checked + .promo-toggle-slider:before { transform: translateX(20px); }
.promo-pin-icon { background: transparent; border: none; }
.promo-pin {
  font-size: 1.35rem;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}
.promo-pin-spotlight { filter: drop-shadow(0 0 6px #E1FF00); }
.promo-map-stats { margin-bottom: 0.5rem; }
.promo-detail-card {
  background: #0f172a;
  color: #f8fafc;
  border-radius: 14px;
  overflow: hidden;
  margin: 1rem 0;
  border: 1px solid #334155;
}
.promo-detail-hero { max-height: 200px; overflow: hidden; background: #1e293b; }
.promo-detail-hero img { width: 100%; height: 200px; object-fit: cover; display: block; }
.promo-detail-hero-placeholder {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 0.9rem;
}
.promo-detail-body { padding: 1rem 1.1rem 1.25rem; }
.promo-detail-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.promo-detail-title-row h4 { margin: 0; font-size: 1.25rem; flex: 1; min-width: 140px; }
.promo-detail-about { font-size: 0.92rem; line-height: 1.55; color: #cbd5e1; margin: 0 0 1rem; }
.promo-detail-meta { font-size: 0.85rem; color: #94a3b8; margin-bottom: 1rem; }
.promo-detail-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  background: #1e293b;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.6rem;
}
.promo-detail-card-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: #94a3b8; margin-bottom: 0.2rem; }
.promo-detail-card-row a { color: #38bdf8; word-break: break-all; font-size: 0.88rem; }
.promo-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}
.promo-badge-active { background: #22c55e; color: #052e13; }
.promo-badge-spotlight { background: #f2b73f; color: #1a1a1a; }
.promo-badge-muted { background: #334155; color: #cbd5e1; }
.promo-badge-expired { background: #3f4757; color: #e2e8f0; }
.promo-badge-cancelled { background: #ef4444; color: #2a0505; }
.promo-mine-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}
.promo-mine-item {
  display: flex;
  flex-direction: column;
  border: 1px solid #263041;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  background: #0f172a;
  color: #f1f5f9;
  transition: transform 0.15s, box-shadow 0.15s;
}
.promo-mine-item:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,0.35); }
.promo-mine-hero {
  position: relative;
  height: 120px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #1e293b, #334155);
}
.promo-mine-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.promo-mine-hero-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; color: #64748b; }
.promo-mine-hero-badges {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  right: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.promo-mine-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.35rem; padding: 0.7rem 0.85rem 0.8rem; }
.promo-mine-item-main { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.promo-mine-title { font-weight: 700; font-size: 0.95rem; color: #f1f5f9; flex: 1; min-width: 120px; }
.promo-mine-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: #94a3b8;
}
.promo-mine-footer span { display: inline-flex; align-items: center; gap: 0.25rem; }
.promo-mine-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: rgba(242, 183, 63, 0.12);
  border-top: 1px solid rgba(242, 183, 63, 0.35);
  color: #f2b73f;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.5rem 0.85rem;
}
.promo-mine-banner button {
  background: none;
  border: none;
  color: #f2b73f;
  text-decoration: underline;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.78rem;
  padding: 0;
}
.promo-mine-unavailable { color: #f87171; font-size: 0.8rem; font-weight: 600; padding: 0 0.85rem 0.75rem; margin-top: -0.15rem; }
.promo-edit-panel {
  margin-top: 1rem;
  padding: 1rem 1.1rem 1.15rem;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
}
.promo-detail-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: #94a3b8;
}
.promo-detail-stats span { display: inline-flex; align-items: center; gap: 0.3rem; }

/* ── Promotion Wallet: voucher/boost SKU cards (dark cards on the light panel, mirrors promo-detail-card palette) ── */
.promo-sku-list { display: grid; gap: 0.6rem; margin: 0.5rem 0 0; }
.promo-sku-item {
  width: 100%;
  border: 1px solid #334155;
  border-radius: 12px;
  background: #0f172a;
  color: #f8fafc;
  cursor: pointer;
  text-align: left;
  padding: 0.75rem 0.9rem;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.6rem;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}
.promo-sku-item:hover { transform: translateY(-1px); border-color: #38bdf8; }
.promo-sku-item.active { border-color: #E1FF00; box-shadow: 0 0 0 1px rgba(225,255,0,0.45), 0 8px 22px rgba(225,255,0,0.12); }
.promo-sku-main { min-width: 0; }
.promo-sku-count { display: block; font-size: 1.5rem; font-weight: 700; line-height: 1; }
.promo-sku-label { display: block; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: #94a3b8; margin-top: 0.15rem; }
.promo-sku-side { display: flex; align-items: center; gap: 0.6rem; }
.promo-sku-discount { background: #E1FF00; color: #1a1a1a; border-radius: 8px; padding: 0.15rem 0.45rem; font-size: 0.72rem; font-weight: 700; }
.promo-sku-price { font-size: 1.3rem; font-weight: 700; color: #38bdf8; white-space: nowrap; }
.promo-sku-empty {
  border-radius: 10px;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  padding: 0.8rem;
  font-size: 0.86rem;
}

/* ── Promotion Wallet: recent activity (transaction) rows ── */
.promo-tx-row {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  background: var(--surface-2, #f8fafc);
}
.promo-tx-main { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; font-weight: 600; font-size: 0.92rem; }
.promo-tx-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; font-size: 0.78rem; color: var(--text-muted); margin-top: 0.25rem; }
.promo-tx-row.promo-tx-credit .promo-tx-amount { color: var(--success); }
.promo-tx-row.promo-tx-debit .promo-tx-amount { color: var(--error); }

/* ── Preview & Publish (Step 3) cost breakdown — reuses .payment-intent-result as the outer box ── */
.promo-preview-line { display: flex; justify-content: space-between; padding: 0.2rem 0; font-size: 0.9rem; }
.promo-preview-total { display: flex; justify-content: space-between; padding-top: 0.5rem; margin-top: 0.3rem; border-top: 1px solid var(--border); font-weight: 700; }

/* ── Voucher shortfall (Offer / Add More Rewards) — light inline "buy & retry" box ── */
.promo-shortfall-box {
  margin: 0.5rem 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

/* ── Offer claim result: redemption code + QR (sits inside the dark promo-detail-card) ── */
.promo-qr-box {
  margin-top: 0.6rem;
  padding: 1.1rem 0.75rem;
  background: #1e293b;
  border-radius: 10px;
  text-align: center;
}
.promo-qr-box img { border-radius: 8px; background: #fff; padding: 6px; }
.promo-qr-brand { font-size: 0.78rem; letter-spacing: 0.04em; color: #38bdf8; font-weight: 700; margin-top: 0.5rem; }

/* ── Bottom-sheet modal (Boost / Offer / Repeat / confirmations) ──────────── */
.promo-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 15, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.promo-sheet-backdrop[hidden] { display: none; }
.promo-sheet {
  width: 100%;
  max-width: 440px;
  max-height: 85vh;
  overflow-y: auto;
  background: #141a24;
  color: #f1f5f9;
  border: 1px solid #2a3240;
  border-radius: 18px;
  padding: 0.7rem 1.25rem 1.25rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.promo-sheet-handle { width: 40px; height: 4px; border-radius: 4px; background: #3a4454; margin: 0 auto 0.9rem; }
.promo-sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.9rem; }
.promo-sheet-head-text h4 { margin: 0; font-size: 1.15rem; }
.promo-sheet-head-text p { margin: 0.3rem 0 0; font-size: 0.85rem; color: #94a3b8; }
.promo-sheet-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.promo-sheet-close:hover { color: #f1f5f9; }
.promo-sheet-cost {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  margin: 0.9rem 0;
  font-size: 0.9rem;
}
.promo-sheet-cost strong { font-size: 1.1rem; color: #38bdf8; }
.promo-sheet-footer { display: flex; gap: 0.75rem; margin-top: 1rem; }
.promo-sheet-footer .btn { flex: 1; }
.promo-sheet .field label { color: #cbd5e1; }
.promo-sheet .field input,
.promo-sheet .field select,
.promo-sheet .field textarea {
  background: #0f172a;
  border: 1px solid #334155;
  color: #f1f5f9;
}

/* Enhance-toggle summary line, shown under a toggle row once configured */
.promo-toggle-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: #94a3b8;
  margin: -0.65rem 0 0.75rem;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}
.promo-toggle-summary:hover { color: #38bdf8; }

/* ── Promotion Wallet: balance summary cards ── */
.promo-wallet-balances {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.85rem;
  margin: 0.75rem 0 1rem;
}
.promo-wallet-balance-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 1rem 1.1rem;
  color: #f1f5f9;
}
.promo-wallet-balance-value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.promo-wallet-balance-label { font-size: 0.8rem; color: #94a3b8; margin-top: 0.15rem; }

/* ── Recent Activity (wallet transaction rows) — dark restyle ── */
.promo-tx-row { background: #0f172a; border: 1px solid #263041; color: #f1f5f9; }
.promo-tx-footer { color: #94a3b8; }

/* ── Cost breakdown card (Preview & Publish) ── */
.promo-cost-card {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 1rem 1.1rem;
  color: #f1f5f9;
  margin: 0.75rem 0;
}
.promo-cost-card .promo-preview-line { color: #cbd5e1; }
.promo-cost-card .promo-preview-total { color: #f1f5f9; border-top-color: #334155; }

/* ── Success cards (merchant redeem / payment complete) ── */
.promo-success-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.4rem;
  background: #0f172a;
  border: 1px solid #16a34a;
  border-radius: 14px;
  padding: 1.4rem 1.25rem;
  color: #f1f5f9;
  margin: 0.75rem 0;
}
.promo-success-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 0.3rem;
}
.promo-success-title { font-size: 1.1rem; font-weight: 700; color: #22c55e; }
.promo-success-sub { font-size: 0.86rem; color: #94a3b8; }
.promo-billing-details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: var(--surface-2, #f8fafc);
}
.promo-billing-details summary { cursor: pointer; font-weight: 600; font-size: 0.92rem; }
.promo-billing-details[open] summary { margin-bottom: 0.5rem; }
/* ── /Promotions module ────────────────────────────────────────────────────── */

/* ── Live Playground ──────────────────────────────────────────────────────── */
.lp-body { padding-top: 0.5rem; }
.lp-layout {
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(280px, 1fr);
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 900px) {
  .lp-layout { grid-template-columns: 1fr; }
}
.lp-phone {
  position: relative;
  background: #0b1220;
  border-radius: 36px;
  padding: 14px 12px 18px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.35);
  border: 3px solid #1e293b;
  min-height: 680px;
  color: #f8fafc;
  overflow: hidden;
}
.lp-phone-notch {
  width: 120px;
  height: 22px;
  background: #020617;
  border-radius: 0 0 14px 14px;
  margin: 0 auto 8px;
}
.lp-screen { display: flex; flex-direction: column; height: 640px; }
.lp-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0.4rem 0.75rem;
}
.lp-topbar strong { font-size: 1.15rem; }
.lp-sub { display: block; font-size: 0.72rem; color: #94a3b8; margin-top: 0.15rem; }
.lp-icon-btn {
  width: 36px; height: 36px; border-radius: 999px;
  border: 0; background: rgba(255,255,255,0.08); color: #fff; cursor: pointer; font-size: 1rem;
}
.lp-go-live {
  margin: 0.25rem 0.4rem 0.75rem;
  border: 0;
  border-radius: 16px;
  padding: 0.95rem 1rem;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}
.lp-go-live:disabled { opacity: 0.55; cursor: wait; }
.lp-go-live-dot {
  width: 10px; height: 10px; border-radius: 999px; background: #fff;
  box-shadow: 0 0 0 0 rgba(255,255,255,0.7);
  animation: lpPulseDot 1.4s infinite;
}
@keyframes lpPulseDot {
  0% { box-shadow: 0 0 0 0 rgba(255,255,255,0.55); }
  70% { box-shadow: 0 0 0 10px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}
.lp-hint { margin: 0 0.5rem 0.65rem; font-size: 0.75rem; color: #94a3b8; line-height: 1.4; }
.lp-host-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.25rem 0.35rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.lp-empty, .lp-circle-empty {
  text-align: center; color: #64748b; font-size: 0.85rem; padding: 1.5rem 0.75rem;
}
.lp-host-card {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 0.65rem;
  align-items: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 0.65rem 0.7rem;
  cursor: pointer;
  text-align: left;
  color: inherit;
  width: 100%;
}
.lp-host-card:hover { background: rgba(255,255,255,0.1); }
.lp-host-avatar, .lp-circle-av {
  width: 44px; height: 44px; border-radius: 999px; object-fit: cover; background: #334155;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800;
}
.lp-host-meta strong { display: block; font-size: 0.92rem; }
.lp-host-meta span { font-size: 0.72rem; color: #94a3b8; }
.lp-host-side { display: flex; flex-direction: column; gap: 0.3rem; align-items: flex-end; }
.lp-join-pill {
  background: #2563eb; color: #fff; border: 0; border-radius: 999px;
  padding: 0.3rem 0.65rem; font-size: 0.72rem; font-weight: 700; cursor: pointer;
}
.lp-circle-mini {
  background: transparent; color: #93c5fd; border: 1px solid rgba(147,197,253,0.45);
  border-radius: 999px; padding: 0.22rem 0.5rem; font-size: 0.68rem; cursor: pointer;
}
.lp-screen-room { position: relative; }
.lp-stage {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  overflow: hidden;
  background: radial-gradient(circle at 30% 20%, #1d4ed8 0%, transparent 45%),
              linear-gradient(180deg, #111827 0%, #020617 100%);
  min-height: 640px;
}
.lp-stage-bg {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; font-weight: 900; color: rgba(255,255,255,0.08);
  letter-spacing: 0.2em; pointer-events: none;
}
.lp-room-top {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.65rem 0.65rem 0.35rem;
}
.lp-room-host { flex: 1; min-width: 0; }
.lp-room-host strong { display: block; font-size: 0.95rem; }
.lp-room-host span { font-size: 0.7rem; color: #cbd5e1; }
.lp-pill-danger {
  border: 0; background: #dc2626; color: #fff; border-radius: 999px;
  padding: 0.35rem 0.7rem; font-weight: 700; font-size: 0.75rem; cursor: pointer;
}
.lp-circle-strip {
  position: relative; z-index: 2;
  display: flex; gap: 0.55rem; overflow-x: auto;
  padding: 0.35rem 0.65rem 0.55rem;
  scrollbar-width: none;
}
.lp-circle-strip::-webkit-scrollbar { display: none; }
.lp-circle-person {
  flex: 0 0 auto;
  width: 64px;
  text-align: center;
  position: relative;
}
.lp-circle-person .lp-circle-av { width: 48px; height: 48px; margin: 0 auto; border: 2px solid rgba(255,255,255,0.35); }
.lp-circle-person.is-host .lp-circle-av { border-color: #fbbf24; }
.lp-circle-person small {
  display: block; margin-top: 0.2rem; font-size: 0.62rem; color: #e2e8f0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lp-circle-kick {
  position: absolute; top: -2px; right: 4px;
  width: 18px; height: 18px; border-radius: 999px; border: 0;
  background: #ef4444; color: #fff; font-size: 0.65rem; cursor: pointer; line-height: 1;
}
.lp-toast {
  position: relative; z-index: 3;
  margin: 0 0.65rem 0.4rem;
  background: rgba(37, 99, 235, 0.92);
  color: #fff; border-radius: 12px; padding: 0.55rem 0.7rem;
  font-size: 0.78rem; font-weight: 600;
}
.lp-chat-feed {
  position: relative; z-index: 2;
  flex: 1;
  overflow-y: auto;
  padding: 0.4rem 0.75rem 0.5rem;
  display: flex; flex-direction: column; gap: 0.4rem;
  mask-image: linear-gradient(to bottom, transparent 0%, #000 12%, #000 100%);
}
.lp-msg {
  max-width: 88%;
  background: rgba(15, 23, 42, 0.55);
  border-radius: 14px;
  padding: 0.4rem 0.6rem;
  backdrop-filter: blur(4px);
}
.lp-msg.is-mine { align-self: flex-end; background: rgba(37, 99, 235, 0.75); }
.lp-msg-name { font-size: 0.68rem; font-weight: 700; color: #93c5fd; margin-bottom: 0.1rem; }
.lp-msg.is-mine .lp-msg-name { color: #dbeafe; }
.lp-msg-text { font-size: 0.84rem; line-height: 1.35; white-space: pre-wrap; word-break: break-word; }
.lp-room-actions {
  position: relative; z-index: 2;
  display: flex; gap: 0.35rem; flex-wrap: wrap;
  padding: 0.25rem 0.65rem;
}
.lp-chip {
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: #fff; border-radius: 999px;
  padding: 0.3rem 0.65rem; font-size: 0.72rem; cursor: pointer;
}
.lp-composer {
  position: relative; z-index: 2;
  display: flex; gap: 0.4rem;
  padding: 0.55rem 0.65rem 0.75rem;
}
.lp-composer input {
  flex: 1; border: 0; border-radius: 999px;
  background: rgba(255,255,255,0.12); color: #fff;
  padding: 0.7rem 0.9rem; font-size: 0.88rem;
}
.lp-composer input::placeholder { color: #94a3b8; }
.lp-composer input:disabled { opacity: 0.55; }
.lp-composer button {
  border: 0; border-radius: 999px; background: #2563eb; color: #fff;
  padding: 0 1rem; font-weight: 700; cursor: pointer;
}
.lp-composer button:disabled { opacity: 0.45; cursor: not-allowed; }
.lp-side h3 { margin: 0 0 0.35rem; font-size: 1rem; }
.lp-pulse {
  background: #0f172a; color: #e2e8f0;
  border-radius: 12px; min-height: 180px; max-height: 260px;
  overflow-y: auto; padding: 0.65rem 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem; line-height: 1.45;
}
.lp-pulse-empty { color: #64748b; }
.lp-pulse-row { margin-bottom: 0.45rem; border-bottom: 1px solid rgba(148,163,184,0.15); padding-bottom: 0.35rem; }
.lp-pulse-row strong { color: #38bdf8; }
.lp-status-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem;
  margin: 0.75rem 0;
}
.lp-status-grid div {
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 0.45rem 0.55rem;
}
.lp-status-grid span { display: block; font-size: 0.68rem; color: #94a3b8; }
.lp-status-grid strong { font-size: 0.8rem; color: #0f172a; word-break: break-all; }
.lp-steps {
  margin: 0.5rem 0 0.75rem; padding-left: 1.15rem;
  font-size: 0.82rem; color: #475569; line-height: 1.45;
}

/* removedByHost — Live Studio / Playground */
.lp-host-card.is-removed {
  opacity: 0.72;
  border-color: #fecaca;
  background: #fff7f7;
}
.lp-join-pill.is-blocked,
.lp-join-pill:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

