/* ============================================================================
   CANINE & DOG 3D ANATOMY QUIZ v3.0 — CLINICAL STUDIO LIGHT & COMMERCIAL UI
   Thương hiệu: AnatomyLab 3D (anatomylab3d.com) — 100% Offline
   ============================================================================ */
.viewer-workspace {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-studio-gradient);
  transition: background 0.25s ease;
}

.viewer-canvas-wrap {
  width: 100%;
  height: 100%;
  cursor: grab;
  position: relative;
  z-index: 1;
}

.viewer-canvas-wrap:active {
  cursor: grabbing;
}

/* Canvas lớp phủ vẽ ghi chú 2D (2D Annotation Overlay) */
.annotation-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 12;
  pointer-events: none;
}

.annotation-canvas.drawing-active {
  pointer-events: auto;
  cursor: crosshair;
}

/* Thanh nổi phía trên (Top Floating Bar — Gom gọn 1 hàng ngang) */
.top-floating-bar {
  position: absolute;
  top: 7px;
  left: 8px;
  right: 8px;
  max-width: calc(100vw - 16px);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  z-index: 30;
  pointer-events: none;
  flex-wrap: nowrap;
  overflow: visible;
}

.top-bar-group {
  display: flex;
  align-items: center;
  gap: 2.5px;
  pointer-events: auto;
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  padding: 2.5px 4.5px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  flex-wrap: nowrap;
  flex-shrink: 1;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.app-brand-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-on-glass);
  padding-right: 5px;
  border-right: 1px solid var(--border-glass);
  cursor: pointer;
}

.app-brand-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, #0284c7, #00b4d8);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
  font-size: 12px;
}

.app-brand-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--text-on-glass);
  white-space: nowrap;
}

.app-brand-sub {
  display: none;
}

/* Ô tìm kiếm giải phẫu tức thì (Search Box + Dropdown) */
.search-box-wrap {
  position: relative;
  width: 128px;
}

.search-box-wrap:focus-within {
  width: 128px;
}

.search-box-input-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-pill);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 3px 7px;
  color: var(--text-on-glass);
  transition: border-color 0.15s ease;
}

.search-box-input-wrap:focus-within {
  border-color: var(--primary);
}

.search-box-input-wrap input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-on-glass);
  font-size: 11.5px;
  font-weight: 400;
  width: 100%;
  font-family: var(--font-ui);
}

.search-box-input-wrap input::placeholder {
  color: var(--text-on-glass-muted);
}

.search-dropdown {
  position: fixed;
  top: 44px;
  left: 10px;
  min-width: 280px;
  max-width: min(360px, calc(100vw - 20px));
  max-height: min(310px, calc(100vh - 60px));
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 95;
  display: none;
}

.search-dropdown.open {
  display: block;
}

.search-result-item {
  padding: 7px 11px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.14s;
}

.search-result-item:hover {
  background: #e0f2fe;
}

.search-result-vn {
  font-size: 12.5px;
  font-weight: 600;
  color: #0284c7;
  line-height: 1.35;
}

.search-result-sub {
  font-size: 11.5px;
  color: #3f3f46;
  margin-top: 2px;
  line-height: 1.4;
}

/* Nút công cụ dạng Viên thuốc nổi (Floating Glass Pills) */
.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 6px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-glass);
  background: var(--bg-pill);
  color: var(--text-on-glass);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  font-family: var(--font-ui);
  user-select: none;
}

.tool-btn > *,
.sys-pill > *,
.glass-act-pill > * {
  pointer-events: none;
}

.tool-btn:hover {
  background: var(--bg-pill-hover);
  border-color: var(--primary);
}

.tool-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 600;
}

.tool-btn.active-cyan {
  background: #00b4d8;
  border-color: #0284c7;
  color: #ffffff;
}

.tool-btn.active-amber {
  background: #d97706;
  border-color: #f59e0b;
  color: #ffffff;
}

.tool-btn.active-emerald,
.tool-btn.active-green {
  background: #059669;
  border-color: #10b981;
  color: #ffffff;
}

.tool-btn.active-purple {
  background: #7c3aed;
  border-color: #8b5cf6;
  color: #ffffff;
}

.tool-btn svg {
  width: 13px;
  height: 13px;
}

/* Nút Hướng dẫn (?) & Nút Thu gọn / Xổ ra cho Thanh công cụ trên và Thanh 12 Hệ dưới (Giống Công cụ bàn mổ & Điều khiển 3D) */
.guide-highlight-btn {
  background: #e0f2fe !important;
  border-color: #0284c7 !important;
  color: #0369a1 !important;
  font-weight: 600 !important;
}

.guide-highlight-btn:hover {
  background: #0284c7 !important;
  color: #ffffff !important;
}

