:root {
  --bg-deep: #070b14;
  --bg-surface: rgba(15, 23, 42, 0.76);
  --bg-elevated: rgba(30, 41, 59, 0.58);
  --bg-input: rgba(9, 14, 26, 0.85);
  --border-subtle: rgba(148, 163, 184, 0.16);
  --border-highlight: rgba(56, 189, 248, 0.42);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-sky: #38bdf8;
  --accent-indigo: #818cf8;
  --accent-emerald: #10b981;
  --accent-emerald-bright: #34d399;
  --accent-danger: #ef4444;
  --accent-amber: #f59e0b;

  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 24px 54px -16px rgba(0, 0, 0, 0.65);
  --font-sans: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'SF Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

.ambient-glow-1 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, #0ea5e9 0%, transparent 70%);
  top: -160px;
  left: -120px;
}

.ambient-glow-2 {
  width: 560px;
  height: 560px;
  background: radial-gradient(circle, #10b981 0%, transparent 70%);
  bottom: -200px;
  right: -140px;
  opacity: 0.25;
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 24px 56px;
}

.hidden {
  display: none !important;
}

/* Top Navigation */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(52, 211, 153, 0.2));
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--accent-sky);
  display: grid;
  place-items: center;
}

.brand-icon svg {
  width: 24px;
  height: 24px;
}

.brand-title {
  display: block;
  font-size: 1.16rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.device-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--text-secondary);
  transition: border-color 0.18s;
}

.device-pill:focus-within {
  border-color: var(--accent-sky);
  color: var(--text-primary);
}

.device-pill input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.84rem;
  font-weight: 500;
  width: 152px;
  outline: none;
}

.ws-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(52, 211, 153, 0.28);
  color: #d1fae5;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald-bright);
  box-shadow: 0 0 8px var(--accent-emerald-bright);
}

/* Toast Banner */
.toast-banner {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.45);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
}

.toast-banner[data-tone='error'] {
  border-color: rgba(239, 68, 68, 0.65);
  background: rgba(69, 10, 10, 0.78);
  color: #fecaca;
}

.toast-banner[data-tone='success'] {
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(6, 78, 59, 0.72);
  color: #d1fae5;
}

/* Views & Hero */
.view-container {
  margin-top: 28px;
}

.hero-header {
  text-align: center;
  max-width: 720px;
  margin: 8px auto 34px;
}

.hero-badge {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent-sky);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 5px 13px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.hero-header h1 {
  margin: 0 0 12px;
  font-size: clamp(1.85rem, 3.6vw, 2.6rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hero-header p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 1.02rem;
  line-height: 1.55;
}

/* Cards */
.glass-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(20px);
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.role-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.role-card:hover {
  border-color: rgba(148, 163, 184, 0.32);
}

.role-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.role-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
}

.role-icon svg {
  width: 24px;
  height: 24px;
}

.role-icon-send {
  background: rgba(56, 189, 248, 0.14);
  color: var(--accent-sky);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.role-icon-receive {
  background: rgba(16, 185, 129, 0.14);
  color: var(--accent-emerald-bright);
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.role-tag {
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-sky);
}

.role-tag-emerald {
  background: rgba(16, 185, 129, 0.14);
  color: var(--accent-emerald-bright);
}

.role-card h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.role-desc {
  margin: 0 0 22px;
  color: var(--text-secondary);
  font-size: 0.93rem;
  line-height: 1.5;
  flex-grow: 1;
}

.security-strip {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.sec-item {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sec-item strong {
  font-size: 0.85rem;
  color: var(--text-primary);
}

.sec-item span {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.field-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.field-label-sm {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.code-input-row {
  display: flex;
  gap: 10px;
}

#syncCodeInput {
  flex: 1;
  min-width: 0;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 1.38rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-align: center;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

#syncCodeInput:focus,
#extraSyncCodeInput:focus {
  border-color: var(--accent-sky);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}

.form-hint {
  margin: 10px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.receive-options {
  margin-bottom: 16px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border-subtle);
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 0.84rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.checkbox-row input {
  margin-top: 2px;
  accent-color: var(--accent-emerald);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 11px 18px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, filter 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

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

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

.btn-lg {
  padding: 14px 22px;
  font-size: 0.98rem;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-xs {
  padding: 5px 10px;
  font-size: 0.76rem;
  border-radius: 6px;
}

.btn-full {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.1);
}

.btn-emerald {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
}

.btn-emerald:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn-secondary {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.38);
  color: var(--accent-sky);
}

.btn-ghost {
  background: var(--bg-elevated);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.btn-ghost:hover:not(:disabled) {
  border-color: rgba(148, 163, 184, 0.4);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.28);
}

.btn-danger-outline {
  background: transparent;
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 8px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent-sky);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}

.link-btn:hover {
  text-decoration: underline;
}

.icon-sm {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

/* Receiver Waiting View */
.centered-session-card {
  max-width: 620px;
  margin: 0 auto;
  padding: 36px 32px;
  text-align: center;
}

.session-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-emerald-bright);
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.3);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.centered-session-card h2 {
  margin: 0 0 10px;
  font-size: 1.55rem;
}

.muted-text {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0;
}

.sync-code-display {
  margin: 26px auto 16px;
  padding: 22px 28px;
  background: var(--bg-input);
  border: 1px solid rgba(52, 211, 153, 0.4);
  border-radius: 16px;
  font-family: var(--font-mono);
  font-size: clamp(2.2rem, 6vw, 3.25rem);
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #ecfdf5;
  box-shadow: inset 0 0 32px rgba(16, 185, 129, 0.09);
  user-select: all;
}

.code-meta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.dot-sep {
  color: var(--text-muted);
}

.approval-prompt {
  margin-top: 24px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.45);
}

.approval-title {
  font-size: 0.95rem;
  margin-bottom: 14px;
}

.approval-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.card-footer-actions {
  margin-top: 26px;
}

/* Active Session Shell */
.active-session-shell {
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.session-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.peer-summary {
  display: flex;
  align-items: center;
  gap: 12px;
}

.live-pulse-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent-emerald-bright);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.65);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(52, 211, 153, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
  }
}

