/* ==========================================================
   BIOTELEMETRY MULTILAYER ANATOMY & SYSTEMS HUD
   Clinical Medical Telemetry Architecture (Pure rem/em/clamp Fluid System)
   ========================================================== */

:root {
  --bio-bg: #090c15;
  --bio-surface: #0e1422;
  --bio-surface-elevated: #141c2e;
  --bio-border: rgba(255, 255, 255, 0.08);
  --bio-cyan: #38bdf8;
  --bio-emerald: #10b981;
  --bio-amber: #f59e0b;
  --bio-rose: #f43f5e;
  --bio-purple: #c084fc;
}

/* Main Telemetry Cockpit Container */
.bio-cockpit {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(0.75rem, 2vw, 1rem);
  background: var(--bio-surface);
  border: 0.0625rem solid var(--bio-border);
  border-radius: var(--radius-md);
  padding: clamp(0.75rem, 2vw, 1.125rem);
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.6);
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (min-width: 60rem) {
  .bio-cockpit {
    grid-template-columns: minmax(18rem, 21.5rem) minmax(15.5rem, 1fr) minmax(19rem, 24rem);
    align-items: stretch;
    min-height: 30rem;
    gap: clamp(0.875rem, 1.5vw, 1.25rem);
    padding: clamp(0.875rem, 1.5vw, 1.25rem);
    justify-content: center;
  }
}

/* ==========================================
   LEFT PANEL: 8 SYSTEMS LIST TELEMETRY
   ========================================== */
.bio-systems-panel {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  background: rgba(8, 13, 25, 0.7);
  border: 0.0625rem solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: clamp(0.625rem, 1.2vw, 0.875rem) clamp(0.5rem, 1vw, 0.75rem);
  backdrop-filter: blur(0.75rem);
  min-width: 0;
  box-sizing: border-box;
}

.bio-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--bio-cyan);
  letter-spacing: 0.05em;
  padding-bottom: 0.5rem;
  border-bottom: 0.0625rem solid rgba(0, 229, 255, 0.15);
  margin-bottom: 0.25rem;
}

/* Systems Stack List */
.bio-systems-stack {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  overflow-x: hidden !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.4) rgba(255, 255, 255, 0.04);
}

.bio-systems-stack::-webkit-scrollbar {
  width: 0.3125rem;
  height: 0;
}

.bio-systems-stack::-webkit-scrollbar:horizontal {
  display: none !important;
  height: 0 !important;
}

.bio-systems-stack::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 0.25rem;
}

.bio-systems-stack::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.35);
  border-radius: 0.25rem;
}

/* Individual System Row */
.bio-sys-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 0.0625rem solid transparent;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
  position: relative;
  min-width: 0;
  box-sizing: border-box;
}

.bio-sys-row:hover {
  background: rgba(0, 229, 255, 0.08);
  border-color: rgba(0, 229, 255, 0.35);
  box-shadow: inset 0.125rem 0 0 var(--bio-cyan), 0 0 0.625rem rgba(0, 229, 255, 0.15);
}

.bio-sys-row.active {
  background: rgba(0, 229, 255, 0.12);
  border-color: var(--bio-cyan);
  box-shadow: 0 0 0.875rem rgba(0, 229, 255, 0.25);
}

/* Circular Gauge Icon */
.bio-gauge-wrap {
  position: relative;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  border: 0.09375rem solid var(--bio-cyan);
  transition: border-color 0.3s ease;
}

.bio-gauge-wrap.status-optimal { border-color: var(--bio-cyan); }
.bio-gauge-wrap.status-compensated { border-color: var(--bio-amber); }
.bio-gauge-wrap.status-critical { border-color: var(--bio-rose); }

.bio-gauge-icon {
  font-size: 0.875rem;
  filter: drop-shadow(0 0 0.25rem rgba(0, 229, 255, 0.4));
}

.bio-sys-info {
  flex: 1;
  min-width: 0;
}

.bio-sys-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.bio-sys-name {
  font-family: var(--font-sans);
  font-size: 0.71875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.015em;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.bio-sys-val {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--bio-cyan);
}

/* Progress bar under system name */
.bio-sys-track {
  width: 100%;
  height: 0.25rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 0.125rem;
  overflow: hidden;
  position: relative;
}

.bio-sys-fill {
  height: 100%;
  width: 100%;
  border-radius: 0.125rem;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.4s ease;
}