.bar-inline-collapse-btn {
  background: rgba(2, 132, 199, 0.12) !important;
  border-color: rgba(2, 132, 199, 0.35) !important;
  color: #0284c7 !important;
  font-weight: 600 !important;
  flex-shrink: 0;
}

.bar-inline-collapse-btn:hover {
  background: #0284c7 !important;
  color: #ffffff !important;
}

.topbar-expand-pill,
.bottomdock-expand-pill {
  display: none !important;
  pointer-events: auto;
  background: var(--bg-glass-strong) !important;
  backdrop-filter: blur(14px);
  border: 1.5px solid #0284c7 !important;
  color: #0284c7 !important;
  font-weight: 600 !important;
  padding: 4px 10px !important;
  box-shadow: var(--shadow-md);
}

/* Khi thu gọn Thanh công cụ phía trên (.topbar-collapsed) */
.top-floating-bar.topbar-collapsed {
  justify-content: flex-start !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  width: auto !important;
  right: auto !important;
}

.top-floating-bar.topbar-collapsed .topbar-collapsible-item {
  display: none !important;
}

.top-floating-bar.topbar-collapsed .topbar-expand-pill {
  display: inline-flex !important;
}

/* Khi thu gọn Thanh 12 Hệ Cơ Quan phía dưới (.bottomdock-collapsed) */
.bottom-systems-dock.bottomdock-collapsed {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  width: auto !important;
}

.bottom-systems-dock.bottomdock-collapsed .bottomdock-collapsible-item {
  display: none !important;
}

.bottom-systems-dock.bottomdock-collapsed .bottomdock-expand-pill {
  display: inline-flex !important;
}

/* Quick Screenshot & Video Recording (Top Bar Inline) */
.tool-btn .rec-timer {
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #ef4444;
  letter-spacing: 0.01em;
  animation: recBlink 1s steps(2) infinite;
}

@keyframes recBlink {
  0% { opacity: 1; }
  50% { opacity: 0.4; }
}

.tool-btn.recording-active {
  background: #fef2f2;
  border-color: #ef4444;
  color: #dc2626;
}

.top-select-pill {
  padding: 3px 6px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-glass);
  background: var(--bg-pill);
  color: var(--text-on-glass);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  font-family: var(--font-ui);
}

.top-select-pill:focus {
  border-color: var(--primary);
}

/* Cột neo góc trên bên trái: Bóc tách lớp LUÔN nằm phía trên Công cụ bàn mổ trên mọi kích thước màn hình */
.left-floating-stack {
  position: absolute;
  top: 48px;
  left: 10px;
  z-index: 24;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  pointer-events: none;
  max-height: calc(100vh - 106px);
}

.top-floating-bar.rows-expanded ~ .left-floating-stack {
  top: 80px;
  max-height: calc(100vh - 138px);
}

/* Thanh trượt Bóc Tách Lớp Giải Phẫu (Interactive Layer Slider: Nông -> Trung -> Sâu) */
.layer-slider-bar {
  position: relative;
  top: auto;
  left: auto;
  z-index: 24;
  pointer-events: auto;
  flex-shrink: 0;
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 222px;
  transition: all 0.2s ease;
}

.layer-slider-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.layer-slider-bar.collapsed-layer-bar {
  width: auto;
  min-width: 145px;
  padding: 5px 9px;
}

.layer-slider-bar.collapsed-layer-bar .layer-slider-body {
  display: none;
}

.layer-slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-on-glass);
}

.layer-slider-badge {
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #0284c7;
  background: #e0f2fe;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
}

.layer-range-input {
  width: 100%;
  accent-color: #0284c7;
  cursor: pointer;
  height: 6px;
}

.layer-ticks {
  display: flex;
  justify-content: space-between;
  gap: 4px;
}

.layer-tick-btn {
  flex: 1;
  padding: 3px 4px;
  font-size: 10.5px;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid var(--border-glass);
  background: var(--bg-pill);
  color: var(--text-on-glass-muted);
  cursor: pointer;
  text-align: center;
}

.layer-tick-btn:hover,
.layer-tick-btn.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
  font-weight: 600;
}

/* Cụm nút Tư thế Bàn mổ & Góc nhìn Camera bên trái (Luôn nằm ngay bên dưới Bóc tách lớp) */
.camera-presets-dock {
  position: relative;
  top: auto;
  left: auto;
  bottom: auto;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 20;
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 8px;
  box-shadow: var(--shadow-md);
  width: 196px;
  max-height: calc(100vh - 205px);
  overflow-y: auto;
  transition: width 0.2s ease, padding 0.2s ease;
}

.camera-presets-dock.collapsed-dock {
  width: auto;
  padding: 6px;
}

.camera-presets-dock.collapsed-dock .dock-collapsible-content,
.camera-presets-dock.collapsed-dock .dock-collapsible-body {
  display: none;
}

