/* ==========================================================================
   GotchiLab_ :: Apple & Linear Inspired High-End UI Stylesheet
   MediaLab_ STEAM Education // ESP32 Web Serial Deployer
   ========================================================================== */

:root {
  --bg-deep: #050812;
  --bg-surface: rgba(9, 14, 26, 0.62);
  --bg-surface-elevated: rgba(14, 22, 38, 0.70);
  --bg-chassis: #060914;
  
  --border-glass: rgba(255, 255, 255, 0.10);
  --border-cyan-highlight: rgba(0, 240, 255, 0.42);
  --border-subtle: #162033;
  
  --cyan: #00f0ff;
  --cyan-glow: rgba(0, 240, 255, 0.55);
  --green: #00ff9d;
  --green-glow: rgba(0, 255, 157, 0.40);
  --amber: #ffb800;
  --red: #ff3860;
  
  --text-main: #e2e8f0;
  --text-muted: #8899ac;
  --text-bright: #ffffff;
  
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-logo: 'Comfortaa', 'Nunito', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100vh;
  /* Deep, elegant cybernetic lab backdrop with subtle luminous highlights */
  background: 
    radial-gradient(circle at 14% 28%, rgba(0, 240, 255, 0.075) 0%, transparent 38%),
    radial-gradient(circle at 86% 62%, rgba(0, 220, 255, 0.038) 0%, transparent 45%),
    radial-gradient(circle at 50% 100%, rgba(14, 165, 233, 0.05) 0%, transparent 50%),
    linear-gradient(180deg, #040710 0%, #060b17 50%, #04060e 100%);
  color: var(--text-main);
  font-family: var(--font-sans);
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  max-width: 100vw;
}

/* ==========================================================================
   1. Ambient Lights, Grid & Retro Pixel Universe
   ========================================================================== */

canvas#ambientPixelCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

.ambient-glow {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(140px);
  z-index: 0;
}

.glow-cyan {
  width: 750px;
  height: 750px;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.065) 0%, rgba(0, 150, 255, 0.02) 48%, transparent 75%);
  top: 5%;
  right: -80px;
}

.glow-blue {
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.07) 0%, transparent 70%);
  bottom: 5%;
  left: 20%;
}

/* Dedicated ambient glow for the left side of the screen */
.glow-left {
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.08) 0%, rgba(20, 45, 90, 0.04) 40%, transparent 70%);
  top: 15%;
  left: -150px;
}

/* Crisp, Refined Cybernetic Blueprint Grid (Deep Dark High-Contrast) */
.ambient-grid-pattern {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  background-image: 
    linear-gradient(to right, rgba(0, 240, 255, 0.032) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 240, 255, 0.032) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: radial-gradient(circle at 50% 50%, black 65%, rgba(0, 0, 0, 0.20) 95%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, black 65%, rgba(0, 0, 0, 0.20) 95%);
}

/* Interactive Ambient Neon Cursor Spotlight (Subtle Glow Under Pointer & Glass) */
.cursor-spotlight {
  position: fixed;
  top: 0;
  left: 0;
  width: 520px;
  height: 520px;
  margin-top: -260px;
  margin-left: -260px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1; /* In front of ambient grid/canvas (z-index: 0), behind frosted glass cards (z-index: 2) */
  background: radial-gradient(
    circle,
    rgba(0, 240, 255, 0.065) 0%,
    rgba(0, 210, 255, 0.035) 28%,
    rgba(0, 150, 255, 0.012) 52%,
    rgba(0, 80, 255, 0.003) 72%,
    transparent 82%
  );
  filter: blur(42px);
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, opacity;
}

.cursor-spotlight.active {
  opacity: 0.85;
}

@media (hover: none) {
  .cursor-spotlight {
    display: none !important;
  }
}

/* ==========================================================================
   2. Main Viewport & Navigation (Adaptive Device Height & Sizing)
   ========================================================================== */

.app-viewport {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 24px 8px 24px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  overflow-x: hidden;
}

@media (min-width: 901px) {
  .app-viewport {
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
  }
}

