:root {
  --bg-dark: #0f141c;
  --bg-panel: rgba(18, 24, 38, 0.88);
  --bg-card: rgba(26, 35, 54, 0.75);
  --border-color: rgba(64, 86, 128, 0.35);
  --text-main: #f0f4fc;
  --text-muted: #8e9db7;
  --accent-cyan: #00e5ff;
  --accent-blue: #2979ff;
  --accent-gold: #ffd600;
  --accent-red: #ff3d00;
  --accent-green: #00e676;
  --shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 20px 2px rgba(0, 229, 255, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  user-select: none;
}

#app-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  max-width: 100vw;
}

#canvas3d {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* TOP HEADER */
header {
  position: absolute;
  top: 16px;
  left: 20px;
  right: 20px;
  height: 56px;
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 10;
  box-shadow: var(--shadow);
  max-width: calc(100vw - 40px);
  overflow: hidden;
}

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

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: #0b111e;
}

.brand-text h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-main);
}

.brand-text span {
  font-size: 11px;
  color: var(--accent-cyan);
  display: block;
}

.gender-switch-container {
  display: flex;
  background: rgba(14, 20, 32, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 3px;
  gap: 4px;
}

.btn-gender {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-gender.active {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #0b111e;
  box-shadow: 0 2px 10px rgba(0, 229, 255, 0.4);
}

.btn-gender:hover:not(.active) {
  color: white;
  background: rgba(255, 255, 255, 0.08);
}

/* Anatomical Mode Switcher */
.mode-switch-container {
  display: flex;
  background: rgba(14, 20, 32, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 3px;
  gap: 3px;
}

.btn-mode {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.btn-mode.active {
  background: linear-gradient(135deg, #00e5ff, #0284c7);
  color: #0b111e;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(0, 229, 255, 0.35);
}

.btn-mode:hover:not(.active) {
  color: white;
  background: rgba(255, 255, 255, 0.08);
}

/* Language Switcher (KOR / ENG / CHN) */
.lang-switch-container {
  display: flex;
  background: rgba(14, 20, 32, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 3px;
  gap: 3px;
}

.btn-lang {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.5px;
}

.btn-lang.active {
  background: #f59e0b;
  color: #0b111e;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.btn-lang:hover:not(.active) {
  color: white;
  background: rgba(255, 255, 255, 0.08);
}

/* Left Panel Mode Selector Grid */
.mode-selector-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-top: 4px;
}

.btn-panel-mode {
  background: rgba(18, 24, 38, 0.85);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.btn-panel-mode:hover {
  border-color: var(--accent-cyan);
  color: white;
  background: rgba(0, 229, 255, 0.1);
}

.btn-panel-mode.active {
  background: rgba(0, 229, 255, 0.22);
  border-color: var(--accent-cyan);
  color: #00e5ff;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.25);
}

.btn-small-toggle {
  background: rgba(26, 35, 54, 0.85);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-small-toggle:hover {
  border-color: var(--accent-cyan);
  background: rgba(0, 229, 255, 0.15);
}

.highlight-item {
  border-color: rgba(0, 229, 255, 0.45) !important;
  background: rgba(0, 229, 255, 0.06) !important;
}

.header-badges {
  display: flex;
  gap: 10px;
}

.badge {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-muted);
}
.badge strong {
  color: var(--accent-cyan);
}

.header-actions {
  display: flex;
  gap: 8px;
}

.btn-icon {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: rgba(0, 229, 255, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn-icon.active {
  background: rgba(0, 229, 255, 0.25);
  border-color: var(--accent-cyan);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
}

/* SIDEBAR CONTROLS */
#left-panel {
  position: absolute;
  top: 86px;
  left: 20px;
  bottom: 20px;
  width: 350px;
  background: var(--bg-panel);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  z-index: 10;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel-body::-webkit-scrollbar {
  width: 6px;
}
.panel-body::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-cyan);
  margin-bottom: 10px;
}

/* LAYER TOGGLES */
.layer-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.layer-item:hover {
  border-color: rgba(0, 229, 255, 0.4);
}

.layer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.layer-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}

.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #2b3952;
  transition: .3s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-cyan);
}

input:checked + .slider:before {
  transform: translateX(16px);
}

.opacity-control {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--text-muted);
}

.opacity-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 2px;
  background: #2c3a54;
  outline: none;
}

.opacity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
}