.dock-collapsible-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.dock-collapse-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
  background: var(--bg-pill);
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-ui);
}

.dock-collapse-toggle:hover {
  background: var(--primary-soft);
}

.dock-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--primary);
  padding: 5px 6px;
  border-radius: 6px;
  cursor: pointer;
  background: rgba(2, 132, 199, 0.06);
  margin-top: 3px;
  user-select: none;
}

.dock-accordion-header:hover {
  background: rgba(2, 132, 199, 0.14);
}

.dock-accordion-body,
.dock-accordion-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 3px;
}

.dock-accordion-body.collapsed-sec,
.dock-accordion-group.sec-collapsed {
  display: none;
}

.dock-section-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--primary);
  padding: 2px 4px 1px;
}

/* Cụm Điều Khiển Xoay 3D & Zoom Trực Quan Trên Màn Hình (On-Screen 3D Orbit & Touch Gizmo — Góc phải dưới) */
.orbit-touch-gizmo {
  position: absolute;
  bottom: 68px;
  right: 12px;
  z-index: 25;
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 8px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 146px;
  transition: all 0.2s ease;
}

.orbit-touch-gizmo.collapsed-gizmo,
.orbit-touch-gizmo.gizmo-collapsed {
  width: auto;
  padding: 5px;
}

.orbit-touch-gizmo.collapsed-gizmo .gizmo-body,
.orbit-touch-gizmo.gizmo-collapsed .gizmo-body,
.orbit-touch-gizmo.collapsed-gizmo .orbit-gizmo-body,
.orbit-touch-gizmo.gizmo-collapsed .orbit-gizmo-body {
  display: none;
}

.gizmo-header-btn,
.orbit-gizmo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  width: 100%;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
  background: var(--bg-pill);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-ui);
}

.gizmo-body,
.orbit-gizmo-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.orbit-dpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 36px);
  grid-template-rows: repeat(3, 34px);
  gap: 4px;
  justify-content: center;
}

.orbit-pad-btn,
.orbit-btn {
  width: 36px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border-glass);
  background: var(--bg-pill);
  color: var(--text-on-glass);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
  touch-action: manipulation;
}

.orbit-pad-btn:hover,
.orbit-pad-btn:active,
.orbit-btn:hover,
.orbit-btn:active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: scale(0.96);
}

.orbit-btn.empty-cell {
  visibility: hidden;
  pointer-events: none;
}

.orbit-pad-btn.center-home,
.orbit-btn.center-reset {
  background: #e0f2fe;
  color: #0284c7;
  border-color: #7dd3fc;
  font-size: 14px;
}

.orbit-zoom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  width: 100%;
}

.orbit-zoom-btn,
.orbit-mini-btn {
  flex: 1;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
  background: var(--bg-pill);
  color: var(--text-on-glass);
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.12s ease;
}

.orbit-zoom-btn:hover,
.orbit-zoom-btn.active,
.orbit-mini-btn:hover,
.orbit-mini-btn.active-mode {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* Bảng Lưới 12 Hệ Cơ Quan Xổ Lên (12-System Expandable Grid Popover cho Mobile/Tablet/PC) */
.systems-grid-popover {
  position: absolute;
  bottom: 66px;
  left: 16px;
  z-index: 29;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 12px;
  box-shadow: var(--shadow-lg);
  width: min(680px, calc(100vw - 32px));
  display: none;
  flex-direction: column;
  gap: 8px;
}

.systems-grid-popover.open {
  display: flex;
}

.systems-grid-box,
.systems-grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 6px;
}

.systems-grid-box .sys-pill,
.systems-grid-cards .sys-pill {
  width: 100%;
  justify-content: flex-start;
  padding: 8px 11px;
  font-size: 12px;
}

/* Bảng Mặt cắt CT/MRI Đa trục (Cross-Section Slicer X / Y / Z — Thiết kế siêu gọn không tràn Trục Z trên Điện thoại) */
.slicer-floating-panel {
  position: absolute;
  top: 52px;
  right: 10px;
  width: 280px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(14px);
  border: 1.5px solid #bae6fd;
  border-radius: 12px;
  padding: 8px 10px;
  box-shadow: var(--shadow-lg);
  z-index: 28;
  color: #18181b;
}

.slicer-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}

.slicer-header-title {
  font-weight: 600;
  font-size: 12.5px;
  color: #0284c7;
  white-space: nowrap;
}

.slicer-tip-banner {
  font-size: 11px;
  color: #0369a1;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  padding: 4px 7px;
  margin-bottom: 5px;
  line-height: 1.4;
  font-weight: 500;
}

.slicer-axis-row {
  margin-top: 4px;
  padding: 4px 6px;
  border-radius: 7px;
  border: 1.5px solid transparent;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.15s;
}