/* Highly Polished Responsive Navigation Bar */
.navbar {
  width: 100%;
  max-width: 980px;
  margin: 0 auto 8px auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 18px;
  min-height: 48px;
  background: rgba(12, 22, 40, 0.72);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 2px solid rgba(0, 240, 255, 0.6);
  border-radius: 12px;
  box-shadow: 
    0 15px 35px rgba(0, 0, 0, 0.45),
    0 0 20px rgba(0, 240, 255, 0.08);
  flex-shrink: 0;
}

.nav-brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

/* GotchiLab_ Official Link Component */
.brand-title-link {
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  transition: all 0.25s ease;
}

.brand-title {
  font-size: 1.20rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--text-bright);
  transition: color 0.25s ease, transform 0.25s ease;
}

.brand-title span {
  color: var(--cyan);
  text-shadow: 0 0 16px var(--cyan-glow);
}

.brand-title-link:hover .brand-title {
  color: #ffffff;
  transform: translateY(-1px);
}

.brand-title-link:hover .brand-title span {
  text-shadow: 0 0 24px var(--cyan), 0 0 35px rgba(0, 240, 255, 0.9);
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.8px;
}

/* MediaLab_ Official Serigraphy Brand Component (Stacked + Blinking Underscore) */
.medialab-brand-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  background: rgba(10, 18, 34, 0.60);
  border: 1px solid rgba(0, 240, 255, 0.30);
  padding: 5px 12px;
  border-radius: 10px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.medialab-brand-card:hover {
  background: rgba(0, 240, 255, 0.14);
  border-color: var(--cyan);
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.35);
  transform: translateY(-1.5px);
}

/* Authentic Voluminica Stacked Typography */
.medialab-logo-stacked {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-family: var(--font-logo);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 0.84;
  letter-spacing: -0.5px;
  color: #ffffff;
}

.ml-word-media {
  display: block;
}

.ml-word-lab {
  display: block;
}

/* Authentic MediaLab Blinking Underscore Cursor */
.cursor-blink {
  display: inline-block;
  color: var(--cyan);
  font-weight: 900;
  text-shadow: 0 0 12px var(--cyan);
  animation: cursorBlink 1.0s infinite;
  margin-left: 1px;
}

@keyframes cursorBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.medialab-brand-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  padding-left: 10px;
}

.ml-meta-inst {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  color: #cbd5e1;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.ml-meta-campus {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--cyan);
  letter-spacing: 0.5px;
}

/* Browser Alert Banner (Hidden by default, active only if unsupported) */
.browser-banner {
  display: none !important;
  width: 100%;
  max-width: 980px;
  margin: -12px auto 12px auto;
  background: rgba(255, 59, 92, 0.14);
  border: 1px solid var(--red);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.82rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  align-items: center;
  gap: 12px;
}

.browser-banner.active {
  display: flex !important;
}

.banner-icon { font-size: 1.3rem; }
.banner-text strong { color: var(--red); display: block; margin-bottom: 2px; }

/* ==========================================================================
   3. Harmonious Centered Experience Stage (Unified Balanced Composition)
   ========================================================================== */

.experience-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  flex: 1;
  min-height: 0;
  overflow: visible;
}

/* Center Station (Ultra-Translucent Frosted Glass HUD) */
.control-station {
  position: relative;
  z-index: 2; /* In FRONT of the floating character */
  flex: 0 0 540px;
  max-width: 550px;
  border-radius: 16px;
  padding: 15px 18px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.glass-hud {
  background: rgba(6, 11, 20, 0.13);
  backdrop-filter: blur(12px) saturate(185%);
  -webkit-backdrop-filter: blur(12px) saturate(185%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-top: 1.5px solid rgba(0, 240, 255, 0.50);
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.65),
    0 0 30px rgba(0, 240, 255, 0.08);
  transition: all 0.3s ease;
}

.glass-hud:hover {
  border-color: rgba(0, 240, 255, 0.30);
  border-top-color: var(--cyan);
  background: rgba(6, 11, 20, 0.17);
}

/* Station Blocks */
.station-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

.block-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.block-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 1.2px;
  color: var(--cyan);
}

.block-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.block-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-bright);
}

.target-profile-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--cyan);
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.3);
  padding: 2px 7px;
  border-radius: 5px;
}