.bio-sys-fill.status-optimal {
  background: linear-gradient(90deg, #00b0ff, var(--bio-cyan));
  box-shadow: 0 0 0.5rem rgba(0, 229, 255, 0.6);
}

.bio-sys-fill.status-compensated {
  background: linear-gradient(90deg, #ffa000, var(--bio-amber));
  box-shadow: 0 0 0.5rem rgba(255, 171, 0, 0.6);
}

.bio-sys-fill.status-critical {
  background: linear-gradient(90deg, #d50000, var(--bio-rose));
  box-shadow: 0 0 0.5rem rgba(255, 23, 68, 0.6);
}

/* Question completion pill in system row */
.bio-sys-count {
  font-size: 0.5625rem;
  font-family: var(--font-mono);
  padding: 0.0625rem 0.3125rem;
  border-radius: 0.25rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  flex-shrink: 0;
}
.bio-sys-count.done {
  background: rgba(0, 230, 118, 0.15);
  color: var(--bio-emerald);
}

/* ==========================================
   CENTER PANEL: ANATOMICAL MULTI-LAYER VIEWPORT
   ========================================= */
.bio-viewport-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

/* Layer Switcher Segmented Control (2x2 grid for clean, unclipped text & icons across all viewports) */
.bio-layer-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.375rem;
  width: 100%;
  max-width: clamp(14rem, 90%, 18rem);
  margin-bottom: 0.75rem;
  background: #0d121e;
  border: 0.0625rem solid rgba(255, 255, 255, 0.08);
  padding: 0.25rem;
  border-radius: 0.5rem;
  box-sizing: border-box;
}

.bio-layer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3125rem;
  padding: 0.375rem 0.375rem;
  border-radius: 0.3125rem;
  background: transparent;
  border: 0.0625rem solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: clamp(0.625rem, 1.2vw, 0.6875rem);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.bio-layer-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bio-layer-btn .layer-tab-icon {
  width: 0.8125rem;
  height: 0.8125rem;
  opacity: 0.7;
  flex-shrink: 0;
}

.bio-layer-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}

.bio-layer-btn:hover .layer-tab-icon {
  opacity: 1;
}

.bio-layer-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0.0625rem 0.25rem rgba(0, 0, 0, 0.3);
}

.bio-layer-btn.active .layer-tab-icon {
  opacity: 1;
  color: var(--accent-cyan);
}

/* The Body Render Frame */
.bio-body-frame {
  position: relative;
  width: 100%;
  max-width: clamp(13rem, 85%, 17.5rem);
  aspect-ratio: 3 / 4;
  border-radius: 0.625rem;
  overflow: hidden;
  background: #03050a;
  border: 0.0625rem solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 0.75rem 1.875rem rgba(0, 0, 0, 0.6);
  margin: 0 auto;
}

/* Multi-Layer Images Stack */
.bio-layer-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.bio-layer-img.active {
  opacity: 1;
  pointer-events: auto;
}

/* Hotspot Nodes Overlay on Body */
.bio-hotspots-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}

.bio-pin {
  position: absolute;
  width: 1.375rem;
  height: 1.375rem;
  transform: translate(-50%, -50%);
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.2s ease;
}

.bio-pin:hover {
  transform: translate(-50%, -50%) scale(1.25);
}

.bio-pin-ring {
  position: absolute;
  inset: 0;
  border: 0.09375rem solid var(--bio-cyan);
  border-radius: 50%;
  animation: pin-pulse 2s infinite;
}

.bio-pin-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.5rem;
  height: 0.5rem;
  transform: translate(-50%, -50%);
  background: var(--bio-cyan);
  border-radius: 50%;
  box-shadow: 0 0 0.5rem var(--bio-cyan);
}

.bio-pin.status-critical .bio-pin-ring { border-color: var(--bio-rose); animation-duration: 1.2s; }
.bio-pin.status-critical .bio-pin-core { background: var(--bio-rose); box-shadow: 0 0 0.5rem var(--bio-rose); }
.bio-pin.status-optimal .bio-pin-ring { border-color: var(--bio-emerald); }
.bio-pin.status-optimal .bio-pin-core { background: var(--bio-emerald); box-shadow: 0 0 0.5rem var(--bio-emerald); }

@keyframes pin-pulse {
  0% { transform: scale(0.9); opacity: 0.9; }
  50% { transform: scale(1.6); opacity: 0.15; }
  100% { transform: scale(0.9); opacity: 0.9; }
}

/* ==========================================
   RIGHT PANEL: INSPECTOR & CLINICAL BREAKDOWN
   ========================================== */
.bio-inspector-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background: var(--bio-surface);
  border: 0.0625rem solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: clamp(0.75rem, 1.5vw, 1rem);
  backdrop-filter: blur(0.75rem);
  min-height: 0;
  height: 100%;
  box-sizing: border-box;
  overflow: hidden;
  min-width: 0;
}