.slicer-axis-row.active-slicer-axis {
  border-color: #0284c7;
  background: #f0f9ff;
}

.slicer-axis-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-bottom: 2px;
}

.slicer-axis-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slicer-flip-btn {
  flex: 0 0 auto !important;
  padding: 2px 6px !important;
  font-size: 10.5px !important;
  white-space: nowrap !important;
}

/* Thanh công cụ Vẽ Ghi Chú 2D & Chụp Ảnh (2D Annotation Toolbar) */
.annotation-toolbar {
  position: absolute;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-pill);
  padding: 6px 12px;
  box-shadow: var(--shadow-lg);
  z-index: 32;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* ============================================================================
   THẺ MÔ TẢ GIẢI PHẪU MÀU TRẮNG Ở ĐÁY MÀN HÌNH (BOTTOM INFORMATION CARD — MỤC 2.3)
   Giống ảnh số 1 & số 6 trên CH Play: Nền trắng #ffffff, chữ #1e293b,
   tiêu đề xanh đậm #0284c7 + Loa phát âm 🔊 + Cột 4 Tab dọc bên trái
   ============================================================================ */
.bottom-info-card {
  position: absolute;
  top: 48px;
  right: 10px;
  left: auto;
  bottom: auto;
  transform: none;
  width: min(335px, calc(100vw - 20px));
  max-height: calc(100vh - 112px);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(16px);
  color: #1e293b;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  z-index: 27;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

/* Tầng 0 (level-0): Chỉ hiện Tên bộ phận + danh pháp Latinh + nút xổ xuống (▾) */
.bottom-info-card.level-0 {
  width: min(275px, calc(100vw - 20px));
}

.bottom-info-card.level-0 .bottom-card-header {
  border-bottom: none;
  padding: 7px 10px;
}

.bottom-info-card.level-0 .bottom-card-vn-sub,
.bottom-info-card.level-0 .bottom-card-group-chips,
.bottom-info-card.level-0 .floating-action-pills-bar,
.bottom-info-card.level-0 .card-horizontal-tabs,
.bottom-info-card.level-0 .bottom-card-body-wrap {
  display: none !important;
}

/* Tầng 1 (level-1): Hiện Tên + 6 nút phẫu tích 2 chiều + 4 nút Tab (ẩn nội dung chi tiết bên dưới) */
.bottom-info-card.level-1 .bottom-card-body-wrap,
.bottom-info-card.collapsed .bottom-card-body-wrap {
  display: none !important;
}

/* Thanh tiêu đề Thẻ giải phẫu (Cỡ chữ cân đối 12.5px / 11px) */
.bottom-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 11px 6px;
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
}

.bottom-card-title-group {
  display: flex;
  flex-direction: column;
  gap: 1.5px;
  min-width: 0;
  flex: 1;
}

.bottom-card-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.bottom-card-main-title {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #0284c7;
  line-height: 1.3;
}

.bottom-card-latin-nav {
  font-family: var(--font-academic);
  font-style: italic;
  font-size: 11.5px;
  font-weight: 500;
  color: #3f3f46;
  line-height: 1.3;
}

.bottom-card-vn-sub {
  font-size: 11px;
  font-weight: 500;
  color: #686870;
  line-height: 1.35;
}

/* Dải chip các bộ phận đang chọn trong nhóm (Chọn nhiều) */
.bottom-card-group-chips {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  margin-top: 3px;
  padding-bottom: 1px;
}

.bottom-card-group-chips::-webkit-scrollbar {
  display: none;
}

.group-part-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e0f2fe;
  border: 1px solid #7dd3fc;
  color: #0369a1;
  font-size: 10.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
}

.group-part-chip:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

.group-chip-remove {
  font-size: 9.5px;
  color: #dc2626;
}

.clear-group-pill-btn {
  width: auto !important;
  padding: 0 8px !important;
  font-size: 10.5px !important;
  font-weight: 600 !important;
  background: #fef2f2 !important;
  border-color: #fca5a5 !important;
  color: #dc2626 !important;
  white-space: nowrap;
}

.clear-group-pill-btn:hover {
  background: #dc2626 !important;
  border-color: #dc2626 !important;
  color: #ffffff !important;
}

.pronounce-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  border: 1px solid #7dd3fc;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.pronounce-btn:hover {
  background: #0284c7;
  color: #ffffff;
}

.bottom-card-header-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.card-ctrl-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid #e4e4e7;
  background: #f8fafc;
  color: #3f3f46;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.14s;
}

.card-ctrl-btn svg {
  width: 13px;
  height: 13px;
}

.card-ctrl-btn:hover {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
}

/* Dải 6 nút phẫu tích 2 chiều 3 cột x 2 hàng cân đối (Click 1 lần hiện Xanh lá = Áp dụng, Click tiếp quay về trạng thái cũ) */
.floating-action-pills-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 6px 9px;
  background: #f8fafc;
  border-bottom: 1px solid #e4e4e7;
  overflow: hidden;
}