/* Hardware Switches Cluster */
.switches-cluster {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.switch-pill {
  background: rgba(8, 14, 26, 0.22);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  transition: all 0.25s ease;
  min-width: 0;
  box-sizing: border-box;
}

.switch-pill:hover {
  background: rgba(12, 20, 38, 0.38);
  border-color: rgba(0, 240, 255, 0.35);
  transform: translateY(-1px);
}

.switch-pill.active {
  border-color: var(--border-cyan-highlight);
  background: rgba(0, 240, 255, 0.05);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.08);
}

.pill-body {
  display: flex;
  gap: 7px;
  flex: 1;
  min-width: 0;
}

.pill-icon-badge {
  font-size: 1.15rem;
  line-height: 1;
  padding-top: 1px;
  flex-shrink: 0;
}

.pill-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.pill-header {
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex-wrap: wrap;
}

.pill-name {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text-bright);
}

.pill-role {
  font-family: var(--font-mono);
  font-size: 0.60rem;
  font-weight: 600;
  color: var(--cyan);
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.25);
  padding: 1px 4px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.pill-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.30;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pill-pin {
  font-family: var(--font-mono);
  font-size: 0.60rem;
  color: #64748b;
  margin-top: 2px;
  white-space: nowrap;
}

/* Minimalist Toggle Track */
.toggle-track {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.toggle-track input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-thumb {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #1a2538;
  border-radius: 20px;
  border: 1px solid #28374f;
  transition: .25s ease;
}

.toggle-thumb:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background-color: #64748b;
  border-radius: 50%;
  transition: .25s cubic-bezier(0.4, 0, 0.2, 1);
}

input:checked + .toggle-thumb {
  background-color: rgba(0, 240, 255, 0.2);
  border-color: var(--cyan);
}

input:checked + .toggle-thumb:before {
  transform: translateX(16px);
  background-color: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

/* Master Action Button */
.btn-master-flash {
  position: relative;
  width: 100%;
  padding: 11px 20px;
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #04060a;
  background: linear-gradient(135deg, #00f0ff 0%, #00ff9d 100%);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.35);
  transition: all 0.25s ease;
  font-family: var(--font-sans);
  overflow: hidden;
  flex-shrink: 0;
}

.btn-master-flash:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 0 35px rgba(0, 240, 255, 0.6);
  filter: brightness(1.06);
}

.btn-master-flash:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-master-flash:disabled {
  background: #172233;
  color: #4b5a70;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-flash-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.flash-bolt-icon {
  fill: #04060a;
}

/* HUD Progress Meter */
.flash-hud-meter {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.meter-info-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
}

.meter-pct {
  color: var(--cyan);
  font-weight: 700;
}

.meter-track {
  width: 100%;
  height: 6px;
  background: #0d1421;
  border: 1px solid var(--border-glass);
  border-radius: 4px;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00f0ff, #00ff9d);
  box-shadow: 0 0 10px #00f0ff;
  transition: width 0.2s ease;
}

.meter-steps {
  display: flex;
  justify-content: space-between;
  gap: 5px;
  margin-top: 2px;
}

.step-chip {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(14, 21, 35, 0.6);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  flex: 1;
  text-align: center;
  transition: all 0.25s ease;
}

.step-chip.active {
  color: var(--cyan);
  border-color: var(--cyan);
  background: rgba(0, 240, 255, 0.15);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.step-chip.done {
  color: #00ff9d;
  border-color: #00ff9d;
  background: rgba(0, 255, 157, 0.18);
  box-shadow: 0 0 12px rgba(0, 255, 157, 0.35);
  font-weight: 700;
}

/* Compact Telemetry Stream */
.telemetry-terminal {
  background: rgba(3, 6, 12, 0.26);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  border: 1px solid var(--border-glass);
  border-radius: 9px;
  overflow: hidden;
}

.terminal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(7, 12, 22, 0.36);
  padding: 4px 11px;
  border-bottom: 1px solid var(--border-glass);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
}

.btn-clear-term {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  cursor: pointer;
}

.btn-clear-term:hover { color: var(--text-bright); }

.terminal-view {
  height: 65px;
  overflow-y: auto;
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1.4;
  color: #94a3b8;
  white-space: pre-wrap;
  word-break: break-all;
}

.log-dim { color: #526173; }
.log-cyan { color: var(--cyan); }
.log-success { color: var(--green); font-weight: 600; }
.log-error { color: var(--red); font-weight: 600; }

/* ==========================================================================
   4. Pure Floating Penguin Stage (Frameless, Giant & Centered Overlap)
   ========================================================================== */

.pure-penguin-stage {
  flex: 0 0 1050px;
  max-width: 1080px;
  margin-left: -465px;
  margin-right: -352px;
  z-index: 1;
  position: relative;
  pointer-events: none;
  display: flex;
  justify-content: center;
  align-items: center;
  mask-image: linear-gradient(to right, black 70%, rgba(0, 0, 0, 0.5) 86%, transparent 98%);
  -webkit-mask-image: linear-gradient(to right, black 70%, rgba(0, 0, 0, 0.5) 86%, transparent 98%);
}

canvas#liveOledCanvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: 485px;
  object-fit: contain;
  aspect-ratio: 2 / 1;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 0 22px rgba(0, 240, 255, 0.65)) drop-shadow(0 0 65px rgba(0, 240, 255, 0.25));
  animation: floatPenguin 4.2s ease-in-out infinite alternate;
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.35) 4%,
    rgba(0, 0, 0, 0.85) 12%,
    black 20%,
    black 80%,
    rgba(0, 0, 0, 0.85) 88%,
    rgba(0, 0, 0, 0.35) 96%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.35) 4%,
    rgba(0, 0, 0, 0.85) 12%,
    black 20%,
    black 80%,
    rgba(0, 0, 0, 0.85) 88%,
    rgba(0, 0, 0, 0.35) 96%,
    transparent 100%
  );
}