.bio-insp-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.375rem 0.625rem;
  padding-bottom: 0.625rem;
  border-bottom: 0.0625rem solid rgba(255, 255, 255, 0.06);
  margin-bottom: 0.5rem;
  flex-shrink: 0;
  min-width: 0;
}

.bio-insp-title {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: clamp(0.875rem, 1.4vw, 1rem);
  font-weight: 700;
  color: #ffffff;
  white-space: normal;
  word-break: break-word;
  line-height: 1.25;
}

.bio-insp-badge {
  font-family: var(--font-mono);
  font-size: 0.65625rem;
  font-weight: 700;
  padding: 0.1875rem 0.4375rem;
  border-radius: 0.25rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.bio-insp-badge.status-optimal {
  background: rgba(0, 230, 118, 0.15);
  color: var(--bio-emerald);
  border: 0.0625rem solid rgba(0, 230, 118, 0.3);
}

.bio-insp-badge.status-compensated {
  background: rgba(255, 171, 0, 0.15);
  color: var(--bio-amber);
  border: 0.0625rem solid rgba(255, 171, 0, 0.3);
}

.bio-insp-badge.status-critical {
  background: rgba(255, 23, 68, 0.15);
  color: var(--bio-rose);
  border: 0.0625rem solid rgba(255, 23, 68, 0.3);
}

.bio-insp-desc {
  font-size: clamp(0.6875rem, 1.2vw, 0.75rem);
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
  word-break: break-word;
}

.bio-factors-box {
  flex: 1 1 auto;
  min-height: 5.5rem;
  max-height: 16rem;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 0.5rem;
  padding-right: 0.25rem;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.5) rgba(255, 255, 255, 0.05);
}

.bio-factors-box::-webkit-scrollbar {
  width: 0.375rem;
}

.bio-factors-box::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.25rem;
}

.bio-factors-box::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.45);
  border-radius: 0.25rem;
}

.bio-factors-box::-webkit-scrollbar-thumb:hover {
  background: var(--bio-cyan);
}

.bio-factor-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.375rem;
  padding: 0.5rem 0.625rem;
  background: rgba(0, 0, 0, 0.4);
  border: 0.0625rem solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  font-size: 0.6875rem;
  flex-shrink: 0;
  min-width: 0;
  box-sizing: border-box;
}

.bio-factor-card.pos { border-left: 0.1875rem solid var(--bio-emerald); }
.bio-factor-card.neg { border-left: 0.1875rem solid var(--bio-rose); }
.bio-factor-card.neutral { border-left: 0.1875rem solid var(--bio-cyan); }

.bio-factor-action-btn {
  width: 100%;
  margin-top: auto;
  padding: 0.5rem 0.625rem;
  background: rgba(0, 229, 255, 0.12);
  border: 0.0625rem solid rgba(0, 229, 255, 0.35);
  color: var(--bio-cyan);
  font-family: var(--font-sans);
  font-size: clamp(0.6875rem, 1.2vw, 0.75rem);
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  box-sizing: border-box;
  white-space: normal;
  text-align: center;
  line-height: 1.3;
}

.bio-factor-action-btn:hover {
  background: rgba(0, 229, 255, 0.22);
  color: #ffffff;
  box-shadow: 0 0 0.75rem rgba(0, 229, 255, 0.3);
}

/* Language Switcher in Header */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 0.0625rem solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  padding: 0.125rem 0.25rem;
  gap: 0.125rem;
}

.lang-btn {
  background: transparent;
  border: none;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 0.1875rem 0.5rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-btn:hover {
  color: #ffffff;
}

.lang-btn.active {
  background: var(--bio-cyan);
  color: #050811;
  box-shadow: 0 0 0.5rem rgba(0, 229, 255, 0.5);
}

/* Chapter Navigation Chips */
.systems-chips-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.25rem 0.125rem 0.875rem 0.125rem;
  margin-bottom: 1rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 229, 255, 0.3) transparent;
}

.systems-chips-nav::-webkit-scrollbar {
  height: 0.25rem;
}
.systems-chips-nav::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.3);
  border-radius: 0.25rem;
}

.system-tab-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: rgba(15, 23, 42, 0.75);
  border: 0.0625rem solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.71875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.system-tab-chip:hover {
  background: rgba(0, 229, 255, 0.08);
  border-color: rgba(0, 229, 255, 0.3);
  color: #ffffff;
}

.system-tab-chip.active {
  background: rgba(0, 229, 255, 0.16);
  border-color: var(--bio-cyan);
  color: #ffffff;
  box-shadow: 0 0 0.625rem rgba(0, 229, 255, 0.3);
}