.glass-act-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4.5px 6px;
  border-radius: var(--radius-pill);
  border: 1px solid #e4e4e7;
  background: #ffffff;
  color: #18181b;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.14s;
}

.glass-act-pill:hover {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
}

.glass-act-pill.active-green-pill {
  background: #059669 !important;
  border-color: #10b981 !important;
  color: #ffffff !important;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25);
}

.glass-act-pill.active-multi-pill {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2);
}

.glass-act-pill svg {
  width: 11px;
  height: 11px;
}

/* Thanh 4 Tab ngang (Giải phẫu | Lâm sàng | Ghi chú | 10 Ngôn ngữ) */
.card-horizontal-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  padding: 4px 8px;
  background: #f4f4f6;
  border-bottom: 1px solid #e4e4e7;
}

.vtab-btn {
  padding: 4.5px 3px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: #ffffff;
  color: #3f3f46;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.vtab-btn:hover {
  background: #e0f2fe;
  color: #0369a1;
}

.vtab-btn.active {
  background: #0284c7;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(2, 132, 199, 0.2);
}

/* Thân thẻ học thuật bên dưới (Khi bấm mở rộng) */
.bottom-card-body-wrap {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 265px);
  background: #ffffff;
  overflow: hidden;
}

.bottom-card-tab-content {
  flex: 1;
  padding: 10px 12px;
  overflow-y: auto;
  font-size: 12.5px;
  line-height: 1.6;
  color: #18181b;
}

.anat-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 6px;
}

.anat-detail-box {
  background: #f8fafc;
  border: 1px solid #e4e4e7;
  border-radius: 6px;
  padding: 6px 9px;
}

.anat-detail-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #0284c7;
  margin-bottom: 2px;
}

.anat-detail-val {
  font-size: 12px;
  color: #3f3f46;
  line-height: 1.55;
}

/* ============================================================================
   THANH DOCK 12 HỆ CƠ QUAN QUỐC TẾ (12/12 FULL INTERNATIONAL SYSTEMS — MỤC 3)
   ============================================================================ */
.bottom-systems-dock {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 4px 6px;
  box-shadow: var(--shadow-lg);
  z-index: 26;
  max-width: calc(100vw - 8px);
  overflow-x: auto;
  scrollbar-width: none;
}

#dock-pills-container {
  gap: 2px !important;
}

#dock-pills-container .sys-dot {
  display: none;
}

.bottom-systems-dock .tool-btn {
  padding: 3px 5.5px;
  font-size: 10.5px;
  font-weight: 500;
  gap: 2px;
}

.bottom-systems-dock::-webkit-scrollbar {
  display: none;
}

.sys-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 5px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
  background: var(--bg-pill);
  color: var(--text-on-glass);
  font-size: 10.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  position: relative;
}

.sys-pill svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}

.sys-pill:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: #0369a1;
}

.sys-pill.active {
  background: #0284c7;
  border-color: #0369a1;
  color: #ffffff;
  font-weight: 600;
}

.sys-pill.xray {
  background: #f59e0b;
  border-color: #d97706;
  color: #ffffff;
  font-weight: 600;
}

.sys-dot {
  width: 4.5px;
  height: 4.5px;
  border-radius: 50%;
  background: #94a3b8;
  flex-shrink: 0;
}

.sys-pill.active .sys-dot {
  background: #38bdf8;
  box-shadow: 0 0 6px #ffffff;
}

.sys-pill.xray .sys-dot {
  background: #fef08a;
}

.sys-lock-tag {
  font-size: 9px;
  font-weight: 600;
  padding: 0px 3px;
  border-radius: 3px;
  background: rgba(245, 158, 11, 0.2);
  color: #d97706;
}