.control-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.control-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.select-small {
  background: #111827;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-main);
  padding: 4px 8px;
  font-size: 11px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.select-small:focus {
  border-color: var(--accent-cyan);
}

/* SEARCH BOX */
.search-container {
  position: relative;
}

.search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 9px 12px 9px 34px;
  font-size: 13px;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--accent-cyan);
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--text-muted);
}

.search-results {
  position: absolute;
  top: 42px;
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: #151c2c;
  border: 1px solid var(--accent-cyan);
  border-radius: 8px;
  z-index: 50;
  display: none;
  box-shadow: 0 10px 25px rgba(0,0,0,0.7);
}

.search-item {
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.search-item:hover {
  background: rgba(0, 229, 255, 0.15);
  color: var(--accent-cyan);
}

.search-item strong {
  color: var(--accent-cyan);
}

/* MERIDIAN SELECTOR */
.select-meridian {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12px;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
}

.select-meridian option {
  background: #111827;
  color: white;
}

/* CAMERA PRESETS */
.camera-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.btn-cam {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-cam:hover {
  background: rgba(0, 229, 255, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* RIGHT INFO DRAWER */
#right-drawer {
  position: absolute;
  top: 86px;
  right: 20px;
  bottom: 20px;
  width: 380px;
  background: var(--bg-panel);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  z-index: 10;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transform: translateX(420px);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s ease;
  overflow: hidden;
}

#right-drawer.open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

.drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.drawer-title-area h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-cyan);
}

.drawer-title-area span {
  font-size: 13px;
  color: var(--text-muted);
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.btn-close:hover {
  color: white;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 13px;
  line-height: 1.6;
}

.drawer-body::-webkit-scrollbar {
  width: 6px;
}
.drawer-body::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.info-block {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 14px;
}

.info-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.drawer-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  background: rgba(14, 20, 32, 0.6);
}

.btn-focus {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  border: none;
  color: #0b111e;
  font-weight: 700;
  font-size: 13px;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-focus:hover {
  opacity: 0.9;
}

/* FLOATING 3D TOOLTIP */
#floating-tooltip {
  position: absolute;
  z-index: 20;
  background: rgba(13, 20, 32, 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid var(--accent-cyan);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  color: white;
  pointer-events: none;
  display: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 12px rgba(0, 229, 255, 0.35);
  transform: translate(14px, -50%);
  max-width: 280px;
  transition: opacity 0.15s ease;
}

.tooltip-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}

.tooltip-code {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.tooltip-name {
  font-size: 12px;
  font-weight: 600;
  color: #f0f4fc;
}

.tooltip-meridian {
  font-size: 11px;
  color: #8e9db7;
  line-height: 1.3;
}

/* LOADING OVERLAY */
#loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #090d14;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(0, 229, 255, 0.15);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.progress-box {
  width: 300px;
  text-align: center;
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: #1b2436;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 10px;
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
  transition: width 0.3s ease;
}

.progress-status {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* DIAGNOSTICS HUD PANEL */
.diag-panel {
  position: absolute;
  top: 75px;
  right: 20px;
  width: 360px;
  max-height: calc(100vh - 100px);
  background: rgba(13, 20, 32, 0.94);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 229, 255, 0.45);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.75), 0 0 20px rgba(0, 229, 255, 0.2);
  z-index: 95;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: inherit;
  color: #f0f4fc;
}

.diag-header {
  padding: 12px 16px;
  background: rgba(0, 229, 255, 0.1);
  border-bottom: 1px solid rgba(0, 229, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
  color: var(--accent-cyan);
}

.btn-close-diag {
  background: none;
  border: none;
  color: #8e9db7;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
}
.btn-close-diag:hover {
  color: white;
}

.diag-content {
  padding: 14px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
}

.diag-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.diag-key {
  color: #8e9db7;
  font-weight: 500;
}

.diag-val {
  color: #ffffff;
  font-weight: 600;
  font-family: monospace;
}

.diag-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
}