.peer-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.peer-title {
  font-size: 1.1rem;
  font-weight: 700;
}

/* Multi-Speaker Add Bar & Chips */
.extra-speaker-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

#extraSyncCodeInput {
  width: 148px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 7px 10px;
  outline: none;
}

.connected-speakers-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(275px, 1fr));
  gap: 10px;
}

.speaker-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(52, 211, 153, 0.28);
  border-radius: var(--radius-md);
}

.speaker-chip-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.speaker-chip-name {
  font-size: 0.9rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.speaker-chip-meta {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--accent-emerald-bright);
}

.telemetry-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stat-pill {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.stat-pill-lan {
  color: var(--accent-emerald-bright);
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(16, 185, 129, 0.1);
}

.now-playing-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}

.eyebrow-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-sky);
  font-weight: 600;
  margin-bottom: 3px;
}

.now-playing-info h3 {
  margin: 0;
  font-size: 1.05rem;
}

.codec-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(129, 140, 248, 0.15);
  border: 1px solid rgba(129, 140, 248, 0.32);
  color: #c7d2fe;
}

/* Visualizer */
.visualizer-frame {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  height: 112px;
}

.visualizer-compact {
  height: 88px;
}

.visualizer-frame canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Source Picker Tabs */
.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-heading-row h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.active-source-pill {
  font-size: 0.78rem;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--accent-sky);
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.source-tab {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.source-tab.active {
  background: rgba(56, 189, 248, 0.16);
  border-color: var(--accent-sky);
  color: var(--text-primary);
}

.source-pane {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
}

.capture-cta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.capture-cta-row h4 {
  margin: 0 0 5px;
  font-size: 1rem;
}

.capture-btns {
  display: flex;
  gap: 10px;
  align-items: center;
}

.guide-accordion {
  margin-top: 16px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
}

.guide-accordion summary {
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--accent-sky);
}

.guide-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.guide-box {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 0.81rem;
}

.guide-box strong {
  display: block;
  margin-bottom: 5px;
  color: var(--text-primary);
}

.guide-box p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* File Dropzone & Theater Player */
.file-dropzone {
  border: 1.5px dashed rgba(56, 189, 248, 0.4);
  border-radius: var(--radius-md);
  padding: 22px;
  background: rgba(9, 14, 26, 0.5);
  transition: border-color 0.18s, background 0.18s;
}

.file-dropzone.drag-over {
  border-color: var(--accent-emerald-bright);
  background: rgba(16, 185, 129, 0.1);
}

.dropzone-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.dropzone-icon {
  width: 38px;
  height: 38px;
  color: var(--accent-sky);
  flex-shrink: 0;
}

.dropzone-content p {
  margin: 4px 0 0;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.theater-player-wrap {
  margin-top: 14px;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.theater-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 14px;
  background: rgba(15, 23, 42, 0.92);
  font-size: 0.84rem;
}

#localMediaPlayer {
  width: 100%;
  max-height: 400px;
  display: block;
  background: #000;
}

.device-capture-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.device-select-col {
  flex: 1;
  min-width: 240px;
}

.device-btn-col {
  display: flex;
  gap: 8px;
}

.select-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.88rem;
  padding: 10px 12px;
  outline: none;
}

/* Sub-panels & Sync Controls */
.controls-grid-two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.sub-panel {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.sub-panel-header h4 {
  margin: 0;
  font-size: 0.92rem;
}

.subtle-stat {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.segmented-control {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}

.seg-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.seg-btn.active {
  background: rgba(56, 189, 248, 0.2);
  color: var(--text-primary);
}

.panel-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.slider-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  min-width: 108px;
}

.slider-row input[type='range'],
.sync-slider-wrap input[type='range'] {
  flex: 1;
  width: 100%;
  accent-color: var(--accent-sky);
  cursor: pointer;
}

.slider-val {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  min-width: 44px;
  text-align: right;
}

.sync-header-btns {
  display: flex;
  gap: 6px;
}

#syncPulseBtn.pulse-on {
  background: rgba(52, 211, 153, 0.22);
  border-color: var(--accent-emerald-bright);
  color: var(--accent-emerald-bright);
}

.sync-scale-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.sync-scale-labels strong {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent-sky);
}

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

.nudge-btn {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: 6px;
  padding: 6px 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
}

.nudge-btn:hover {
  border-color: var(--accent-sky);
  color: var(--text-primary);
}

@media (max-width: 640px) {
  .app-shell {
    padding: 14px 14px 40px;
  }
  .code-input-row {
    flex-direction: column;
  }
  .session-topbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .extra-speaker-form {
    width: 100%;
  }
  #extraSyncCodeInput {
    flex: 1;
  }
}