.sys-pill.active .sys-lock-tag {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.dock-divider {
  width: 1px;
  height: 20px;
  background: var(--border-glass);
  margin: 0 2px;
  flex-shrink: 0;
}

/* ============================================================================
   3D INTERACTIVE QUIZ ENGINE HUD (MỤC 4 — 4 CHẾ ĐỘ THI OFFLINE)
   ============================================================================ */
.quiz-hud-panel {
  position: absolute;
  top: 50px;
  right: 10px;
  width: min(345px, calc(100vw - 20px));
  background: rgba(255, 255, 255, 0.98);
  color: #18181b;
  border: 1.5px solid #0284c7;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(2, 132, 199, 0.16);
  z-index: 29;
  overflow: hidden;
}

.quiz-hud-header {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.quiz-hud-body {
  padding: 10px 12px;
  max-height: calc(100vh - 175px);
  overflow-y: auto;
}

.quiz-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.quiz-mode-btn {
  padding: 5px 7px;
  border-radius: 6px;
  border: 1px solid #e4e4e7;
  background: #f8fafc;
  color: #3f3f46;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
}

.quiz-mode-btn.active {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0369a1;
  font-weight: 600;
}

.quiz-option-btn {
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  margin-top: 5px;
  border-radius: 8px;
  border: 1px solid #e4e4e7;
  background: #f8fafc;
  color: #18181b;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.14s;
  line-height: 1.45;
}

.quiz-option-btn:hover:not(:disabled) {
  background: #e0f2fe;
  border-color: #0284c7;
}

.quiz-option-btn.correct {
  background: #dcfce7;
  border-color: #10b981;
  color: #065f46;
  font-weight: 600;
}

.quiz-option-btn.wrong {
  background: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
  font-weight: 600;
}

/* Thanh tiến trình nạp 12 hệ cơ quan lúc khởi động */
.loading-banner {
  position: absolute;
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  border: 1px solid #bae6fd;
  border-radius: var(--radius-pill);
  padding: 7px 18px;
  color: #0369a1;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 35;
  box-shadow: var(--shadow-md);
}

.loading-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #0284c7;
  animation: pulseDot 0.9s infinite alternate;
}

@keyframes pulseDot {
  from { opacity: 0.35; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1.2); }
}

/* ============================================================================
   NGĂN KÉO (DRAWER OVERLAY): TỪ ĐIỂN 9 NGÔN NGỮ, BOOKMARKS, BẢN QUYỀN PRO
   ============================================================================ */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(6px);
  z-index: 90;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 18px;
}

.drawer-window {
  width: 100%;
  max-width: 1240px;
  height: calc(100vh - 36px);
  background: #f4f4f6;
  color: var(--text-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #18181b;
  color: #ffffff;
  gap: 8px;
  flex-wrap: wrap;
}

.drawer-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.drawer-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(39, 39, 42, 0.85);
  color: #d4d4d8;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.drawer-tab-btn.active {
  background: #0284c7;
  border-color: #38bdf8;
  color: #ffffff;
  font-weight: 600;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.stat-value {
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: #0284c7;
  margin-top: 2px;
}

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.filter-bar {
  display: grid;
  grid-template-columns: 2fr 1fr auto;
  gap: 8px;
  margin-bottom: 10px;
}

/* ============================================================================
   ĐÁP ỨNG ĐA HƯỚNG (LANDSCAPE PC/TABLET & 9:16 PORTRAIT MOBILE — MỤC 2.4)
   ============================================================================ */
@media (max-width: 1180px) {
  .app-brand-title {
    display: none;
  }
  .app-brand-pill {
    padding-right: 0;
    border-right: none;
  }
  .search-box-wrap,
  .search-box-wrap:focus-within {
    width: 112px;
  }
  .top-floating-bar .tool-btn {
    padding: 2.5px 5px;
    font-size: 10.5px;
    gap: 2px;
  }
  .top-select-pill {
    padding: 3px 5px;
    font-size: 10.5px;
  }
}

@media (max-width: 1024px) {
  .left-floating-stack {
    top: 44px;
    left: 8px;
    gap: 5px;
    max-height: calc(100vh - 98px);
  }
  .layer-slider-bar {
    position: relative;
    top: auto;
    bottom: auto;
    left: auto;
    width: 196px;
    padding: 5px 8px;
  }
  .camera-presets-dock {
    position: relative;
    top: auto;
    bottom: auto;
    left: auto;
    max-height: calc(100vh - 190px);
    width: 175px;
  }
}

/* ============================================================================
   CẨM NANG HƯỚNG DẪN SỬ DỤNG TRỰC QUAN (USER GUIDE TAB — CANH ĐỀU & MINH HỌA SVG)
   ============================================================================ */
.guide-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 18px;
}

.guide-hero {
  background: linear-gradient(135deg, #0f172a 0%, #0369a1 100%);
  color: #ffffff;
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.14);
}

.guide-hero-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #7dd3fc;
  margin-bottom: 6px;
}

.guide-hero-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 6px 0;
  line-height: 1.3;
  color: #ffffff;
}

.guide-hero-sub {
  font-size: 13.5px;
  line-height: 1.65;
  color: #e0f2fe;
  margin: 0 0 12px 0;
  text-align: left;
}

.guide-toc-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.guide-toc-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4.5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(15, 23, 42, 0.45);
  color: #f8fafc;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.guide-toc-pill span {
  color: #38bdf8;
  font-weight: 600;
}

.guide-toc-pill:hover {
  background: #0284c7;
  border-color: #7dd3fc;
  color: #ffffff;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
}

.guide-card {
  background: #ffffff;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.guide-card-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.guide-card-badge {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
}

.guide-card-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #18181b;
  line-height: 1.35;
}