.btn-diag-action {
  width: 100%;
  padding: 9px;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.2), rgba(0, 102, 255, 0.3));
  border: 1px solid var(--accent-cyan);
  border-radius: 8px;
  color: white;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-diag-action:hover {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.4), rgba(0, 102, 255, 0.5));
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
}

.test-results-box {
  margin-top: 10px;
  max-height: 200px;
  overflow-y: auto;
  font-size: 11px;
  font-family: monospace;
  background: rgba(0, 0, 0, 0.4);
  padding: 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.test-pass {
  color: #10b981;
  margin-bottom: 3px;
}

.test-fail {
  color: #ef4444;
  margin-bottom: 3px;
}

/* =========================================================================
   PRD V19 COMPLETE ACUPOINT BROWSER STYLES
   ========================================================================= */

/* Left Panel Tabs */
.panel-nav-tabs {
  display: flex;
  background: rgba(14, 20, 32, 0.95);
  border-bottom: 1px solid var(--border-color);
  padding: 6px;
  gap: 6px;
  flex-shrink: 0;
}

.panel-tab {
  flex: 1;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.panel-tab:hover:not(.active) {
  color: white;
  background: rgba(255, 255, 255, 0.06);
}

.panel-tab.active {
  background: rgba(0, 229, 255, 0.15);
  border-color: rgba(0, 229, 255, 0.4);
  color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.15);
}

/* Tab Contents */
.tab-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Browser Top Stats */
.browser-stats-bar {
  padding: 10px 14px;
  background: rgba(26, 35, 54, 0.6);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.stats-main {
  display: flex;
  flex-direction: column;
}

.stats-count {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-cyan);
  letter-spacing: 0.3px;
}

.stats-label {
  font-size: 10px;
  color: var(--text-muted);
}

.stats-pill {
  font-size: 11px;
  font-weight: 600;
  background: rgba(0, 229, 255, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 229, 255, 0.3);
  padding: 3px 8px;
  border-radius: 12px;
}

/* 14 Meridians Horizontal Pills Bar */
.meridian-pills-section {
  padding: 10px 14px 6px 14px;
  background: rgba(18, 24, 38, 0.5);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.meridian-pills-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.section-title-sm {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-cyan);
}

.meridian-summary {
  font-size: 10px;
  color: var(--text-muted);
}

.meridian-pills-container {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.meridian-pills-container::-webkit-scrollbar {
  height: 4px;
}
.meridian-pills-container::-webkit-scrollbar-thumb {
  background: rgba(64, 86, 128, 0.5);
  border-radius: 2px;
}

.meridian-pill {
  flex-shrink: 0;
  background: rgba(26, 35, 54, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 4px 10px;
  color: var(--text-main);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  user-select: none;
}

.meridian-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.meridian-pill.active {
  background: rgba(0, 229, 255, 0.2);
  border-color: var(--accent-cyan);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.pill-code {
  font-weight: 700;
}

.pill-count {
  font-size: 9px;
  opacity: 0.85;
  background: rgba(0, 0, 0, 0.35);
  padding: 1px 4px;
  border-radius: 8px;
}

/* Search Box */
.browser-search-wrapper {
  padding: 8px 14px;
  position: relative;
  background: rgba(18, 24, 38, 0.7);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.browser-search-input {
  width: 100%;
  background: rgba(26, 35, 54, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 7px 28px 7px 30px;
  font-size: 12px;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s;
}

.browser-search-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.3);
}

.browser-search-icon {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.btn-clear-search {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  padding: 2px;
}
.btn-clear-search:hover {
  color: white;
}

/* Bilateral Side & Step Navigation Toolbar */
.browser-toolbar {
  padding: 6px 14px;
  background: rgba(14, 20, 32, 0.85);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
}

.side-selector-group {
  display: flex;
  background: rgba(26, 35, 54, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.btn-side-pill {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-side-pill:hover:not(.active) {
  color: white;
}

.btn-side-pill.active {
  background: rgba(0, 229, 255, 0.25);
  color: var(--accent-cyan);
  font-weight: 700;
}

.nav-step-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-step-nav {
  background: rgba(26, 35, 54, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.2s;
}

.btn-step-nav:hover {
  background: rgba(0, 229, 255, 0.2);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.step-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 48px;
  text-align: center;
  font-family: monospace;
}

/* Scrollable Point List */
.browser-points-scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 10px;
}

.browser-points-scroll::-webkit-scrollbar {
  width: 5px;
}
.browser-points-scroll::-webkit-scrollbar-thumb {
  background: rgba(64, 86, 128, 0.5);
  border-radius: 3px;
}

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

.point-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 10px;
  background: rgba(26, 35, 54, 0.65);
  border: 1px solid rgba(64, 86, 128, 0.25);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.point-card:hover {
  background: rgba(0, 229, 255, 0.1);
  border-color: rgba(0, 229, 255, 0.35);
  transform: translateX(2px);
}

.point-card.active {
  background: rgba(0, 229, 255, 0.22);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.25);
}

.point-card-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.point-card-code {
  font-size: 12px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 5px;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.point-card-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.point-card-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.point-card-sub {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.point-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.point-card-num {
  font-size: 9px;
  color: var(--text-muted);
  font-family: monospace;
}

.point-card-tag {
  font-size: 9px;
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 4px;
  border-radius: 3px;
  color: var(--text-muted);
}

/* Drawer Header Nav */
.drawer-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-drawer-step {
  background: rgba(26, 35, 54, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.2s;
}

.btn-drawer-step:hover {
  background: rgba(0, 229, 255, 0.2);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* =========================================================================
   PRD V20 COMMERCIAL MODALS & LICENSING STYLES
   ========================================================================= */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 15, 26, 0.75);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 620px;
  max-height: 85vh;
  background: #151c2c;
  border: 1px solid var(--accent-cyan);
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 229, 255, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalFadeIn 0.22s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(26, 35, 54, 0.8);
}

.modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}

.btn-modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-main);
}

.modal-body::-webkit-scrollbar {
  width: 5px;
}
.modal-body::-webkit-scrollbar-thumb {
  background: rgba(64, 86, 128, 0.5);
  border-radius: 3px;
}

.guide-section {
  background: rgba(26, 35, 54, 0.5);
  border: 1px solid rgba(64, 86, 128, 0.3);
  border-radius: 10px;
  padding: 14px 16px;
}

.guide-section h4 {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.guide-section ul {
  padding-left: 18px;
  margin: 0;
}

.guide-section li {
  margin-bottom: 6px;
}

.guide-section code {
  background: rgba(0, 229, 255, 0.15);
  color: var(--accent-cyan);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  background: rgba(26, 35, 54, 0.8);
  display: flex;
  justify-content: flex-end;
}

.btn-modal-action {
  background: var(--accent-cyan);
  color: #0b111e;
  border: none;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-modal-action:hover {
  background: #33ebff;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
}

.license-status-badge {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
}

.license-status-badge.active {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid #10b981;
  color: #10b981;
}

.license-info-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

.license-info-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 4px;
}

.license-info-row .info-k {
  color: var(--text-muted);
}

.license-info-row .info-v {
  color: #ffffff;
  font-family: monospace;
}

.license-input-wrapper {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.license-input {
  flex: 1;
  background: #111827;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-main);
  outline: none;
  font-family: monospace;
}

.license-input:focus {
  border-color: var(--accent-cyan);
}

.btn-activate {
  background: rgba(0, 229, 255, 0.15);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-activate:hover {
  background: var(--accent-cyan);
  color: #0b111e;
}

/* =========================================================================
   PRD V21 RESPONSIVE ARCHITECTURE & ERGONOMIC TOUCH STYLING
   ========================================================================= */

/* Safe Area Inset Support */
:root {
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
}

/* Desktop Sidebar Toggle Button */
.btn-toggle-sidebar {
  background: rgba(26, 35, 54, 0.7);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
  margin-right: 4px;
}

.btn-toggle-sidebar:hover {
  background: rgba(0, 229, 255, 0.15);
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

/* Floating Sidebar Button (When Sidebar is Collapsed on Desktop) */
.btn-floating-sidebar {
  position: absolute;
  top: 86px;
  left: 20px;
  z-index: 35;
  background: var(--bg-panel);
  backdrop-filter: blur(14px);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  padding: 8px 16px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 229, 255, 0.25);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-floating-sidebar:hover {
  background: rgba(0, 229, 255, 0.2);
  transform: translateY(-2px);
}

/* Mobile Quick Menu Hamburger Button */
.btn-mobile-menu-toggle {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  min-width: 36px;
}

.btn-mobile-menu-toggle:hover,
.btn-mobile-menu-toggle.active {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: rgba(0, 229, 255, 0.15);
}

/* Mobile Panel Drag & Close Header */
.mobile-panel-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 6px 16px;
  border-bottom: 1px solid var(--border-color);
}

.mobile-drag-indicator {
  width: 44px;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  margin: 0 auto;
}

.btn-close-mobile {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

/* Drawer Mobile Drag Handle */
.drawer-drag-handle {
  display: none;
  width: 100%;
  padding: 10px 0 4px 0;
  text-align: center;
  cursor: grab;
}

.drawer-drag-handle .drag-bar {
  display: inline-block;
  width: 48px;
  height: 5px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(56px + var(--sab));
  padding-bottom: var(--sab);
  background: rgba(12, 17, 26, 0.96);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--border-color);
  z-index: 45;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

.mobile-bottom-nav .nav-item {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 44px;
  min-height: 44px;
}

.mobile-bottom-nav .nav-item .nav-icon {
  font-size: 17px;
  line-height: 1;
}

.mobile-bottom-nav .nav-item .nav-text {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.mobile-bottom-nav .nav-item:hover,
.mobile-bottom-nav .nav-item.active {
  color: var(--accent-cyan);
}

.mobile-bottom-nav .nav-item.active .nav-icon {
  transform: scale(1.12);
}

/* Mobile Quick Menu Modal */
.modal-mobile-menu-card {
  max-width: 400px;
}

.lang-switch-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.lang-switch-grid .btn-lang {
  padding: 8px 12px;
  font-size: 13px;
  text-align: center;
  border-radius: 8px;
}

.quick-action-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-menu-action {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-menu-action:hover {
  background: rgba(0, 229, 255, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Touch Action Isolation to Prevent Model Panning When Scrolling */
.browser-points-scroll,
.drawer-body,
.panel-body,
.meridian-pills-container,
.modal-body {
  touch-action: pan-y !important;
  -webkit-overflow-scrolling: touch;
}

/* =========================================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================================= */

/* MOBILE VIEWPORTS: <= 767px (360px, 390px, 430px) */
@media (max-width: 767px) {
  header {
    top: calc(6px + var(--sat));
    left: 8px;
    right: 8px;
    height: 50px;
    padding: 0 10px;
    border-radius: 10px;
  }

  .btn-toggle-sidebar {
    display: none;
  }

  .brand {
    gap: 8px;
  }

  .brand-icon {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .brand-text h1 {
    font-size: 14px;
    letter-spacing: 0;
  }

  .brand-text span {
    display: none;
  }

  .gender-switch-container {
    padding: 2px;
    gap: 2px;
  }

  .btn-gender {
    padding: 4px 8px;
    font-size: 11px;
    min-height: 32px;
  }

  /* Hide overflowing desktop containers in header */
  .mode-switch-container,
  .lang-switch-container,
  .header-actions {
    display: none !important;
  }

  .btn-mobile-menu-toggle {
    display: flex;
  }

  /* Left Panel as Responsive Mobile Bottom Sheet */
  #left-panel {
    position: fixed;
    top: auto;
    bottom: calc(56px + var(--sab));
    left: 0;
    right: 0;
    width: 100%;
    max-height: 60vh;
    border-radius: 18px 18px 0 0;
    border-bottom: none;
    z-index: 40;
    transform: translateY(115%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.7);
  }

  #left-panel.mobile-open {
    transform: translateY(0);
  }

  .mobile-panel-header {
    display: flex;
  }

  /* Right Drawer as Draggable Mobile Bottom Sheet */
  #right-drawer {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 75vh;
    min-height: 260px;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
    z-index: 50;
    transform: translateY(115%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.8);
    padding-bottom: calc(12px + var(--sab));
  }

  #right-drawer.open {
    transform: translateY(0);
  }

  .drawer-drag-handle {
    display: block;
  }

  .drawer-header {
    padding: 8px 16px 12px 16px;
  }

  .drawer-title-area h2 {
    font-size: 22px;
  }

  /* PRD V21 Section 5: 16px Mobile Body Text */
  .drawer-body {
    padding: 12px 16px;
    font-size: 16px;
    gap: 12px;
  }

  .info-block {
    padding: 10px 12px;
  }

  .info-label {
    font-size: 13px;
    margin-bottom: 4px;
  }

  .info-block div[id^="drawer-"] {
    font-size: 15px;
    line-height: 1.5;
  }

  .btn-focus {
    padding: 13px 18px;
    font-size: 15px;
    min-height: 46px;
  }

  /* Show Bottom Navigation */
  .mobile-bottom-nav {
    display: flex;
  }

  /* Camera grid responsive */
  .camera-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .btn-cam {
    padding: 8px 6px;
    font-size: 11px;
    min-height: 40px;
  }

  /* Minimum 44px Touch Targets */
  .btn-side-pill,
  .btn-step-nav,
  .meridian-pill-btn {
    min-height: 40px;
    font-size: 12px;
  }

  .btn-step-nav {
    min-width: 44px;
  }

  .browser-point-item {
    min-height: 48px;
    padding: 10px 12px;
  }

  .point-item-code {
    font-size: 15px;
  }

  .point-item-name {
    font-size: 13px;
  }
}

/* TABLET VIEWPORTS: 768px – 1023px (e.g. iPad 768px, 820px) */
@media (min-width: 768px) and (max-width: 1023px) {
  header {
    top: 12px;
    left: 12px;
    right: 12px;
    padding: 0 12px;
  }

  .btn-toggle-sidebar {
    display: flex;
  }

  .btn-mobile-menu-toggle {
    display: none;
  }

  .brand-text span {
    display: none;
  }

  .header-actions .btn-icon span {
    display: none;
  }

  .btn-icon {
    padding: 6px 8px;
  }

  .mode-switch-container .btn-mode,
  .lang-switch-container .btn-lang,
  .btn-gender {
    padding: 4px 6px;
    font-size: 11px;
  }

  #left-panel {
    top: 76px;
    left: 12px;
    bottom: 12px;
    width: 320px;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
  }

  #left-panel.collapsed {
    transform: translateX(-350px);
    visibility: hidden;
    pointer-events: none;
  }

  #right-drawer {
    top: 76px;
    right: 12px;
    bottom: 12px;
    width: 340px;
  }

  .mobile-bottom-nav {
    display: none;
  }
}

/* DESKTOP VIEWPORTS: >= 1024px (1024px, 1366px, 1920px) */
@media (min-width: 1024px) {
  .btn-toggle-sidebar {
    display: flex;
  }

  .btn-mobile-menu-toggle {
    display: none;
  }

  #left-panel {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
  }

  #left-panel.collapsed {
    transform: translateX(-390px);
    visibility: hidden;
    pointer-events: none;
  }

  .mobile-bottom-nav {
    display: none;
  }
}

/* COMPACT HEADER FOR SCREENS UNDER 1440px (1024px, 1366px) */
@media (min-width: 768px) and (max-width: 1440px) {
  .brand-text span {
    display: none;
  }

  .header-actions .btn-icon span {
    display: none;
  }

  .btn-icon {
    padding: 6px 9px;
  }
}

@media (min-width: 768px) and (max-width: 1200px) {
  .mode-switch-container .btn-mode {
    padding: 4px 6px;
    font-size: 11px;
  }

  .lang-switch-container .btn-lang {
    padding: 4px 6px;
    font-size: 11px;
  }

  .btn-gender {
    padding: 4px 8px;
    font-size: 11px;
  }
}