.system-tab-chip.done .sys-chip-badge {
  background: rgba(0, 230, 118, 0.2);
  color: var(--bio-emerald);
}

.sys-chip-badge {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.0625rem 0.375rem;
  border-radius: 0.625rem;
}

/* Mental Health Section */
.mental-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

.mental-card {
  background: var(--bg-surface);
  border: 0.0625rem solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.125rem;
  border-top: 0.1875rem solid var(--bio-purple);
  box-shadow: 0 0.625rem 1.5625rem rgba(0, 0, 0, 0.3);
}

.mental-badge {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--bio-purple);
  text-transform: uppercase;
  margin-bottom: 0.375rem;
}

.mental-val {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.5rem;
}

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

/* ==========================================
   QUIZ TELEMETRY DRAWER ACCORDION
   ========================================== */
.quiz-telemetry-drawer-wrap {
  margin-top: 1.5rem;
  background: var(--bg-surface);
  border: 0.0625rem solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.quiz-telemetry-drawer-wrap:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.quiz-telemetry-toggle-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(0.75rem, 1.5vw, 1rem) clamp(0.875rem, 2vw, 1.25rem);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: clamp(0.75rem, 1.5vw, 0.8125rem);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.quiz-telemetry-toggle-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
}

.toggle-btn-left {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--text-primary);
}

.toggle-btn-left svg {
  color: var(--accent-cyan);
}

.toggle-btn-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.toggle-arrow {
  display: inline-block;
  font-size: 0.625rem;
  transition: transform 0.25s ease;
}

.quiz-telemetry-toggle-btn.open .toggle-arrow {
  transform: rotate(180deg);
}

.quiz-telemetry-collapse {
  padding: 0 clamp(0.5rem, 1.5vw, 1rem) clamp(0.75rem, 1.5vw, 1rem);
  border-top: 0.0625rem solid var(--border-subtle);
  box-sizing: border-box;
  width: 100%;
  overflow-x: hidden !important;
}

/* ==========================================
   MOBILE & TABLET RESPONSIVE COCKPIT
   ========================================== */
@media (max-width: 59.9375rem) {
  .bio-cockpit {
    grid-template-columns: 1fr;
    gap: 0.875rem;
    padding: clamp(0.625rem, 2.5vw, 0.875rem);
    overflow-x: hidden !important;
  }

  /* Show 3D viewport first on mobile so user sees the body model immediately */
  .bio-viewport-panel {
    order: 1;
    margin: 0.25rem auto;
    width: 100%;
  }

  .bio-body-frame {
    max-width: clamp(13rem, 75vw, 16.5rem);
    margin: 0 auto;
  }

  .bio-layer-tabs {
    max-width: clamp(14rem, 85vw, 18rem);
    margin: 0 auto 0.75rem;
  }

  /* Systems list in clean single column (or 2-col on landscape tablets) */
  .bio-systems-panel {
    order: 2;
    max-height: none;
    padding: 0.75rem 0.625rem;
    overflow-x: hidden !important;
  }

  .bio-systems-stack {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.375rem;
    max-height: 15rem;
    overflow-y: auto;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
  }

  .bio-sys-row {
    padding: 0.4375rem 0.625rem;
    gap: 0.5rem;
  }

  .bio-gauge-wrap {
    width: 1.875rem;
    height: 1.875rem;
  }

  .bio-gauge-icon {
    font-size: 0.875rem;
  }

  .bio-sys-name {
    font-size: 0.6875rem;
  }

  .bio-sys-val {
    font-size: 0.65625rem;
  }

  /* Inspector panel below */
  .bio-inspector-panel {
    order: 3;
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 0.875rem;
  }

  .bio-insp-top {
    flex-wrap: wrap;
    gap: 0.375rem;
  }

  .bio-factors-box {
    max-height: 14rem;
  }
}

/* Tablet landscape: 2 columns in systems list */
@media (min-width: 40rem) and (max-width: 59.9375rem) {
  .bio-systems-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 30rem) {
  .bio-cockpit {
    padding: 0.5rem;
    gap: 0.625rem;
    border-radius: var(--radius-sm);
  }

  .bio-systems-stack {
    grid-template-columns: 1fr;
    max-height: 13rem;
  }

  .bio-layer-tabs {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.25rem;
    padding: 0.1875rem;
  }

  .bio-layer-btn {
    padding: 0.3125rem 0.25rem;
    font-size: 0.59375rem;
    gap: 0.1875rem;
  }

  .bio-body-frame {
    max-width: clamp(11.5rem, 80vw, 14rem);
  }
}