.guide-visual-box {
  background: #f8fafc;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.guide-desc-text {
  font-size: 13.5px;
  line-height: 1.65;
  color: #3f3f46;
  text-align: left;
}

.guide-example-box {
  font-size: 13px;
  line-height: 1.6;
  color: #18181b;
  background: #f0fdf4;
  border-left: 3px solid #16a34a;
  border-radius: 6px;
  padding: 9px 12px;
  text-align: left;
}

.guide-card-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 6px;
  border-top: 1px solid #f4f4f6;
}

/* ============================================================================
   ĐÁP ỨNG ĐA THIẾT BỊ KIỂU FLUTTER BOX-CONSTRAINTS (PC <= 1580px, TABLET & ĐIỆN THOẠI):
   KHÓA 100% TRONG KHUNG NHÌN (ZERO OVERFLOW) & TỰ ĐỘNG ĐẨY CÁC BẢNG THEO CHIỀU CAO THỰC TẾ
   ============================================================================ */
.left-floating-stack {
  top: var(--safe-top-offset, 46px);
  max-height: calc(100vh - var(--safe-top-offset, 46px) - var(--safe-bottom-offset, 46px) - 6px);
}

.bottom-info-card,
.slicer-floating-panel,
.quiz-hud-panel {
  top: var(--safe-top-offset, 46px);
  max-height: calc(100vh - var(--safe-top-offset, 46px) - var(--safe-bottom-offset, 46px) - 6px);
  max-width: calc(100vw - 16px);
  box-sizing: border-box;
}

.orbit-touch-gizmo {
  bottom: var(--safe-bottom-offset, 46px);
}