@keyframes floatPenguin {
  0% { transform: translateY(0px); }
  100% { transform: translateY(-8px); }
}

/* ==========================================================================
   5. App Footer & Firmware Status Pill (Responsive Fluid Bar)
   ========================================================================== */

.app-footer {
  width: 100%;
  max-width: 980px;
  margin: 6px auto 0 auto;
  padding: 6px 18px;
  background: rgba(12, 22, 40, 0.72);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1.5px solid rgba(0, 240, 255, 0.45);
  border-radius: 10px;
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.45),
    0 0 15px rgba(0, 240, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  z-index: 10;
  position: relative;
  flex-shrink: 0;
}

.footer-credits {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 8px;
  font-family: var(--font-mono);
  font-size: 0.70rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.credits-project {
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 0.5px;
}

.credits-author {
  color: var(--text-muted);
}

.credits-author strong {
  color: var(--text-bright);
}

.credits-author a {
  color: var(--cyan);
  text-decoration: none;
  transition: color 0.2s ease;
}

.credits-author a:hover {
  text-decoration: underline;
  color: #fff;
}

.footer-sep {
  color: rgba(0, 240, 255, 0.35);
  font-size: 0.72rem;
}

.credits-license {
  font-size: 0.68rem;
  color: #64748b;
}

.target-status-pill {
  position: static;
  background: rgba(6, 10, 18, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 255, 157, 0.25);
  border-radius: 7px;
  padding: 4px 11px;
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.pill-download-btn {
  background: rgba(0, 255, 157, 0.15);
  color: var(--green);
  border: 1px solid rgba(0, 255, 157, 0.3);
  border-radius: 4px;
  padding: 1px 6px;
  text-decoration: none;
  font-weight: 700;
  transition: all 0.2s ease;
}

.pill-download-btn:hover {
  background: var(--green);
  color: #04060a;
}

/* ==========================================================================
   6. Device & Screen Size Adaptations (Fluid All-In-One Responsive System)
   ========================================================================== */

/* Laptop screens with compact vertical height */
@media (max-height: 820px) and (min-width: 901px) {
  .app-viewport {
    padding: 8px 16px 6px 16px;
  }
  .navbar {
    min-height: 46px;
    padding: 6px 16px;
    margin-bottom: 6px;
  }
  .brand-title {
    font-size: 1.15rem;
  }
  .medialab-brand-card {
    padding: 4px 10px;
  }
  .control-station {
    padding: 12px 16px;
    gap: 8px;
  }
  .station-block {
    gap: 6px;
  }
  .switch-pill {
    padding: 6px 9px;
  }
  .pill-desc {
    -webkit-line-clamp: 2;
  }
  .btn-master-flash {
    padding: 9px 16px;
    font-size: 0.90rem;
  }
  .terminal-view {
    height: 54px;
  }
  .app-footer {
    padding: 5px 14px;
    margin-top: 5px;
  }
  canvas#liveOledCanvas {
    max-height: 460px;
  }
}

/* Tablets & Smaller Desktops (Vertical Stacking) */
@media (max-width: 1080px) {
  .app-viewport {
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 14px 18px 40px 18px;
  }

  .experience-stage {
    flex-direction: column;
    margin-top: 10px;
    min-height: auto;
  }
  
  .control-station {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .pure-penguin-stage {
    flex: 1 1 100%;
    max-width: 540px;
    margin-left: 0;
    margin-right: 0;
    margin-top: 16px;
    width: 100%;
  }

  .app-footer {
    flex-direction: column;
    text-align: center;
    gap: 12px;
    padding: 12px 16px;
    margin-top: 16px;
  }

  .footer-credits {
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 600px) {
  .switches-cluster {
    grid-template-columns: 1fr;
  }
  
  .app-viewport {
    padding: 10px 10px 50px 10px;
  }
  
  .brand-title {
    font-size: 1.15rem;
  }
}

/* ==========================================================================
   Modal Pop-up de Finalización y Aviso Botón EN (Alineado con diseño GotchiLab)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 7, 16, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 90%;
  max-width: 460px;
  background: rgba(10, 18, 34, 0.92);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-top: 2px solid #00ff9d;
  border-radius: 20px;
  padding: 30px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 15px;
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.8),
    0 0 35px rgba(0, 255, 157, 0.18);
  transform: translateY(12px) scale(0.96);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-card {
  transform: translateY(0) scale(1);
}

.modal-badge-success {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(0, 255, 157, 0.15);
  border: 1.5px solid #00ff9d;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #00ff9d;
  font-size: 1.6rem;
  font-weight: 900;
  box-shadow: 0 0 20px rgba(0, 255, 157, 0.35);
}

.modal-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 1.5px;
}

.modal-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-bright);
  margin-top: -6px;
}

.modal-instructions-box {
  width: 100%;
  background: rgba(0, 240, 255, 0.06);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.modal-step-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: #04060a;
  background: var(--cyan);
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 1px;
}

.modal-instruction-text {
  font-size: 0.92rem;
  color: var(--text-main);
  line-height: 1.5;
  margin: 0;
}

.hardware-key {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--cyan);
  background: rgba(14, 25, 48, 0.95);
  border: 1px solid var(--cyan);
  padding: 1px 7px;
  border-radius: 5px;
  box-shadow: 0 2px 0 rgba(0, 240, 255, 0.3);
}

.modal-subtext {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

.modal-btn-confirm {
  width: 100%;
  padding: 13px 20px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #00f0ff 0%, #00ff9d 100%);
  color: #04060a;
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
  transition: all 0.25s ease;
  margin-top: 4px;
}

.modal-btn-confirm:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 0 28px rgba(0, 255, 157, 0.5);
}

/* ==========================================================================
   6. Spotlight Guided Tour (Interactive Onboarding)
   ========================================================================== */

/* Navbar Tour Trigger Button */
.nav-right-cluster {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-nav-tour {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(14, 25, 48, 0.70);
  border: 1px solid rgba(0, 240, 255, 0.40);
  color: var(--text-bright);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.btn-nav-tour:hover {
  background: rgba(0, 240, 255, 0.16);
  border-color: var(--cyan);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.35);
  transform: translateY(-1px);
}

/* Assembly Tutorial Guide Button */
.btn-nav-assembly {
  text-decoration: none;
  background: rgba(255, 179, 0, 0.10);
  border: 1px solid rgba(255, 179, 0, 0.40);
  color: #ffda79;
}

.btn-nav-assembly:hover {
  background: rgba(255, 179, 0, 0.22);
  border-color: #ffb300;
  box-shadow: 0 0 16px rgba(255, 179, 0, 0.35);
  color: #ffffff;
  transform: translateY(-1px);
}

.assembly-icon-dot {
  background: rgba(255, 179, 0, 0.20) !important;
  border-color: #ffb300 !important;
  color: #ffffff !important;
  font-size: 0.65rem !important;
}

.tour-icon-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: rgba(0, 240, 255, 0.2);
  color: var(--cyan);
  font-size: 0.70rem;
  font-weight: 800;
  border: 1px solid var(--cyan);
}

@media (max-width: 768px) {
  .btn-nav-assembly span:not(.tour-icon-dot) {
    display: none;
  }
  .btn-nav-assembly {
    padding: 6px 8px;
  }
}

@media (max-width: 580px) {
  .btn-nav-tour span:not(.tour-icon-dot) {
    display: none;
  }
  .btn-nav-tour {
    padding: 6px 8px;
  }
}

/* Tour Fullscreen Backdrop Overlay */
.tour-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  width: 100dvw;
  height: 100dvh;
  z-index: 10000;
  pointer-events: none;
  background: transparent;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.25s;
}

.tour-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* Modal Mode (Step 1): Active darkening and background shielding */
.tour-backdrop.tour-mode-modal {
  pointer-events: auto;
  background: rgba(3, 6, 14, 0.82);
}

/* Spotlight Perimeter Box with Glowing Cyan Pulse */
.tour-spotlight-box {
  position: fixed;
  border-radius: 14px;
  border: 2px solid #00e5ff;
  box-shadow: 
    0 0 0 9999px rgba(3, 6, 14, 0.80),
    0 0 28px rgba(0, 229, 255, 0.65),
    inset 0 0 16px rgba(0, 229, 255, 0.22);
  pointer-events: none;
  z-index: 10001;
  transition: top 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              left 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              width 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              height 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.2s ease;
  animation: spotlightPulse 2.4s infinite ease-in-out;
}

@keyframes spotlightPulse {
  0%, 100% {
    border-color: #00e5ff;
    box-shadow: 
      0 0 0 9999px rgba(3, 6, 14, 0.80),
      0 0 24px rgba(0, 229, 255, 0.60),
      inset 0 0 14px rgba(0, 229, 255, 0.20);
  }
  50% {
    border-color: #00ff9d;
    box-shadow: 
      0 0 0 9999px rgba(3, 6, 14, 0.80),
      0 0 34px rgba(0, 255, 157, 0.70),
      inset 0 0 20px rgba(0, 255, 157, 0.30);
  }
}

/* Dynamic Popover Card */
.tour-card {
  z-index: 10002;
  width: 100%;
  max-width: min(460px, 92vw);
  box-sizing: border-box;
  background: rgba(9, 16, 30, 0.94);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(0, 240, 255, 0.40);
  border-top: 2px solid var(--cyan);
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.75),
    0 0 35px rgba(0, 240, 255, 0.16);
  color: var(--text-main);
  pointer-events: auto;
  animation: tourCardFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes tourCardFadeIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Centered Modal Mode (Welcome & Assembly Question) */
.tour-card-centered {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) !important;
  width: min(480px, 92vw);
  max-width: min(480px, 92vw);
  padding: 24px 26px;
  box-shadow: 
    0 0 0 9999px rgba(3, 6, 14, 0.82),
    0 30px 70px rgba(0, 0, 0, 0.8),
    0 0 40px rgba(0, 240, 255, 0.25);
}

/* Floating Mode (Steps 2 & 3) */
.tour-card-floating {
  position: fixed;
  pointer-events: auto;
  transition: top 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Popover Arrow Indicator */
.tour-arrow {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
}

.tour-arrow.arrow-bottom {
  bottom: -10px;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid rgba(9, 16, 30, 0.94);
  filter: drop-shadow(0 3px 2px rgba(0, 240, 255, 0.3));
}

.tour-arrow.arrow-top {
  top: -10px;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 10px solid rgba(9, 16, 30, 0.94);
  filter: drop-shadow(0 -3px 2px rgba(0, 240, 255, 0.3));
}

.tour-arrow.arrow-left {
  left: -10px;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-right: 10px solid rgba(9, 16, 30, 0.94);
  filter: drop-shadow(-3px 0 2px rgba(0, 240, 255, 0.3));
}

.tour-arrow.arrow-right {
  right: -10px;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 10px solid rgba(9, 16, 30, 0.94);
  filter: drop-shadow(3px 0 2px rgba(0, 240, 255, 0.3));
}

/* Card Header */
.tour-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.tour-badge-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tour-step-badge {
  font-family: var(--font-mono);
  font-size: 0.70rem;
  font-weight: 700;
  color: var(--cyan);
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.35);
  padding: 3px 9px;
  border-radius: 6px;
  letter-spacing: 0.8px;
}

.tour-shortcut-hint {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #64748b;
  letter-spacing: 0.4px;
}

.tour-btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.tour-btn-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* Card Body */
.tour-card-body {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.tour-icon-wrap {
  font-size: 2rem;
  line-height: 1;
  background: rgba(14, 25, 48, 0.9);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.1);
}

.tour-text-wrap {
  flex: 1;
}

.tour-title {
  margin: 0 0 6px 0;
  font-family: var(--font-sans);
  font-size: 1.12rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.2px;
}

.tour-text {
  margin: 0;
  font-size: 0.87rem;
  line-height: 1.5;
  color: #94a3b8;
}

/* Branching Question Buttons (¿Has montado tu pingüino?) */
.tour-branch-options {
  display: flex;
  gap: 14px;
  margin-top: 18px;
}

.tour-btn-branch {
  flex: 1;
  padding: 12px 18px;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  line-height: 1.25;
}

.tour-btn-branch-yes {
  background: linear-gradient(135deg, #00f0ff 0%, #00ff9d 100%);
  color: #040812;
  border: none;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.35);
}

.tour-btn-branch-yes:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 24px rgba(0, 255, 157, 0.55);
}

