html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background-color: #ffffff; /* Clean, premium solid white */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow: hidden;
  /* CSS Resets to completely block double-tap to zoom and native touch delays */
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.remote-app {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Floating Status Indicator Overlay */
.status-overlay {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #e4e4e7; /* simple clean zinc border */
  padding: 6px 14px;
  border-radius: 0px; /* zero round */
  box-shadow: none;
  pointer-events: none; /* Let clicks pass through to split buttons */
  backdrop-filter: blur(8px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 0px; /* sharp square status indicator */
  display: inline-block;
}

.dot-connecting {
  background-color: #f59e0b; /* clean amber */
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
  animation: pulse 1.5s infinite ease-in-out;
}

.dot-connected {
  background-color: #10b981; /* clean emerald green */
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

.dot-error {
  background-color: #ef4444; /* clean rose red */
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

.status-text {
  font-size: 11px;
  font-weight: 700;
  color: #52525b; /* zinc-600 */
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* 50/50 Horizontal Split Screen container */
.split-container {
  display: flex;
  width: 100%;
  height: 100%;
}

.control-btn {
  position: relative;
  flex: 1;
  height: 100%;
  border: none;
  outline: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  box-sizing: border-box;
}

/* Split design: Left button white, right button very soft zinc-50 */
.prev-btn {
  background: #ffffff;
  border-right: 1px solid #e4e4e7;
}

.next-btn {
  background: #fafafa; /* premium subtle offset white */
}

.control-btn:disabled {
  background: #fafafa !important;
  cursor: not-allowed;
}

.control-btn:disabled .btn-icon {
  color: #e4e4e7 !important; /* zinc-200 */
  text-shadow: none !important;
}

.control-btn:disabled .btn-label {
  color: #a1a1aa !important; /* zinc-400 */
}

/* Hover and touch active scales */
.control-btn:not(:disabled):hover {
  background-color: #f4f4f5; /* zinc-100 */
}

.control-btn:not(:disabled):active {
  transform: scale(0.97); /* subtle mechanical compress action */
}

.prev-btn:not(:disabled):active {
  background: #e4e4e7; /* zinc-200 */
}

.next-btn:not(:disabled):active {
  background: #e4e4e7; /* zinc-200 */
}

.btn-icon {
  font-size: 32px;
  color: #18181b; /* solid deep zinc-900 */
  transition: transform 0.15s ease;
  user-select: none;
  pointer-events: none;
}

.prev-btn:not(:disabled) .btn-icon {
  color: #18181b;
  text-shadow: none;
}

.next-btn:not(:disabled) .btn-icon {
  color: #18181b;
  text-shadow: none;
}

.btn-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #a1a1aa; /* zinc-400 */
  user-select: none;
  pointer-events: none;
}

.control-btn:not(:disabled) .btn-label {
  color: #71717a; /* zinc-500 */
}

/* High reactivity mechanical tap ripples: Clean dark ripple on light theme! */
.ripple {
  position: absolute;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05); /* very soft neutral dark pulse */
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
}

.ripple-active {
  animation: ripple-pulse 0.3s ease-out;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@keyframes ripple-pulse {
  0% {
    width: 0;
    height: 0;
    opacity: 0.6;
  }
  100% {
    width: 250px;
    height: 250px;
    opacity: 0;
  }
}

/* Room ID & Connection Debug Footer Display */
.room-footer {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.debug-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #e4e4e7;
  padding: 4px 10px;
  border-radius: 0px; /* zero round */
  box-shadow: none;
  backdrop-filter: blur(8px);
  white-space: nowrap;
}

.footer-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  color: #71717a;
  letter-spacing: 0.5px;
}

.footer-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 10px;
  font-weight: 850;
  color: #18181b; /* premium dark footer ID */
}

/* Heartbeat feedback scaling on dot */
.dot {
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.dot.pulse-glow {
  transform: scale(1.5);
}

/* Sleek Target Presentation Metadata Card (Favicon + Title) */
.deck-metadata {
  position: absolute;
  top: 58px; /* Positioned nicely below the 16px top status overlay badge */
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 85%;
  background: #ffffff;
  border: 1px solid #e4e4e7; /* zinc-200 border matching footer debug pills */
  padding: 6px 14px;
  border-radius: 0px; /* absolute flat architecture */
  box-shadow: none;
  animation: fade-in-deck 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.deck-favicon {
  width: 14px;
  height: 14px;
  object-fit: contain;
  flex-shrink: 0;
}

.deck-title {
  font-size: 11px;
  font-weight: 700;
  color: #18181b; /* zinc-900 */
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
}

@keyframes fade-in-deck {
  0% {
    opacity: 0;
    transform: translate(-50%, -4px);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Live Presentation Slide Preview Panel */
.preview-container {
  position: absolute;
  bottom: 80px; /* Positioned neatly above the footer at 16px */
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  max-width: 90%;
  max-height: 40%;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none; /* Let touch pings/taps bypass to underlying clicker buttons */
  animation: fade-in-preview 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.preview-video {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain; /* scale proportionally, no cropping, no black bars */
  outline: none;
  border: none;
  background: transparent;
}

.preview-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(239, 68, 68, 0.95); /* vibrant live red badge */
  padding: 2px 6px;
  border-radius: 0px; /* sharp square */
}

.preview-badge-dot {
  width: 4px;
  height: 4px;
  background-color: #ffffff;
  border-radius: 0px; /* square dot */
  display: inline-block;
  animation: preview-pulse 1s infinite ease-in-out;
}

.preview-badge-text {
  font-size: 7px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

@keyframes fade-in-preview {
  0% {
    opacity: 0;
    transform: translate(-50%, 4px);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes preview-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* Floating Connection Diagnostic Overlay */
.diagnostic-overlay {
  position: absolute;
  top: 120px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #e4e4e7;
  padding: 12px 18px;
  border-radius: 0px;
  box-shadow: none;
  min-width: 200px;
  pointer-events: none;
}

.diagnostic-header {
  font-size: 8px;
  font-weight: 750;
  text-transform: uppercase;
  color: #71717a;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #f4f4f5;
  padding-bottom: 4px;
  margin-bottom: 2px;
}

.diagnostic-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: #52525b;
}

.diagnostic-item .icon {
  font-size: 10px;
  width: 12px;
  text-align: center;
}

.diagnostic-item.done {
  color: #10b981;
}

.diagnostic-item.failed {
  color: #ef4444;
}

/* Real-time Web Console Overlay */
.web-console-container {
  position: absolute;
  bottom: 85px; /* Positioned nicely above the footer debug pills */
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  width: 90%;
  max-width: 360px;
  background: #09090b; /* solid deep black */
  border: 1px solid #18181b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  box-shadow: none;
  pointer-events: auto; /* enable interactions */
}

.console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: #18181b;
  border-bottom: 1px solid #27272a;
  font-size: 8px;
  font-weight: 750;
  color: #a1a1aa;
  letter-spacing: 0.5px;
}

.clear-console-btn {
  background: transparent;
  border: none;
  color: #f97316;
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.clear-console-btn:hover {
  color: #fdba74;
}

.console-log {
  height: 100px;
  overflow-y: auto;
  padding: 8px 10px;
  font-size: 9px;
  line-height: 1.4;
  color: #34d399; /* matrix emerald green */
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-entry {
  word-break: break-all;
  white-space: pre-wrap;
  text-align: left;
}

.log-time {
  color: #71717a;
  margin-right: 4px;
}

/* Web Toggle Console Button */
.web-toggle-console-btn {
  position: absolute;
  bottom: 48px; /* sits right above footer room badge */
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  border: 1px solid #e4e4e7;
  background: #ffffff;
  color: #71717a;
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  cursor: pointer;
  text-transform: uppercase;
  border-radius: 0px;
  pointer-events: auto; /* enable interactions */
  transition: all 0.1s ease;
}

.web-toggle-console-btn:hover {
  background: #f4f4f5;
  color: #18181b;
  border-color: #a1a1aa;
}

/* Floating Connection Timeline Overlay */
.web-timeline-container {
  position: absolute;
  top: 285px; /* placed right below connection checklist */
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #ffffff;
  border: 1px dashed #e4e4e7;
  padding: 12px 18px;
  border-radius: 0px;
  box-shadow: none;
  min-width: 200px;
  max-width: 280px;
  pointer-events: none; /* ensure clicks fall through to slides! */
}

.timeline-header {
  font-size: 8px;
  font-weight: 750;
  text-transform: uppercase;
  color: #71717a;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #f4f4f5;
  padding-bottom: 4px;
  margin-bottom: 2px;
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timeline-step {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 9px;
  font-weight: 600;
  color: #52525b;
  gap: 12px;
}

.timeline-step-name {
  color: #18181b;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.timeline-step-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  color: #f97316; /* warm orange */
  font-weight: 750;
  flex-shrink: 0;
}

/* WebRTC Active Peer Details Card */
.web-rtc-details-card {
  position: absolute;
  top: 120px; /* displays in the same position as the diagnostic checklist when connected! */
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #e4e4e7;
  padding: 12px 18px;
  border-radius: 0px;
  box-shadow: none;
  min-width: 220px;
  max-width: 280px;
  pointer-events: auto;
}

.web-rtc-details-card .card-header {
  font-size: 8px;
  font-weight: 750;
  text-transform: uppercase;
  color: #71717a;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #f4f4f5;
  padding-bottom: 4px;
  margin-bottom: 4px;
}

.rtc-candidates-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.rtc-candidate-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
  font-weight: 600;
  color: #71717a;
  padding: 2px 0;
}

.rtc-candidate-row.active {
  color: #18181b;
}

.rtc-candidate-ip {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  max-width: 130px;
}

.rtc-candidate-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rtc-candidate-type {
  font-size: 8px;
  font-weight: 750;
  text-transform: uppercase;
  background: transparent;
  padding: 1px 3px;
}

.rtc-candidate-row.active .rtc-candidate-type {
  background: #f4f4f5;
}

.rtc-candidate-status {
  font-size: 8px;
  font-weight: 750;
}

.rtc-candidate-status.active {
  color: #10b981;
}

.rtc-candidate-status.attempting {
  color: #3b82f6; /* premium vibrant blue */
}

.rtc-candidate-status.inactive {
  color: #a1a1aa;
}

.rtc-empty-placeholder {
  font-size: 9px;
  font-weight: 600;
  color: #a1a1aa;
  font-style: italic;
  padding: 4px 0;
  text-align: center;
}