@media (max-width: 1580px), (max-height: 540px) {
  .top-floating-bar:not(.topbar-collapsed) {
    top: 4px;
    left: 6px;
    right: 6px;
    max-width: calc(100vw - 12px) !important;
    box-sizing: border-box !important;
    flex-wrap: wrap !important;
    justify-content: center;
    overflow-x: visible !important;
    row-gap: 2.5px;
    column-gap: 3px;
    background: var(--bg-glass-strong);
    backdrop-filter: blur(14px);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    padding: 3px 6px;
    box-shadow: var(--shadow-md);
    pointer-events: auto;
  }

  .top-floating-bar:not(.topbar-collapsed) .top-bar-group {
    display: contents !important;
  }

  .top-floating-bar .tool-btn {
    min-height: 23px;
    padding: 2px 6px;
    font-size: 10.5px;
    gap: 2.5px;
  }

  .top-floating-bar .tool-btn .btn-label {
    display: inline !important;
  }

  .search-box-wrap,
  .search-box-wrap:focus-within {
    width: 98px;
  }

  .search-box-input-wrap {
    padding: 2px 6px;
  }

  .top-select-pill {
    padding: 2px 5px;
    font-size: 10.5px;
  }

  .bottom-systems-dock:not(.bottomdock-collapsed) {
    bottom: 4px;
    flex-wrap: wrap !important;
    justify-content: center;
    overflow-x: visible !important;
    width: calc(100vw - 12px) !important;
    max-width: calc(100vw - 12px) !important;
    box-sizing: border-box !important;
    row-gap: 2.5px;
    column-gap: 3px;
    padding: 3px 6px;
    border-radius: 10px;
  }

  .bottom-systems-dock:not(.bottomdock-collapsed) #dock-pills-container {
    display: contents !important;
  }

  .bottom-systems-dock:not(.bottomdock-collapsed) .dock-divider {
    display: none;
  }

  .sys-pill {
    min-height: 22px;
    padding: 2px 6px;
    font-size: 10px;
    gap: 2.5px;
  }

  .left-floating-stack {
    top: var(--safe-top-offset, 62px);
    left: 8px;
    gap: 4px;
    max-height: calc(100vh - var(--safe-top-offset, 62px) - var(--safe-bottom-offset, 58px) - 6px);
  }

  .left-floating-stack.topbar-is-collapsed,
  #viewer-workspace.topbar-is-collapsed .left-floating-stack {
    top: var(--safe-top-offset, 34px);
    max-height: calc(100vh - var(--safe-top-offset, 34px) - var(--safe-bottom-offset, 58px) - 6px);
  }

  .layer-slider-bar {
    position: relative;
    top: auto;
    bottom: auto;
    left: auto;
    width: 186px;
    padding: 4px 7px;
  }

  .camera-presets-dock {
    position: relative;
    top: auto;
    bottom: auto;
    left: auto;
    width: 170px;
    max-height: calc(100vh - var(--safe-top-offset, 62px) - var(--safe-bottom-offset, 58px) - 70px);
    overflow-y: auto;
    z-index: 24;
  }

  /* Thẻ mô tả giải phẫu bên phải */
  .bottom-info-card {
    top: var(--safe-top-offset, 62px);
    right: 8px;
    bottom: auto;
    width: min(325px, 46vw);
    max-height: calc(100vh - var(--safe-top-offset, 62px) - var(--safe-bottom-offset, 58px) - 6px);
  }

  .bottom-info-card .bottom-card-header {
    padding: 5px 9px 4px;
  }

  .bottom-info-card .bottom-card-vn-sub {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .bottom-info-card .floating-action-pills-bar {
    padding: 4px 7px;
    gap: 3px;
  }

  .bottom-info-card.level-0 {
    width: min(260px, 42vw);
  }

  #viewer-workspace.topbar-is-collapsed .bottom-info-card {
    top: var(--safe-top-offset, 34px);
    max-height: calc(100vh - var(--safe-top-offset, 34px) - var(--safe-bottom-offset, 58px) - 6px);
  }

  .bottom-card-body-wrap {
    max-height: 26vh;
  }

  .glass-act-pill {
    min-height: 25px;
    font-size: 10px;
    padding: 3px 5px;
  }

  .slicer-floating-panel {
    top: var(--safe-top-offset, 62px);
    right: 8px;
    width: min(275px, 44vw);
    max-height: calc(100vh - var(--safe-top-offset, 62px) - var(--safe-bottom-offset, 58px) - 6px);
    padding: 5px 8px;
    overflow-y: auto;
  }

  #viewer-workspace.topbar-is-collapsed .slicer-floating-panel {
    top: var(--safe-top-offset, 34px);
    max-height: calc(100vh - var(--safe-top-offset, 34px) - var(--safe-bottom-offset, 58px) - 6px);
  }

  .slicer-header-bar {
    margin-bottom: 2px;
  }

  .slicer-header-title {
    font-size: 11px;
  }

  .slicer-tip-banner {
    font-size: 9px;
    padding: 2px 5px;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .slicer-axis-row {
    margin-top: 2.5px;
    padding: 2.5px 5px;
  }

  .slicer-axis-head {
    font-size: 9.8px;
    margin-bottom: 1px;
  }

  .slicer-floating-panel .layer-range-input {
    height: 4px;
    margin: 2px 0;
  }

  .quiz-hud-panel {
    top: var(--safe-top-offset, 62px);
    right: 8px;
    width: min(295px, 46vw);
    max-height: calc(100vh - var(--safe-top-offset, 62px) - var(--safe-bottom-offset, 58px) - 6px);
  }

  #viewer-workspace.topbar-is-collapsed .quiz-hud-panel {
    top: var(--safe-top-offset, 8px);
    max-height: calc(100vh - var(--safe-top-offset, 8px) - var(--safe-bottom-offset, 58px) - 6px);
  }

  #viewer-workspace.topbar-is-collapsed.bottomdock-is-collapsed .quiz-hud-panel {
    top: 8px;
    max-height: calc(100vh - 42px);
  }

  #viewer-workspace.topbar-is-collapsed.bottomdock-is-collapsed .quiz-hud-body {
    max-height: calc(100vh - 92px);
  }

  .orbit-touch-gizmo {
    width: 126px;
    bottom: var(--safe-bottom-offset, 62px);
    right: 8px;
  }

  #viewer-workspace.bottomdock-is-collapsed .orbit-touch-gizmo {
    bottom: 36px;
  }

  .orbit-dpad-grid {
    grid-template-columns: repeat(3, 30px);
    grid-template-rows: repeat(3, 28px);
    gap: 3px;
  }

  .orbit-pad-btn,
  .orbit-btn {
    width: 30px;
    height: 28px;
    font-size: 11.5px;
  }

  .drawer-header {
    padding: 5px 10px;
    gap: 6px;
    flex-wrap: nowrap;
    overflow: hidden;
  }

  .drawer-header #drawer-close-btn {
    position: static;
    flex-shrink: 0;
  }

  .drawer-tabs {
    flex: 1;
    min-width: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 4px;
  }

  .drawer-tabs::-webkit-scrollbar {
    display: none;
  }

  .drawer-tab-btn {
    padding: 3.5px 7px;
    font-size: 10px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .drawer-body {
    padding: 8px 10px;
  }

  .drawer-body .stat-grid {
    display: none;
  }

  .guide-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .bottom-info-card,
  .bottom-info-card.level-0,
  .slicer-floating-panel,
  .quiz-hud-panel {
    left: 6px !important;
    right: 6px !important;
    width: auto !important;
    max-width: calc(100vw - 12px) !important;
  }
  .layer-slider-bar {
    width: min(172px, 48vw);
  }
  .camera-presets-dock {
    width: min(162px, 46vw);
  }
}

@media (max-width: 480px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }
  .anat-detail-grid {
    grid-template-columns: 1fr;
  }
  .filter-bar {
    grid-template-columns: 1fr;
  }
}