.tour-btn-branch-no {
  background: rgba(255, 179, 0, 0.12);
  border: 1px solid rgba(255, 179, 0, 0.45);
  color: #ffda79;
}

.tour-btn-branch-no:hover {
  background: rgba(255, 179, 0, 0.25);
  border-color: #ffb300;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 0 16px rgba(255, 179, 0, 0.3);
}

/* Callout para guía de montaje dentro de la tarjeta */
.tour-assembly-callout {
  margin-top: 14px;
  padding: 14px 16px;
  background: rgba(255, 179, 0, 0.08);
  border: 1px solid rgba(255, 179, 0, 0.28);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.85rem;
  color: #f1f5f9;
}

.assembly-callout-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.assembly-callout-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.tour-btn-guide {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #ffb300 0%, #ff8800 100%);
  color: #050a14;
  font-family: var(--font-sans);
  font-size: 0.90rem;
  font-weight: 800;
  border-radius: 9px;
  text-decoration: none;
  box-shadow: 0 0 18px rgba(255, 179, 0, 0.4);
  transition: all 0.2s ease;
}

.tour-btn-guide:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 26px rgba(255, 179, 0, 0.65);
  color: #000000;
}

/* Card Footer & Action Buttons */
.tour-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tour-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.tour-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.25s ease;
}

.tour-dot.active {
  width: 20px;
  border-radius: 4px;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

.tour-actions {
  display: flex;
  gap: 9px;
  align-items: center;
}

.tour-btn {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tour-btn-primary {
  background: linear-gradient(135deg, #00f0ff 0%, #00ff9d 100%);
  color: #040812;
  border: none;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.35);
}

.tour-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 24px rgba(0, 255, 157, 0.55);
}

.tour-btn-secondary {
  background: rgba(14, 25, 48, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: var(--text-bright);
}

.tour-btn-secondary:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--cyan);
  color: #ffffff;
}

.tour-btn-ghost {
  background: transparent;
  border: none;
  color: #64748b;
  padding: 8px 10px;
}

.tour-btn-ghost:hover {
  color: var(--text-muted);
}

/* Mobile & Tablet Responsive Contrast Protection */
@media (max-width: 960px) {
  body.tour-active .pure-penguin-stage,
  body.tour-active #liveOledCanvas {
    opacity: 0.15 !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease;
  }
}

/* Monitoring Zone Container: Progress Meter + Telemetry Terminal */
.flash-monitoring-zone {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
