/* ==========================================================================
   KABBALA TREE OF LIFE - SACRED GEOMETRY DESIGN SYSTEM
   Phong cách huyền bí không gian vũ trụ (Astral Mysticism & Sacred Geometry)
   ========================================================================== */

:root {
  /* Bảng màu Vũ Trụ & Huyền Bí */
  --bg-darkest: #04050a;
  --bg-deep: #070a14;
  --bg-card: rgba(13, 19, 36, 0.72);
  --bg-card-hover: rgba(22, 32, 59, 0.85);
  --bg-card-border: rgba(212, 175, 55, 0.22);
  --bg-card-border-glow: rgba(245, 197, 24, 0.6);

  /* Ánh sáng Kim Cương & Hoàng Kim Thần Thánh */
  --gold-300: #fde047;
  --gold-400: #facc15;
  --gold-500: #eab308;
  --gold-600: #ca8a04;
  --gold-metallic: linear-gradient(135deg, #fef08a 0%, #eab308 50%, #854d0e 100%);
  --gold-glow: 0 0 25px rgba(234, 179, 8, 0.45);

  /* Sắc màu Tam Trụ & Sefirot */
  --pillar-mercy: #38bdf8;
  --pillar-mercy-glow: 0 0 20px rgba(56, 189, 248, 0.5);
  --pillar-severity: #f43f5e;
  --pillar-severity-glow: 0 0 20px rgba(244, 63, 94, 0.5);
  --pillar-middle: #eab308;
  --pillar-middle-glow: 0 0 20px rgba(234, 179, 8, 0.5);

  --accent-cyan: #38bdf8;
  --accent-purple: #a855f7;
  --accent-emerald: #10b981;

  /* Typography - Chuẩn tiếng Việt thanh thoát, sắc nét */
  --font-sacred: 'Cinzel Decorative', 'Cinzel', 'Be Vietnam Pro', serif;
  --font-serif: 'Be Vietnam Pro', 'Cinzel', serif;
  --font-sans: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Shadows & Glassmorphism */
  --glass-blur: blur(20px);
  --box-glow: 0 10px 40px -10px rgba(0, 0, 0, 0.8), 0 0 20px rgba(234, 179, 8, 0.15);
  --transition-smooth: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Nền không gian vũ trụ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-darkest);
  color: #f1f5f9;
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  background-image: 
    radial-gradient(circle at 50% 10%, rgba(234, 179, 8, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 10% 40%, rgba(56, 189, 248, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 90% 60%, rgba(168, 85, 247, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 50% 90%, rgba(16, 185, 129, 0.05) 0%, transparent 60%);
  background-attachment: fixed;
}

/* Mạng lưới hạt sao tinh tú chuyển động mờ */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.35;
  z-index: 0;
}

/* Container chính: Luôn Full Width 100% trên PC, loại bỏ padding/margin 2 bên */
.app-container {
  position: relative;
  z-index: 1;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box;
}

/* ==========================================================================
   HEADER / THANH ĐIỀU HƯỚNG THƯỢNG ĐỈNH (FULL-WIDTH EDGE-TO-EDGE)
   ========================================================================== */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 1rem;
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--bg-card-border);
  border-left: none;
  border-right: none;
  border-radius: 0;
  box-shadow: var(--box-glow);
  margin-bottom: 0.45rem;
  width: 100%;
  box-sizing: border-box;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-symbol {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle, #fde047 0%, #ca8a04 70%, #451a03 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(234, 179, 8, 0.5);
  border: 1.5px solid #fef08a;
  position: relative;
  flex-shrink: 0;
}

.brand-symbol svg {
  width: 26px;
  height: 26px;
  fill: #06070d;
}

.brand-title-wrap h1 {
  font-family: var(--font-sacred);
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  background: var(--gold-metallic);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.brand-title-wrap p {
  font-size: 0.76rem;
  color: #94a3b8;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.btn-header {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.9rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  font-size: 0.82rem;
  font-family: var(--font-sans);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-header:hover {
  background: rgba(234, 179, 8, 0.15);
  border-color: var(--gold-400);
  color: var(--gold-300);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(234, 179, 8, 0.2);
}

.btn-audio.active {
  background: rgba(234, 179, 8, 0.2);
  border-color: var(--gold-400);
  color: var(--gold-300);
  box-shadow: 0 0 16px rgba(234, 179, 8, 0.4);
}

.btn-toggle-sidebar.collapsed-active {
  background: rgba(56, 189, 248, 0.18);
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

/* ==========================================================================
   APP 2-COLUMN LAYOUT: SIDEBAR LEFT & MAIN CONTENT AREA
   ========================================================================== */
.app-body-layout {
  display: flex;
  gap: 0.65rem;
  align-items: stretch;
  width: 100%;
  height: calc(100vh - 66px);
  min-height: 680px;
  overflow: hidden;
  position: relative;
  padding: 0 0.45rem;
  box-sizing: border-box;
  transition: gap 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-panel-left {
  width: 350px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 100%;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, margin 0.3s ease;
}

/* Collapsed Sidebar State */
.app-body-layout.sidebar-collapsed {
  gap: 0;
}

.app-body-layout.sidebar-collapsed .sidebar-panel-left {
  width: 0 !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

.btn-collapse-sidebar {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  border-radius: 8px;
  padding: 0.25rem 0.55rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-collapse-sidebar:hover {
  background: rgba(234, 179, 8, 0.2);
  border-color: var(--gold-400);
  color: var(--gold-300);
}

.floating-expand-sidebar {
  display: none;
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 300;
  align-items: center;
  gap: 0.35rem;
  padding: 0.65rem 0.5rem;
  border-radius: 0 10px 10px 0;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--gold-400);
  border-left: none;
  color: var(--gold-300);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.7), 0 0 12px rgba(234, 179, 8, 0.35);
  backdrop-filter: var(--glass-blur);
  transition: var(--transition-smooth);
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.floating-expand-sidebar:hover {
  background: rgba(234, 179, 8, 0.25);
  transform: translateY(-50%) translateX(3px);
  color: #ffffff;
}

.app-body-layout.sidebar-collapsed .floating-expand-sidebar {
  display: inline-flex;
}

.main-content-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  transition: width 0.3s ease;
}

/* Sidebar cards */
.sidebar-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--bg-card-border);
  border-radius: 16px;
  padding: 1rem 1.15rem;
  box-shadow: var(--box-glow);
}

.sidebar-card.profiles-manager-card {
  position: relative;
  z-index: 50;
  overflow: visible;
}

.sidebar-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-new-profile {
  padding: 0.25rem 0.65rem;
  border-radius: 8px;
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid var(--gold-400);
  color: var(--gold-300);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.btn-new-profile:hover {
  background: var(--gold-500);
  color: #04050a;
  box-shadow: 0 0 12px rgba(234, 179, 8, 0.5);
}

.btn-history-log {
  padding: 0.25rem 0.65rem;
  border-radius: 8px;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #d8b4fe;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.btn-history-log:hover {
  background: rgba(168, 85, 247, 0.35);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.5);
  transform: translateY(-1px);
}

/* Search Box Wrap & Dropdown Listing */
.sidebar-search-box-wrap {
  position: relative;
  width: 100%;
  margin-bottom: 0.75rem;
  z-index: 60;
}

.sidebar-search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(11, 17, 33, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  transition: var(--transition-smooth);
}

.sidebar-search-box:focus-within {
  border-color: var(--gold-400);
  box-shadow: 0 0 12px rgba(234, 179, 8, 0.3);
}

.sidebar-search-box .search-icon {
  margin-left: 10px;
  font-size: 0.82rem;
  color: #94a3b8;
  pointer-events: none;
}

.sidebar-search-input {
  width: 100%;
  padding: 0.5rem 0.5rem 0.5rem 0.6rem;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 0.82rem;
  outline: none;
}

.btn-clear-search {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px 4px;
}

.btn-clear-search:hover {
  color: #ffffff;
}

.btn-toggle-dropdown {
  background: none;
  border: none;
  color: var(--gold-400);
  font-size: 0.72rem;
  cursor: pointer;
  padding: 4px 8px;
  transition: transform 0.2s ease;
}

.btn-toggle-dropdown:hover {
  color: #ffffff;
  transform: scale(1.15);
}

/* Saved Profiles Dropdown Listing (Mặc định ẩn) */
.saved-profiles-dropdown {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  z-index: 350;
  background: #090e1c;
  backdrop-filter: blur(20px);
  border: 1px solid var(--gold-400);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.95), 0 0 25px rgba(234, 179, 8, 0.35);
  max-height: 480px;
  overflow-y: auto;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  animation: popoverFadeIn 0.18s ease-out;
}

.saved-profiles-dropdown::-webkit-scrollbar {
  width: 4px;
}
.saved-profiles-dropdown::-webkit-scrollbar-thumb {
  background: rgba(234, 179, 8, 0.35);
  border-radius: 4px;
}

.dropdown-group-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gold-400);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 0.35rem 0.5rem 0.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 0.3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.profile-tag-badge {
  font-size: 0.62rem;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
}
.profile-tag-badge.preset {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}
.profile-tag-badge.saved {
  background: rgba(234, 179, 8, 0.2);
  color: var(--gold-300);
  border: 1px solid rgba(234, 179, 8, 0.35);
}
.profile-tag-badge.history {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.profile-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.profile-item-card:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(234, 179, 8, 0.4);
  transform: translateX(2px);
}
.profile-item-card.active {
  background: rgba(234, 179, 8, 0.18);
  border-color: var(--gold-400);
  box-shadow: 0 0 12px rgba(234, 179, 8, 0.3);
}

.profile-item-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.profile-avatar-badge {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.25), rgba(56, 189, 248, 0.2));
  border: 1px solid rgba(234, 179, 8, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--gold-300);
  flex-shrink: 0;
}
.profile-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.profile-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-sub {
  font-size: 0.72rem;
  color: #94a3b8;
}
.btn-delete-profile {
  background: none;
  border: none;
  color: #64748b;
  font-size: 0.85rem;
  padding: 4px 6px;
  cursor: pointer;
  border-radius: 4px;
  transition: var(--transition-smooth);
  opacity: 0.6;
}
.btn-delete-profile:hover {
  color: #f43f5e;
  background: rgba(244, 63, 94, 0.12);
  opacity: 1;
}

/* Sidebar form */
.sidebar-calc-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.date-format-tag {
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(234, 179, 8, 0.12);
  color: var(--gold-300);
  font-weight: 700;
  letter-spacing: 0.5px;
}
.field-hint {
  font-size: 0.7rem;
  color: #94a3b8;
  margin-top: 2px;
}
.auto-save-status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.74rem;
  color: #94a3b8;
  margin-top: 0.2rem;
  justify-content: center;
}
.auto-save-status .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
}

/* ==========================================================================
   LEVEL 2 INPUT: COMPACT STREAMLINED CYCLES & TRANSIT CARD
   ========================================================================== */
.compact-cycles-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--bg-card-border);
  border-radius: 14px;
  padding: 0.65rem 0.95rem;
  box-shadow: var(--box-glow);
  margin-bottom: 0.75rem;
  position: relative;
  transition: var(--transition-smooth);
}

.cycles-compact-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0.45rem;
}

.cycles-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cycles-person-tag {
  font-size: 0.8rem;
  color: #cbd5e1;
}

.cycles-age-badge {
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.35);
  color: var(--gold-300);
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.74rem;
}

.btn-cycle-detail-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-cycle-detail-toggle:hover,
.btn-cycle-detail-toggle.active {
  background: rgba(234, 179, 8, 0.18);
  border-color: var(--gold-400);
  color: var(--gold-300);
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.25);
}

.chevron-icon {
  font-size: 0.68rem;
  transition: transform 0.2s ease;
}

/* Compact Shmita Row */
.compact-shmita-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.45rem;
  overflow: hidden;
}

.cycle-track-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94a3b8;
  white-space: nowrap;
  flex-shrink: 0;
}

.shmita-compact-track {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow-x: auto;
  width: 100%;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.shmita-compact-track::-webkit-scrollbar {
  height: 3px;
}
.shmita-compact-track::-webkit-scrollbar-thumb {
  background: rgba(234, 179, 8, 0.25);
  border-radius: 3px;
}

.shmita-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.55rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 0.74rem;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-smooth);
  user-select: none;
  font-family: inherit;
}

.shmita-pill-btn:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(234, 179, 8, 0.4);
  color: #ffffff;
  transform: translateY(-1px);
}

.shmita-pill-btn.current {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  color: #e0f2fe;
}

.shmita-pill-btn.selected {
  border-color: var(--gold-400);
  background: rgba(234, 179, 8, 0.22);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(234, 179, 8, 0.4);
  font-weight: 700;
}

.shmita-pill-age {
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 500;
}

.shmita-pill-btn.selected .shmita-pill-age {
  color: var(--gold-300);
}

.shmita-pill-badge {
  font-size: 0.6rem;
  padding: 1px 4px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
}

/* Compact Sub-Row (4 Olamot + Yearly Transit) */
.compact-sub-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.compact-olamot-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.olamot-compact-track {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.olamot-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.5rem;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  font-size: 0.72rem;
  color: #cbd5e1;
  cursor: pointer;
  transition: var(--transition-smooth);
  font-family: inherit;
}

.olamot-pill-btn:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(56, 189, 248, 0.4);
  color: #ffffff;
}

.olamot-pill-btn.current {
  border-color: #38bdf8;
  color: #38bdf8;
}

.olamot-pill-btn.selected {
  border-color: var(--gold-400);
  background: rgba(234, 179, 8, 0.2);
  color: var(--gold-300);
  font-weight: 700;
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.3);
}

.compact-transit-wrap {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.transit-compact-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.22rem 0.65rem;
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.12) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 1px solid rgba(234, 179, 8, 0.35);
  border-radius: 8px;
  font-size: 0.74rem;
  color: #cbd5e1;
  cursor: pointer;
  transition: var(--transition-smooth);
  user-select: none;
}

.transit-compact-badge:hover {
  border-color: var(--gold-400);
  box-shadow: 0 0 14px rgba(234, 179, 8, 0.35);
  transform: translateY(-1px);
  color: #ffffff;
}

.transit-icon {
  color: var(--gold-400);
}

.transit-pill-highlight {
  color: var(--gold-300);
  font-weight: 700;
}

/* Detail Drawer (Sliding/collapsible dropdown) */
.cycle-detail-drawer {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px dashed rgba(234, 179, 8, 0.3);
  animation: fadeInDown 0.22s ease-out;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
}

.drawer-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold-300);
}

.btn-close-drawer {
  padding: 0.15rem 0.5rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  font-size: 0.7rem;
  color: #cbd5e1;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-close-drawer:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: #f43f5e;
  color: #fff;
}

.drawer-body-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 900px) {
  .drawer-body-grid {
    grid-template-columns: 1fr;
  }
}

.drawer-col {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  font-size: 0.78rem;
  line-height: 1.45;
}

.drawer-col-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--gold-400);
  margin-bottom: 0.35rem;
  letter-spacing: 0.3px;
}

.drawer-text-content {
  color: #cbd5e1;
  font-size: 0.78rem;
}

/* Floating Hover Popover HUD (Ý nghĩa chi tiết khi Hover chu kỳ) */
.cycle-hover-popover {
  position: fixed;
  z-index: 400;
  pointer-events: none;
  background: rgba(11, 17, 33, 0.98);
  backdrop-filter: blur(16px);
  border: 1px solid var(--gold-400);
  border-radius: 12px;
  padding: 0.65rem 0.9rem;
  max-width: 350px;
  min-width: 250px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.85), 0 0 16px rgba(234, 179, 8, 0.35);
  animation: popoverFadeIn 0.15s ease-out;
  line-height: 1.4;
}

@keyframes popoverFadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.popover-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
  gap: 0.5rem;
}

.popover-tag {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gold-400);
  letter-spacing: 0.5px;
}

.popover-hebrew {
  font-family: 'Times New Roman', serif;
  font-size: 0.95rem;
  color: var(--gold-300);
}

.popover-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.popover-theme {
  font-size: 0.73rem;
  color: var(--gold-300);
  margin-bottom: 0.35rem;
  line-height: 1.35;
}

.popover-mission {
  font-size: 0.73rem;
  color: #cbd5e1;
  line-height: 1.4;
}

/* Inspector top bar and close button */
.inspector-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  gap: 0.4rem;
}
.inspector-badge-type {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--gold-300);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}
.btn-close-inspector {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.75rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #e2e8f0;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-close-inspector:hover {
  background: rgba(234, 179, 8, 0.2);
  border-color: var(--gold-400);
  color: var(--gold-300);
  transform: translateY(-1px);
}

.inspector-connected-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.connected-pill {
  padding: 0.3rem 0.65rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  font-size: 0.75rem;
  color: #cbd5e1;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.connected-pill:hover {
  background: rgba(234, 179, 8, 0.15);
  border-color: var(--gold-400);
  color: #ffffff;
}

.card-title-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
  color: var(--gold-400);
  margin-bottom: 0.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.form-group label {
  font-size: 0.78rem;
  color: #cbd5e1;
  font-weight: 600;
  letter-spacing: 0.4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.form-input, .form-select {
  padding: 0.6rem 0.85rem;
  background: rgba(11, 17, 33, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  transition: var(--transition-smooth);
  outline: none;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  height: 42px;
}

.form-select {
  text-overflow: ellipsis;
}

.form-input:focus, .form-select:focus {
  border-color: var(--gold-400);
  box-shadow: 0 0 15px rgba(234, 179, 8, 0.35);
  background: rgba(15, 23, 42, 0.98);
}

.btn-calculate {
  padding: 0 1.5rem;
  height: 42px;
  background: var(--gold-metallic);
  border: none;
  border-radius: 10px;
  color: #05060b;
  font-family: var(--font-serif);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 0 18px rgba(234, 179, 8, 0.45);
  transition: var(--transition-smooth);
  white-space: nowrap;
  flex-shrink: 0;
  overflow: visible;
  position: relative;
  z-index: 2;
}

.btn-calculate:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 28px rgba(234, 179, 8, 0.75);
}

/* ==========================================================================
   MAIN TABS NAVIGATION (RESPONSIVE SEGMENTED CONTROL WITH HORIZONTAL SCROLL)
   ========================================================================== */
.main-tabs-nav {
  display: flex;
  gap: 0.35rem;
  margin: 0 0 0.55rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2px 2px 0.45rem 2px;
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(234, 179, 8, 0.25) transparent;
  -webkit-overflow-scrolling: touch;
}

.main-tabs-nav::-webkit-scrollbar {
  height: 3px;
}
.main-tabs-nav::-webkit-scrollbar-thumb {
  background: rgba(234, 179, 8, 0.3);
  border-radius: 3px;
}

.main-tab-btn {
  flex: 1 0 auto;
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.42rem 0.65rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #94a3b8;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-sizing: border-box;
  white-space: nowrap;
}

.main-tab-btn .tab-icon {
  font-size: 0.9rem;
  flex-shrink: 0;
}

.main-tab-btn .tab-title {
  white-space: nowrap;
}

.main-tab-btn:hover {
  color: #f8fafc;
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.main-tab-btn.active {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.2) 0%, rgba(202, 138, 4, 0.1) 100%);
  border-color: var(--gold-400);
  color: var(--gold-300);
  box-shadow: 0 0 16px rgba(234, 179, 8, 0.25);
}


.tab-badge-new {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: #0284c7;
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeInPanel 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInPanel {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   MASTER 2-COLUMN WORKSPACE: INTERACTIVE TREE & CONTENT TABS
   ========================================================================== */
.main-content-area.master-workspace-split {
  display: flex;
  flex-direction: row;
  gap: 0.85rem;
  align-items: stretch;
  width: 100%;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

/* 
  PHẦN NỘI DUNG (CÁC TAB -> NỘI DUNG TAB):
  Mặc định nằm ở BÊN PHẢI (order: 2), chiếm trọn toàn bộ chiều ngang mở rộng còn lại (~65% - 75%).
*/
.master-content-col {
  order: 2;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  box-sizing: border-box;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.master-content-col .main-tabs-nav {
  flex-shrink: 0;
  margin-top: 0;
  margin-bottom: 0.45rem;
}

/* Sidebar Compact Cycle Card (Đầu Vào Cấp 2 trong Panel Trái) */
.sidebar-panel-left .compact-cycles-card {
  padding: 0.8rem 0.95rem;
  margin-bottom: 0.25rem;
}

.sidebar-panel-left .cycles-compact-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0.5rem;
}

.sidebar-panel-left .cycles-header-left {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.sidebar-panel-left .compact-shmita-bar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
  overflow: visible;
}

.sidebar-panel-left .shmita-compact-track {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.35rem;
  width: 100%;
  overflow: visible;
  padding-bottom: 0;
}

.sidebar-panel-left .shmita-pill-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.25rem;
  padding: 0.32rem 0.45rem;
  width: 100%;
  font-size: 0.72rem;
  box-sizing: border-box;
  text-align: left;
}

.sidebar-panel-left .shmita-pill-age {
  font-size: 0.65rem;
  color: #94a3b8;
  flex-shrink: 0;
}

.sidebar-panel-left .shmita-pill-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.sidebar-panel-left .shmita-pill-badge {
  font-size: 0.58rem;
  padding: 1px 4px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  margin-left: auto;
  flex-shrink: 0;
}

.sidebar-panel-left .compact-sub-row {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.sidebar-panel-left .compact-olamot-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  width: 100%;
}

.sidebar-panel-left .olamot-compact-track {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.35rem;
  width: 100%;
}

.sidebar-panel-left .olamot-pill-btn {
  justify-content: center;
  padding: 0.3rem 0.4rem;
  font-size: 0.72rem;
}

.sidebar-panel-left .compact-transit-wrap {
  width: 100%;
  margin-left: 0;
}

.sidebar-panel-left .transit-compact-badge {
  width: 100%;
  justify-content: center;
  padding: 0.35rem 0.6rem;
  box-sizing: border-box;
}

/* ==========================================================================
   GIAI ĐOẠN ĐANG CHỌN & LUẬN GIẢI CHU KỲ (STAGE & TRANSIT CARD IN CONTENT)
   ========================================================================== */
.cycle-stage-content-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--bg-card-border);
  border-left: 4px solid var(--gold-400);
  border-radius: 14px;
  padding: 0.8rem 1.05rem;
  box-shadow: var(--box-glow);
  margin-bottom: 0.85rem;
  transition: var(--transition-smooth);
}

.stage-content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0.6rem;
}

.stage-content-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.stage-content-title {
  font-family: var(--font-serif);
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--gold-300);
  margin: 0;
}

.transit-content-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.22rem 0.65rem;
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.15) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 1px solid rgba(234, 179, 8, 0.35);
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 600;
  color: #f8fafc;
}

.stage-content-body-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.stage-content-col.col-hd {
  border-color: rgba(56, 189, 248, 0.25);
  background: rgba(14, 165, 233, 0.04);
}

.stage-content-col.col-gk {
  border-color: rgba(74, 222, 128, 0.25);
  background: rgba(34, 197, 94, 0.04);
}

.stage-content-col.col-chakra {
  border-color: rgba(234, 179, 8, 0.25);
  background: rgba(234, 179, 8, 0.04);
}

.stage-content-col {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
}

.stage-col-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gold-400);
  letter-spacing: 0.4px;
  margin-bottom: 0.35rem;
}

.stage-col-text {
  font-size: 0.78rem;
  line-height: 1.5;
  color: #cbd5e1;
}

.master-tab-viewport {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  display: flex;
  flex-direction: column;
}

.master-tab-viewport::-webkit-scrollbar {
  width: 5px;
}
.master-tab-viewport::-webkit-scrollbar-thumb {
  background: rgba(234, 179, 8, 0.25);
  border-radius: 4px;
}

/* 
  CỘT BẢN ĐỒ CÂY SỰ SỐNG (INTERACTIVE TREE OF LIFE):
  - Mặc định ở BÊN TRÁI (order: 1).
  - Chiều ngang tăng >10% theo yêu cầu (480px - 620px, min 460px),
    giúp cây hiển thị to rõ, khoáng đạt, các điểm tụ nổi bật.
*/
.master-tree-col {
  order: 1;
  flex: 0 0 clamp(380px, 35vw, 680px);
  width: clamp(380px, 35vw, 680px);
  min-width: 320px;
  max-width: 720px;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  transition: transform 0.25s ease, opacity 0.2s ease, width 0.3s ease, flex 0.3s ease;
}

.app-body-layout.sidebar-collapsed .master-tree-col {
  flex: 0 0 clamp(420px, 38vw, 800px);
  width: clamp(420px, 38vw, 800px);
  max-width: 820px;
}

/* KHI ĐẢO VỊ TRÍ: NỘI DUNG Ở BÊN TRÁI (order: 1), CÂY SỰ SỐNG Ở BÊN PHẢI (order: 2) */
.master-workspace-split.tree-on-right .master-content-col {
  order: 1;
}

.master-workspace-split.tree-on-right .master-tree-col {
  order: 2;
}

/* NÚT ĐẢO VỊ TRÍ CÂY SỰ SỐNG (TRÁI / PHẢI) TRÊN TOP PANEL */
.btn-swap-layout-header {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #38bdf8;
  border-radius: 8px;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-swap-layout-header:hover {
  background: rgba(56, 189, 248, 0.28);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
  transform: translateY(-1px);
}

.btn-swap-layout-header.active-right {
  background: rgba(234, 179, 8, 0.18);
  border-color: rgba(234, 179, 8, 0.55);
  color: var(--gold-300);
  box-shadow: 0 0 14px rgba(234, 179, 8, 0.25);
}

.swap-icon {
  font-size: 0.95rem;
  font-weight: 700;
  display: inline-block;
  transition: transform 0.3s ease;
}

.btn-swap-layout-header:hover .swap-icon {
  transform: rotate(180deg);
}

.tree-visualizer-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--bg-card-border);
  border-radius: 16px;
  box-shadow: var(--box-glow);
  padding: 0.4rem 0.65rem;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.tree-card-header {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.35rem;
  flex-shrink: 0;
  width: 100%;
}

.tree-header-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.tree-header-top-row h2 {
  font-family: var(--font-serif);
  font-size: clamp(0.85rem, 1.1vw, 1.02rem);
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  min-width: 0;
  flex: 1 1 auto;
}

.tree-header-top-row h2 #visualizerTitleText {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.active-stage-status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.3);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--gold-300);
  white-space: nowrap;
  flex-shrink: 0;
}

.status-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #facc15;
  box-shadow: 0 0 8px #facc15;
  animation: pulseHalo 1.8s infinite;
}

.btn-reset-year {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  color: #f8fafc;
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-reset-year:hover {
  background: rgba(234, 179, 8, 0.3);
  border-color: var(--gold-400);
  color: var(--gold-200);
}

.filter-toolbar {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
  flex-shrink: 0;
  white-space: nowrap;
}

.filter-btn {
  padding: 0.22rem 0.55rem;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #94a3b8;
  font-size: 0.73rem;
  font-family: var(--font-sans);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
  white-space: nowrap;
}

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

.filter-btn.active {
  background: rgba(234, 179, 8, 0.25);
  color: var(--gold-300);
  font-weight: 600;
}

.tree-viewport-container {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 50%, #0d1326 0%, #060913 85%, #020306 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow-y: auto !important;
  overflow-x: hidden !important;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  scrollbar-width: thin;
  scrollbar-color: rgba(234, 179, 8, 0.35) rgba(15, 23, 42, 0.6);
  -webkit-overflow-scrolling: touch;
}

.tree-viewport-container::-webkit-scrollbar {
  width: 6px;
}
.tree-viewport-container::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 4px;
}
.tree-viewport-container::-webkit-scrollbar-thumb {
  background: rgba(234, 179, 8, 0.35);
  border-radius: 4px;
}
.tree-viewport-container::-webkit-scrollbar-thumb:hover {
  background: var(--gold-400);
}

.tree-viewport-container svg {
  width: 100%;
  height: 100%;
  min-height: 620px;
  flex-shrink: 0;
  display: block;
}

.tree-viewport-container canvas {
  width: 100%;
  height: 100%;
  min-height: 620px;
}

.tree-sub-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.45rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 0.4rem;
}

@media (max-width: 1024px) {
  .main-content-area.master-workspace-split {
    flex-direction: column;
    height: auto;
    max-height: none;
    overflow: visible;
    gap: 0.75rem;
  }
  .master-content-col {
    width: 100%;
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .master-tab-viewport {
    height: auto;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
  .master-tree-col,
  .app-body-layout.sidebar-collapsed .master-tree-col {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
    height: clamp(380px, 55vh, 560px);
  }
}

.tree-sliders-group {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.tree-slider-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.76rem;
  color: #94a3b8;
}

.tree-slider-item .slider-label {
  font-weight: 500;
  white-space: nowrap;
}

.tree-slider-item input[type="range"] {
  cursor: pointer;
  width: 72px;
  height: 4px;
  border-radius: 2px;
}

.scale-control input[type="range"] {
  accent-color: #38bdf8;
}

.speed-control input[type="range"] {
  accent-color: var(--gold-400);
}

.slider-val {
  min-width: 28px;
  color: #e2e8f0;
  font-weight: 600;
  font-family: var(--font-sans);
  font-size: 0.74rem;
}

.tree-legend-pills {
  display: flex;
  gap: 0.7rem;
}

.legend-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  color: #94a3b8;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.legend-dot.mercy { background: var(--pillar-mercy); box-shadow: 0 0 6px var(--pillar-mercy); }
.legend-dot.severity { background: var(--pillar-severity); box-shadow: 0 0 6px var(--pillar-severity); }
.legend-dot.middle { background: var(--pillar-middle); box-shadow: 0 0 6px var(--pillar-middle); }

/* ==========================================================================
   BẢNG THÔNG TIN PHÂN TÍCH & ĐIỂM TỤ (BÊN PHẢI)
   ========================================================================== */
.analytics-panel {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* 1. Các thẻ chỉ số chính (Primary Metrics Grid) */
.primary-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.metric-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold-400);
  box-shadow: 0 6px 20px rgba(234, 179, 8, 0.2);
}

.metric-card.destiny { border-left: 4px solid var(--gold-400); }
.metric-card.soul { border-left: 4px solid var(--accent-purple); }
.metric-card.personality { border-left: 4px solid var(--accent-cyan); }
.metric-card.tikkun { border-left: 4px solid var(--pillar-severity); }

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.metric-tag {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  color: #94a3b8;
}

.metric-hebrew {
  font-family: 'Times New Roman', serif;
  font-size: 1.15rem;
  font-weight: bold;
  color: var(--gold-300);
}

.metric-value-title {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.1rem;
  line-height: 1.25;
}

.metric-sub-english {
  font-size: 0.74rem;
  color: #94a3b8;
  font-style: italic;
  margin-bottom: 0.25rem;
  letter-spacing: 0.2px;
}

.metric-desc {
  font-size: 0.76rem;
  color: #cbd5e1;
  line-height: 1.4;
}

.inspector-sub-english {
  font-size: 0.8rem;
  color: #94a3b8;
  font-style: italic;
  margin-top: 2px;
  margin-bottom: 4px;
  letter-spacing: 0.2px;
}

.sub-english {
  font-size: 0.74rem;
  color: #94a3b8;
  font-style: italic;
  letter-spacing: 0.2px;
}

/* 2. Thẻ Điểm Tụ Năng Lượng (Energy Confluence Vortexes) */
.focal-points-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--bg-card-border);
  border-radius: 16px;
  padding: 0.95rem 1.15rem;
  box-shadow: var(--box-glow);
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.focal-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.focal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.9rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  transition: var(--transition-smooth);
}

.focal-item:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: var(--gold-400);
  transform: translateX(3px);
}

.focal-left {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.focal-rank-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
}

.focal-rank-1 {
  background: radial-gradient(circle, #fde047, #ca8a04);
  color: #06070d;
  box-shadow: 0 0 15px rgba(234, 179, 8, 0.6);
}

.focal-rank-2 {
  background: radial-gradient(circle, #7dd3fc, #0284c7);
  color: #06070d;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.5);
}

.focal-rank-3 {
  background: radial-gradient(circle, #c084fc, #7e22ce);
  color: #06070d;
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.5);
}

.focal-info h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
}

.focal-info p {
  font-size: 0.74rem;
  color: #94a3b8;
}

.focal-energy-val {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--gold-300);
}

/* 3. Thẻ Cân Bằng Tam Trụ (Pillars Balance) */
.pillars-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--bg-card-border);
  border-radius: 16px;
  padding: 0.95rem 1.15rem;
  box-shadow: var(--box-glow);
}

.pillars-bars-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.pillar-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.pillar-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
}

.pillar-name {
  font-weight: 600;
  color: #e2e8f0;
}

.pillar-pct {
  font-weight: 700;
}

.pillar-progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.pillar-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.pillar-progress-fill.mercy { background: linear-gradient(90deg, #38bdf8, #818cf8); }
.pillar-progress-fill.severity { background: linear-gradient(90deg, #f43f5e, #fb7185); }
.pillar-progress-fill.middle { background: linear-gradient(90deg, #eab308, #fde047); }

.pillar-interpretation {
  font-size: 0.8rem;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.6);
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  border-left: 3px solid var(--gold-400);
}

/* 4. Thẻ Chi Tiết Node / Path được chọn (Interactive Inspector) */
.inspector-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--bg-card-border-glow);
  border-radius: 16px;
  padding: 0.95rem 1.15rem;
  box-shadow: 0 0 25px rgba(234, 179, 8, 0.18);
  transition: var(--transition-smooth);
}

.inspector-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.inspector-titles h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
}

.inspector-titles p {
  font-size: 0.8rem;
  color: var(--gold-300);
}

.inspector-hebrew-big {
  font-family: 'Times New Roman', serif;
  font-size: 1.8rem;
  font-weight: bold;
  color: #ffffff;
  line-height: 1;
}

.inspector-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.inspector-prop {
  background: rgba(15, 23, 42, 0.6);
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.prop-lbl {
  font-size: 0.68rem;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.prop-val {
  font-size: 0.82rem;
  font-weight: 600;
  color: #f1f5f9;
}

.inspector-lore {
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.5;
}

/* ==========================================================================
   REST API LIVE CONSOLE / TESTER DRAWER
   ========================================================================== */
.api-console-section {
  margin-top: 1.8rem;
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--bg-card-border);
  border-radius: 18px;
  padding: 1.25rem 1.5rem;
  box-shadow: var(--box-glow);
}

.api-console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.api-endpoints-nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.endpoint-btn {
  padding: 0.35rem 0.85rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #cbd5e1;
  font-family: monospace;
  font-size: 0.78rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.endpoint-btn:hover, .endpoint-btn.active {
  background: rgba(234, 179, 8, 0.18);
  border-color: var(--gold-400);
  color: var(--gold-300);
}

.api-terminal-box {
  background: #020408;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.8rem;
  color: #38bdf8;
  max-height: 350px;
  overflow-y: auto;
}

.api-terminal-box pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ==========================================================================
   KEYFRAME ANIMATIONS
   ========================================================================== */
@keyframes spinAuraDash {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -120; }
}

.spinning-aura {
  animation: spinAuraDash 9s linear infinite;
  pointer-events: none;
}

@keyframes pulseHalo {
  0% { transform: scale(1); opacity: 0.25; }
  50% { transform: scale(1.12); opacity: 0.45; }
  100% { transform: scale(1); opacity: 0.25; }
}

.pulsing-halo {
  animation: pulseHalo 4s ease-in-out infinite;
}

/* ==========================================================================
   LIFE CYCLES & TRANSIT DASHBOARD STYLES
   ========================================================================== */
.life-cycles-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--bg-card-border);
  border-radius: 16px;
  padding: 0.95rem 1.15rem;
  box-shadow: var(--box-glow);
}

.shmita-timeline-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin: 0.65rem 0;
}

@media (max-width: 900px) {
  .shmita-timeline-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.shmita-step-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.5rem 0.45rem;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all 0.25s ease;
  user-select: none;
}

.shmita-step-card:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(234, 179, 8, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.shmita-step-card.active-current {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.25);
}

.shmita-step-card.selected-stage {
  border-color: var(--gold-400);
  background: rgba(234, 179, 8, 0.18);
  box-shadow: 0 0 20px rgba(234, 179, 8, 0.45);
  transform: translateY(-2px);
}

.shmita-card-badge {
  position: absolute;
  top: -6px;
  right: 6px;
  background: #0284c7;
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.shmita-step-card.selected-stage .shmita-card-badge {
  background: var(--gold-500);
  color: #0b0f19;
}

.shmita-age-tag {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 600;
}

.shmita-step-card.selected-stage .shmita-age-tag {
  color: var(--gold-300);
}

.shmita-sef-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-top: 2px;
  line-height: 1.25;
}

.shmita-sef-hebrew {
  font-family: 'Times New Roman', serif;
  font-size: 0.92rem;
  color: var(--gold-300);
  margin-top: 2px;
}

.shmita-sef-sub {
  font-size: 0.68rem;
  color: #94a3b8;
  margin-top: 3px;
  line-height: 1.2;
}

.olamot-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem;
  margin-top: 0.6rem;
}

.olamot-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.olamot-card:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-2px);
}

.olamot-card.active {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.12);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.25);
}

.olamot-card.selected-epoch {
  border-color: var(--gold-400);
  background: rgba(234, 179, 8, 0.18);
  box-shadow: 0 0 18px rgba(234, 179, 8, 0.35);
}

.yearly-transit-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(20, 28, 54, 0.85) 100%);
  border: 1px solid var(--gold-400);
  border-radius: 14px;
  padding: 0.85rem 1.1rem;
  margin-top: 0.75rem;
}

/* ==========================================================================
   TIMELINE CHARTS DASHBOARD STYLES
   ========================================================================== */
.timeline-dashboard-card, .phonetics-dashboard-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--bg-card-border);
  border-radius: 18px;
  box-shadow: var(--box-glow);
  padding: 1.15rem 1.4rem;
  position: relative;
}

.timeline-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 1.1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.timeline-title-group h2 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: #f8fafc;
  margin-top: 0.25rem;
}

.timeline-instruction {
  font-size: 0.82rem;
  color: #94a3b8;
  max-width: 650px;
  margin-top: 0.25rem;
  line-height: 1.45;
}

.timeline-selectors-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.selector-unit {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.control-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.scope-btn-group {
  display: flex;
  gap: 0.3rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 3px;
}

.scope-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  background: transparent;
  border: none;
  border-radius: 7px;
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.scope-btn:hover {
  color: #f8fafc;
}

.scope-btn.active {
  background: rgba(234, 179, 8, 0.22);
  color: var(--gold-300);
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.3);
}

.timeline-select {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9px;
  padding: 0.45rem 0.8rem;
  color: #f8fafc;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: var(--transition-smooth);
}

.timeline-select:focus {
  border-color: var(--gold-400);
  box-shadow: 0 0 12px rgba(234, 179, 8, 0.25);
}

.timeline-charts-grid {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.chart-box {
  background: rgba(11, 17, 33, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.4);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.chart-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.chart-icon {
  font-size: 1.3rem;
}

.chart-title h3 {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: #f8fafc;
  margin: 0;
}

.chart-sub {
  font-size: 0.74rem;
  color: #94a3b8;
}

.chart-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  color: #cbd5e1;
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.canvas-wrapper {
  position: relative;
  width: 100%;
  height: 250px;
}

.canvas-wrapper canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

/* Floating Tooltip HUD for Charts */
.timeline-hud-tooltip {
  position: fixed;
  z-index: 500;
  pointer-events: none;
  background: rgba(9, 14, 28, 0.96);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(234, 179, 8, 0.4);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.85), 0 0 24px rgba(234, 179, 8, 0.2);
  color: #f8fafc;
  font-size: 0.8rem;
  width: 320px;
  max-width: 360px;
  line-height: 1.45;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.hud-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.35rem;
  margin-bottom: 0.4rem;
}

.hud-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--gold-300);
}

.hud-subtitle {
  font-size: 0.72rem;
  color: #94a3b8;
}

.hud-section-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  margin-top: 0.4rem;
}

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

.hud-box-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--gold-300);
}

.hud-badge {
  font-size: 0.66rem;
  padding: 2px 6px;
  border-radius: 999px;
  font-weight: 700;
  text-transform: uppercase;
}

.hud-badge.middle {
  background: rgba(234, 179, 8, 0.15);
  color: #fde047;
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.hud-badge.solfeggio {
  background: rgba(192, 132, 252, 0.15);
  color: #c084fc;
  border: 1px solid rgba(192, 132, 252, 0.3);
}

.hud-pillar-mini-bars {
  display: flex;
  justify-content: space-between;
  gap: 0.35rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  margin-bottom: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
}

.hud-box-desc {
  font-size: 0.72rem;
  color: #cbd5e1;
  line-height: 1.35;
}

.hud-solfeggio-note {
  margin-top: 0.25rem;
  font-size: 0.7rem;
  color: #d8b4fe;
  background: rgba(168, 85, 247, 0.08);
  padding: 0.2rem 0.45rem;
  border-radius: 5px;
  border-left: 2px solid #a855f7;
}

.hud-footer-hint {
  margin-top: 0.45rem;
  padding-top: 0.35rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  font-size: 0.7rem;
  color: var(--gold-300);
  text-align: center;
  font-style: italic;
}

/* ==========================================================================
   VIETNAMESE PHONETIC BREAKDOWN TAGS
   ========================================================================== */
.phonetic-words-container {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.65rem;
}

.phonetic-word-card {
  background: rgba(11, 17, 33, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
}

.phonetic-word-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.phonetic-tokens-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.phonetic-token-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 0.15rem 0.45rem;
  font-size: 0.74rem;
}

.phonetic-token-tag.vowel {
  border-color: var(--accent-purple);
  color: #e9d5ff;
}

.phonetic-token-tag.tone {
  border-color: var(--gold-400);
  color: #fef08a;
}

/* ==========================================================================
   DOCUMENTATION MODAL & READER
   ========================================================================== */
.docs-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 6, 12, 0.85);
  backdrop-filter: blur(16px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.docs-modal-overlay.active {
  display: flex;
  animation: hudAppear 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* History Log Modal Styles */
.history-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 6, 12, 0.85);
  backdrop-filter: blur(16px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: hudAppear 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.history-modal-container {
  width: 100%;
  max-width: 900px;
  max-height: 85vh;
  background: #090e1c;
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), 0 0 35px rgba(168, 85, 247, 0.25);
}

.history-modal-header {
  padding: 1.25rem 1.5rem;
  background: #060913;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.history-modal-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.history-modal-title .icon {
  font-size: 1.5rem;
}
.history-modal-title h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: #e2e8f0;
  letter-spacing: 0.5px;
}
.history-modal-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  color: #94a3b8;
}
.history-modal-subtitle code {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(168, 85, 247, 0.3);
  font-family: monospace;
}

.history-modal-toolbar {
  padding: 0.85rem 1.5rem;
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.history-search-wrap {
  flex: 1;
  min-width: 240px;
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(11, 17, 33, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
}
.history-search-wrap:focus-within {
  border-color: #c084fc;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}
.history-search-input {
  width: 100%;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 0.82rem;
  outline: none;
  margin-left: 0.4rem;
}

.history-toolbar-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.btn-tool-action {
  padding: 0.42rem 0.85rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  text-decoration: none;
  transition: var(--transition-smooth);
}
.btn-tool-action:hover {
  background: rgba(51, 65, 85, 0.9);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}
.btn-tool-action.btn-download {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}
.btn-tool-action.btn-download:hover {
  background: rgba(56, 189, 248, 0.3);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}
.btn-tool-action.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}
.btn-tool-action.btn-danger:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.history-stats-bar {
  padding: 0.4rem 1.5rem;
  background: #060913;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  gap: 1.5rem;
  font-size: 0.72rem;
  color: #94a3b8;
}

.history-log-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.history-log-list::-webkit-scrollbar {
  width: 6px;
}
.history-log-list::-webkit-scrollbar-thumb {
  background: rgba(168, 85, 247, 0.3);
  border-radius: 6px;
}

.history-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  transition: var(--transition-smooth);
}
.history-item-card:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(168, 85, 247, 0.45);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

.history-item-left {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}
.history-avatar-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.3), rgba(56, 189, 248, 0.25));
  border: 1px solid rgba(168, 85, 247, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  font-weight: 700;
  color: #e9d5ff;
  flex-shrink: 0;
}

.history-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.history-name-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.history-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-viewed-time {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(168, 85, 247, 0.18);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.3);
  font-weight: 600;
}
.history-details {
  font-size: 0.76rem;
  color: #94a3b8;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.history-details span {
  display: inline-flex;
  align-items: center;
}

.btn-load-history {
  padding: 0.45rem 0.95rem;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(56, 189, 248, 0.25));
  border: 1px solid rgba(168, 85, 247, 0.5);
  color: #f3e8ff;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
  flex-shrink: 0;
}
.btn-load-history:hover {
  background: linear-gradient(135deg, #a855f7, #38bdf8);
  color: #04060c;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.6);
  transform: scale(1.03);
}

.docs-modal-container {
  width: 100%;
  max-width: 1200px;
  height: 88vh;
  background: #090e1c;
  border: 1px solid var(--bg-card-border-glow);
  border-radius: 20px;
  display: grid;
  grid-template-columns: 290px 1fr;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 35px rgba(234, 179, 8, 0.2);
}

.docs-modal-sidebar {
  background: #060913;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
}

.docs-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.docs-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
  overflow-y: auto;
}

.docs-nav-item {
  padding: 0.65rem 0.85rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #cbd5e1;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.docs-nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.docs-nav-item.active {
  background: rgba(234, 179, 8, 0.15);
  border-color: var(--gold-400);
  color: var(--gold-300);
  font-weight: 700;
}

.docs-modal-reader {
  padding: 1.5rem 1.8rem;
  overflow-y: auto;
  color: #e2e8f0;
  line-height: 1.7;
}

.docs-modal-reader h1, .docs-modal-reader h2, .docs-modal-reader h3 {
  color: #ffffff;
  margin-top: 1.2rem;
  margin-bottom: 0.6rem;
}

.docs-modal-reader h1 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--gold-300);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 0.5rem;
}

.docs-modal-reader h2 {
  font-size: 1.2rem;
  color: #38bdf8;
}

.docs-modal-reader table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.84rem;
}

.docs-modal-reader th, .docs-modal-reader td {
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.5rem 0.7rem;
  text-align: left;
}

.docs-modal-reader th {
  background: rgba(15, 23, 42, 0.8);
  color: var(--gold-300);
}

.docs-modal-reader code {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-family: monospace;
  color: #fde047;
}

.docs-modal-reader pre {
  background: #04060b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  overflow-x: auto;
  margin: 0.85rem 0;
}

.btn-close-modal {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #ffffff;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition-smooth);
}

.btn-close-modal:hover {
  background: rgba(244, 63, 94, 0.3);
  border-color: #f43f5e;
}

/* ==========================================================================
   HOLISTIC PROFILE CARD (ĐỒNG HÓA TÂM THỨC TOÀN DIỆN)
   ========================================================================== */
.holistic-profile-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(20, 16, 36, 0.95) 100%);
  border: 1px solid rgba(234, 179, 8, 0.35);
  border-radius: 16px;
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 25px rgba(234, 179, 8, 0.12);
  position: relative;
  overflow: hidden;
}

.holistic-profile-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #38bdf8, #eab308, #a855f7);
}

.holistic-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.holistic-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.holistic-symbol {
  font-size: 2rem;
  color: var(--gold-400);
  filter: drop-shadow(0 0 8px rgba(234, 179, 8, 0.5));
  line-height: 1;
}

.holistic-sup-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #38bdf8;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.holistic-archetype-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #f8fafc;
  margin: 0;
  letter-spacing: 0.3px;
}

.holistic-archetype-sub {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 0.2rem;
}

.holistic-header-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.holistic-badge-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.4);
  color: var(--gold-300);
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.15);
}

.holistic-badge-pill.resonance {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.15);
}

.holistic-summary-text {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  border-left: 3px solid var(--gold-400);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  line-height: 1.55;
  color: #e2e8f0;
  margin-bottom: 1.15rem;
}

#holisticProfileCard,
#hdHeroCard,
#gkHeroCard,
#chakraHolisticCard,
.holistic-profile-card,
.hd-hero-card,
.gk-hero-card,
.chakra-holistic-card {
  container-type: inline-size;
  container-name: holisticCard;
}

.holistic-triad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-top: 0.5rem;
}

/* Tự động chuyển thành 1 cột (tách row full-width) khi chiều ngang panel dưới 850px */
@container (max-width: 850px) {
  .holistic-triad-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }
}

@media (max-width: 1024px) {
  .holistic-triad-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }
}

.holistic-unit {
  position: relative;
  background: linear-gradient(175deg, rgba(20, 27, 45, 0.72) 0%, rgba(11, 15, 25, 0.88) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.45);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  overflow: hidden;
}

/* Subtle top glow strip on each card */
.holistic-unit::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  opacity: 0.85;
  transition: opacity 0.25s ease;
}

/* Unit 1: Concordance - Sapphire / Cyan Aura */
.holistic-unit.unit-concordance {
  border-color: rgba(56, 189, 248, 0.2);
}
.holistic-unit.unit-concordance::before {
  background: linear-gradient(90deg, #38bdf8, #818cf8);
}
.holistic-unit.unit-concordance:hover {
  transform: translateY(-3px);
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 12px 32px -8px rgba(56, 189, 248, 0.22), 0 0 0 1px rgba(56, 189, 248, 0.3);
}

/* Unit 2: Tikkun - Ruby / Rose Aura */
.holistic-unit.unit-tikkun {
  border-color: rgba(244, 63, 94, 0.22);
}
.holistic-unit.unit-tikkun::before {
  background: linear-gradient(90deg, #f43f5e, #c084fc);
}
.holistic-unit.unit-tikkun:hover {
  transform: translateY(-3px);
  border-color: rgba(244, 63, 94, 0.45);
  box-shadow: 0 12px 32px -8px rgba(244, 63, 94, 0.22), 0 0 0 1px rgba(244, 63, 94, 0.35);
}

/* Unit 3: Strategy - Amber / Gold Aura */
.holistic-unit.unit-strategy {
  border-color: rgba(234, 179, 8, 0.22);
}
.holistic-unit.unit-strategy::before {
  background: linear-gradient(90deg, #eab308, #fb923c);
}
.holistic-unit.unit-strategy:hover {
  transform: translateY(-3px);
  border-color: rgba(234, 179, 8, 0.45);
  box-shadow: 0 12px 32px -8px rgba(234, 179, 8, 0.22), 0 0 0 1px rgba(234, 179, 8, 0.35);
}

/* Top Header Bar */
.unit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.unit-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.unit-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.unit-concordance .unit-icon {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.3);
}
.unit-tikkun .unit-icon {
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(244, 63, 94, 0.3);
}
.unit-strategy .unit-icon {
  background: rgba(234, 179, 8, 0.14);
  border-color: rgba(234, 179, 8, 0.3);
}

/* Badge/Pill Top Right */
.unit-level {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
  white-space: nowrap;
  flex-shrink: 0;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.12);
  letter-spacing: 0.2px;
}

.unit-level.warning {
  background: rgba(244, 63, 94, 0.12);
  color: #fb7185;
  border-color: rgba(244, 63, 94, 0.4);
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.12);
}

.unit-level.gold {
  background: rgba(234, 179, 8, 0.12);
  color: var(--gold-300);
  border-color: rgba(234, 179, 8, 0.4);
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.12);
}

/* Status / Highlight Section - STACKED IN ROWS TO PREVENT HORIZONTAL SQUEEZING */
.unit-status-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: 0.2rem;
  margin-bottom: 0.25rem;
}

.unit-score {
  font-size: 1.18rem;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.2px;
  line-height: 1.35;
  width: 100%;
}

/* Biến số phần trăm lớn nổi bật cho Unit 1 */
#concordanceScore.unit-score {
  font-size: 1.6rem;
  font-weight: 900;
  background: linear-gradient(135deg, #ffffff 30%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

.unit-score-hint {
  font-size: 0.73rem;
  color: #94a3b8;
  font-style: italic;
  display: block;
  width: 100%;
}

/* Paragraph Description */
.unit-desc {
  font-size: 0.81rem;
  color: #cbd5e1;
  line-height: 1.6;
  flex-grow: 1;
}

/* Bottom Insight Callout Box */
.unit-key {
  margin-top: auto;
  font-size: 0.76rem;
  line-height: 1.55;
  color: #e2e8f0;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  padding: 0.7rem 0.9rem;
  position: relative;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.unit-concordance .unit-key {
  border-left: 3px solid #38bdf8;
  background: rgba(14, 28, 48, 0.5);
}

.unit-tikkun .unit-key {
  border-left: 3px solid #f43f5e;
  background: rgba(38, 18, 30, 0.5);
}

.unit-strategy .unit-key {
  border-left: 3px solid #eab308;
  background: rgba(36, 28, 12, 0.5);
}

.unit-key strong {
  color: var(--gold-300);
  font-weight: 700;
  display: inline-block;
  margin-right: 4px;
}

/* ==========================================================================
   TIMELINE MILESTONE INSIGHT CARD (LUẬN GIẢI MỐC THỜI GIAN ĐƯỢC CHỌN)
   ========================================================================== */
.timeline-milestone-card {
  background: linear-gradient(135deg, rgba(13, 20, 38, 0.97) 0%, rgba(20, 18, 45, 0.97) 100%);
  border: 1px solid rgba(234, 179, 8, 0.4);
  border-radius: 16px;
  padding: 1.25rem 1.4rem;
  margin-top: 1.25rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7), 0 0 25px rgba(234, 179, 8, 0.15);
  animation: fadeInMilestone 0.3s ease-out;
}

@keyframes fadeInMilestone {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.milestone-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.milestone-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.milestone-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold-300);
  margin: 0;
}

.milestone-badge-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}

.btn-close-milestone {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #94a3b8;
  font-size: 0.95rem;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-close-milestone:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: #f43f5e;
  color: #fff;
}

.milestone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.15rem;
}

@media (max-width: 960px) {
  .milestone-grid {
    grid-template-columns: 1fr;
  }
}

.milestone-col {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.milestone-col-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 0.45rem;
}

.m-icon {
  font-size: 1rem;
}

.m-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: 0.3px;
  flex-grow: 1;
}

.m-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.35);
  color: var(--gold-300);
}

.m-badge.solfeggio {
  background: rgba(192, 132, 252, 0.15);
  border-color: rgba(192, 132, 252, 0.35);
  color: #c084fc;
}

.milestone-text {
  font-size: 0.8rem;
  color: #cbd5e1;
  line-height: 1.5;
  flex-grow: 1;
}

.milestone-advice-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
}

.m-advice-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gold-300);
  margin-bottom: 0.25rem;
}

.m-advice-text {
  font-size: 0.76rem;
  color: #e2e8f0;
  line-height: 1.45;
}

.m-pillar-bars {
  display: flex;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  font-size: 0.74rem;
}

.m-pillar-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.m-pillar-item span {
  font-size: 0.66rem;
  color: #94a3b8;
}

.m-sub-highlight {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fde047;
}

.milestone-solfeggio-box {
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
}

.m-solfeggio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #d8b4fe;
  margin-bottom: 0.25rem;
}

.m-solfeggio-desc {
  font-size: 0.74rem;
  color: #cbd5e1;
  line-height: 1.4;
}

/* ==========================================================================
   RESPONSIVE DESIGN (SMART BREAKPOINTS: 1200px, 1024px, 768px, 480px)
   ========================================================================== */
@media (max-width: 1200px) {
  .site-header {
    padding: 0.45rem 0.8rem;
  }
  .header-actions {
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: flex-end;
  }
  .btn-header {
    font-size: 0.78rem;
    padding: 0.35rem 0.7rem;
  }
  .brand-title-wrap h1 {
    font-size: 1.2rem;
  }
  .sidebar-panel-left {
    width: 320px;
  }
}

@media (max-width: 1024px) {
  body {
    overflow-y: auto;
    overflow-x: hidden;
  }
  .app-container {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    min-height: 100vh;
  }
  .app-body-layout {
    flex-direction: column !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    gap: 0.85rem;
    padding: 0 0.5rem 1.5rem 0.5rem;
  }
  .sidebar-panel-left {
    width: 100% !important;
    position: static !important;
    max-height: none !important;
    overflow-y: visible !important;
    padding-right: 0;
  }
  .app-body-layout.sidebar-collapsed .sidebar-panel-left {
    display: none !important;
    width: 0 !important;
  }
  .floating-expand-sidebar {
    display: none !important;
  }
  .main-content-area.master-workspace-split {
    flex-direction: column !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    gap: 0.85rem;
  }
  .master-content-col {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }
  .master-tab-viewport {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding-right: 0;
  }
  .master-tree-col,
  .app-body-layout.sidebar-collapsed .master-tree-col {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
    height: clamp(380px, 58vh, 560px) !important;
  }
  .saved-profiles-list {
    max-height: 180px;
  }
  .hero-cycle-bottom-grid {
    grid-template-columns: 1fr;
  }
  .workspace-grid {
    grid-template-columns: 1fr;
  }
  .holistic-triad-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

@media (max-width: 768px) {
  .app-container {
    padding: 0.35rem;
  }
  .main-tab-btn {
    min-height: 40px;
    padding: 0.5rem 0.75rem;
  }
  .filter-btn {
    min-height: 36px;
    padding: 0.35rem 0.55rem;
  }
  .temporal-mode-btn {
    min-height: 38px;
  }
  .btn-close-inspector {
    min-height: 38px;
    padding: 0.45rem 0.85rem;
  }
  .btn-close-modal {
    min-height: 40px;
    padding: 0.45rem 0.95rem;
  }

  .site-header {
    flex-direction: column;
    gap: 0.65rem;
    align-items: stretch;
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.65rem;
  }
  .brand-wrapper {
    justify-content: flex-start;
    gap: 0.65rem;
  }
  .brand-symbol {
    width: 36px;
    height: 36px;
  }
  .brand-symbol svg {
    width: 20px;
    height: 20px;
  }
  .brand-title-wrap h1 {
    font-size: 1.05rem;
  }
  .brand-title-wrap p {
    font-size: 0.65rem;
  }
  .header-actions {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    gap: 0.35rem;
    justify-content: stretch;
  }
  .btn-header {
    flex: 1 1 calc(50% - 0.35rem);
    min-width: 130px;
    justify-content: center;
    font-size: 0.74rem;
    padding: 0.38rem 0.5rem;
  }
  .primary-metrics-grid {
    grid-template-columns: 1fr;
  }
  .chakra-triad-grid {
    grid-template-columns: 1fr;
  }
  .inspector-grid {
    grid-template-columns: 1fr;
  }
  .shmita-timeline-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .olamot-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .form-row-2col {
    grid-template-columns: 1fr;
  }
  .master-tree-col,
  .app-body-layout.sidebar-collapsed .master-tree-col {
    height: clamp(480px, 70vh, 650px) !important;
  }
  .docs-modal-container {
    grid-template-columns: 1fr;
    height: 95vh;
    margin: 0 0.5rem;
    border-radius: 12px;
  }
  .docs-modal-sidebar {
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
}

@media (max-width: 480px) {
  .header-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.35rem;
    width: 100%;
  }
  .btn-header {
    width: 100%;
    min-width: 0;
    font-size: 0.72rem;
    padding: 0.42rem 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    justify-content: center;
  }
  .tree-header-top-row h2 {
    font-size: 0.88rem;
  }
  .tree-header-actions {
    width: 100%;
    justify-content: space-between;
  }
  .filter-toolbar {
    width: 100%;
    justify-content: stretch;
  }
  .filter-btn {
    flex: 1;
    text-align: center;
    padding: 0.25rem 0.35rem;
    font-size: 0.7rem;
  }
  .tree-viewport-container svg,
  .tree-viewport-container canvas {
    min-height: 540px;
  }
  .master-tree-col,
  .app-body-layout.sidebar-collapsed .master-tree-col {
    height: clamp(440px, 68vh, 580px) !important;
  }
}

/* ==========================================================================
   MULTI-DISCIPLINARY EXTENSIONS: HUMAN DESIGN & GENE KEYS
   ========================================================================== */
.form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

/* BIRTH TIME & CAN CHI ENHANCED CLUSTERS */
.birth-time-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.time-cluster-wrap {
  display: flex;
  align-items: center;
}

.time-inputs-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 8px;
  padding: 0.2rem 0.5rem;
  width: 100%;
  transition: var(--transition-smooth, all 0.2s ease);
}

.time-inputs-cluster:focus-within {
  border-color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
}

.time-cluster-num {
  width: 48px;
  text-align: center;
  font-family: var(--font-mono, monospace);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fbbf24;
  background: transparent !important;
  border: none !important;
  padding: 0.2rem 0 !important;
  outline: none !important;
  box-shadow: none !important;
  -moz-appearance: textfield;
}

.time-cluster-num::-webkit-outer-spin-button,
.time-cluster-num::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.time-cluster-num:disabled {
  color: rgba(255, 255, 255, 0.3);
  cursor: not-allowed;
}

.time-cluster-colon {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fbbf24;
  user-select: none;
}

.birth-time-options-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.time-sub-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.time-sub-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sub-label {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 500;
}

.time-preset-select {
  font-size: 0.76rem !important;
  padding: 0.3rem 0.5rem !important;
  height: 32px !important;
}

.unknown-time-row {
  display: flex;
  align-items: center;
  margin-top: 0.1rem;
}

.unknown-time-row .checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  user-select: none;
}

.unknown-time-row input[type="checkbox"] {
  cursor: pointer;
  accent-color: #f59e0b;
}

.birth-time-hint {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  padding: 0.35rem 0.5rem;
  background: rgba(245, 158, 11, 0.1);
  border-left: 3px solid #f59e0b;
  border-radius: 4px;
  font-size: 0.72rem;
  line-height: 1.35;
  color: #fde68a;
  animation: fadeIn 0.3s ease;
}

.time-precision-notice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  margin: 0.5rem 0;
  border-radius: 6px;
  font-size: 0.76rem;
  line-height: 1.4;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}

.time-precision-notice.warn {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fcd34d;
}

.time-precision-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  margin-left: 0.3rem;
  vertical-align: middle;
}

.time-precision-tag.exact {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.time-precision-tag.approximate {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fcd34d;
}

.time-precision-tag.unknown {
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #a5b4fc;
}

.btn-matrix-overlay {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #c084fc;
  border-radius: 9999px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-matrix-overlay:hover,
.btn-matrix-overlay.active {
  background: rgba(168, 85, 247, 0.35);
  border-color: #d8b4fe;
  color: #ffffff;
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.5);
}

/* Tab Hero Cards */
.hd-hero-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(56, 189, 248, 0.12);
}
.hd-hero-card .holistic-symbol {
  color: #38bdf8;
  text-shadow: 0 0 18px rgba(56, 189, 248, 0.6);
}

.gk-hero-card {
  background: linear-gradient(135deg, rgba(20, 42, 34, 0.8) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(16, 185, 129, 0.12);
}
.gk-hero-card .holistic-symbol {
  color: #10b981;
  text-shadow: 0 0 18px rgba(16, 185, 129, 0.6);
}

/* Metric Cards Variants */
.metric-card.hd-authority { border-left-color: #facc15; }
.metric-card.hd-profile   { border-left-color: #38bdf8; }
.metric-card.hd-def       { border-left-color: #a855f7; }
.metric-card.hd-cross     { border-left-color: #ec4899; }

.metric-card.gk-lw  { border-left-color: #10b981; }
.metric-card.gk-evo { border-left-color: #f59e0b; }
.metric-card.gk-rad { border-left-color: #f43f5e; }
.metric-card.gk-pur { border-left-color: #06b6d4; }

/* HD Channels & Centers List */
.hd-channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.6rem;
  margin-top: 0.8rem;
}
.hd-channel-item {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.hd-channel-item:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(56, 189, 248, 0.4);
}
.hd-channel-pill {
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-weight: 700;
}
.hd-channel-pill.personality { background: rgba(56, 189, 248, 0.2); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.4); }
.hd-channel-pill.design      { background: rgba(239, 68, 68, 0.2);  color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.4); }
.hd-channel-pill.mixed       { background: linear-gradient(135deg, rgba(239, 68, 68, 0.3), rgba(56, 189, 248, 0.3)); color: #fde047; border: 1px solid #fde047; }

/* Gene Keys Middle Pillar & Spectrum */
.gk-mp-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.8rem;
}
.gk-mp-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(234, 179, 8, 0.2);
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  font-size: 0.85rem;
  transition: var(--transition-smooth);
}
.gk-mp-step:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: #facc15;
  box-shadow: 0 0 15px rgba(234, 179, 8, 0.2);
}
.gk-mp-sef {
  font-weight: 700;
  color: #fde047;
  font-size: 0.88rem;
}
.gk-mp-sphere {
  color: #38bdf8;
  font-weight: 600;
}
.gk-mp-key {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.78rem;
}

/* Legend items for HD and GK */
.legend-dot.hd-p { background: #38bdf8; }
.legend-dot.hd-d { background: #ef4444; }
.legend-dot.hd-m { background: repeating-linear-gradient(45deg, #ef4444, #ef4444 3px, #38bdf8 3px, #38bdf8 6px); }
.legend-dot.hd-def { background: #facc15; }

.hd-center-badge {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), filter 0.2s ease;
}
.hd-center-badge:hover {
  filter: drop-shadow(0 0 8px rgba(250, 204, 21, 0.65));
}

.legend-dot.gk-act { background: #10b981; }
.legend-dot.gk-ven { background: #f43f5e; }
.legend-dot.gk-prl { background: #06b6d4; }
.legend-dot.gk-mid { background: #fde047; }

/* Toast Notification Floating Banner */
.app-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(234, 179, 8, 0.6);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(234, 179, 8, 0.25);
  color: #f8fafc;
  padding: 12px 22px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.2px;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(12px);
  transform: translateY(24px) scale(0.96);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.app-toast.show {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* ==========================================================================
   HUMAN DESIGN & GENE KEYS PARTICLES & VISUALIZER ENHANCEMENTS
   ========================================================================== */
.hd-particles-group,
.gk-particles-group {
  pointer-events: none;
}

.hd-particles-group circle,
.gk-particles-group circle {
  pointer-events: none;
  will-change: cx, cy;
}


.hd-center-node {
  transition: transform 0.2s ease, filter 0.2s ease;
}

.hd-center-node:hover polygon,
.hd-center-node:hover rect {
  filter: drop-shadow(0 0 14px rgba(250, 204, 21, 0.45));
}

.hd-center-labels text {
  font-family: var(--font-primary, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  user-select: none;
  pointer-events: none;
}

.hd-gate-bubble {
  transition: transform 0.15s ease;
  user-select: none;
  pointer-events: none;
}

.hd-channel-group {
  transition: stroke-width 0.2s ease, filter 0.2s ease;
}

/* TREE OF LIFE FLOATING HUD TOOLTIP */
.tree-floating-tooltip {
  position: fixed !important;
  width: 330px !important;
  max-width: 360px !important;
  box-sizing: border-box !important;
  pointer-events: none !important;
  background: rgba(8, 14, 28, 0.97) !important;
  border: 1px solid rgba(234, 179, 8, 0.45) !important;
  border-radius: 14px !important;
  padding: 12px 16px !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9), 0 0 20px rgba(234, 179, 8, 0.25) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  color: #f8fafc !important;
  font-family: var(--font-sans) !important;
  z-index: 500 !important;
  line-height: 1.45 !important;
  word-wrap: break-word !important;
  animation: treeTooltipFadeIn 0.12s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes treeTooltipFadeIn {
  from { opacity: 0; transform: translateY(4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.hd-hud-tooltip {
  position: fixed !important;
  width: 320px !important;
  max-width: 360px !important;
  box-sizing: border-box !important;
  background: rgba(11, 17, 32, 0.97) !important;
  border: 1px solid rgba(234, 179, 8, 0.5) !important;
  border-radius: 14px !important;
  padding: 12px 16px !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9), 0 0 15px rgba(234, 179, 8, 0.25) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  pointer-events: none !important;
  color: #f8fafc !important;
  font-family: var(--font-sans) !important;
  z-index: 500 !important;
  line-height: 1.45 !important;
  animation: hdTooltipFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes hdTooltipFadeIn {
  from { opacity: 0; transform: translateY(4px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.gk-hud-tooltip {
  position: fixed !important;
  width: 320px !important;
  max-width: 360px !important;
  box-sizing: border-box !important;
  pointer-events: none !important;
  background: rgba(10, 15, 29, 0.97) !important;
  border: 1px solid rgba(56, 189, 248, 0.45) !important;
  border-radius: 14px !important;
  padding: 12px 16px !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9), 0 0 20px rgba(56, 189, 248, 0.25) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  color: #f8fafc !important;
  font-family: var(--font-sans) !important;
  z-index: 500 !important;
  line-height: 1.45 !important;
  word-wrap: break-word !important;
  animation: gkTooltipFadeIn 0.12s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes gkTooltipFadeIn {
  from { opacity: 0; transform: translateY(4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================================================
   INDICATOR & LEVEL REFERENCE SYSTEM (GENE KEYS & HUMAN DESIGN)
   ========================================================================== */

/* 1. Benchmark & Scale Badges (Huy hiệu quy chiếu chuẩn: Khóa 1-64, Hào 1-6) */
.unit-score-benchmark-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.45rem;
  width: 100%;
}

.score-line-group {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.unit-status-row.compact {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: 0.15rem;
  margin-bottom: 0.15rem;
}

.unit-status-row.compact .unit-score {
  font-size: 1.35rem;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1;
  letter-spacing: -0.3px;
  width: auto;
  cursor: pointer;
}

.unit-scale-badges {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.scale-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  cursor: pointer;
}

.scale-badge-pill.key {
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid rgba(14, 165, 233, 0.4);
  color: #38bdf8;
}

.scale-badge-pill.line {
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.45);
  color: var(--gold-300);
}

.scale-badge-pill.max {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.25) 0%, rgba(244, 63, 94, 0.25) 100%);
  border: 1px solid #facc15;
  color: #fef08a;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.3);
}

/* 2. Thước đo 6 cấp độ Hào (6-Segment Line Level Meter) */
.line-level-meter {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
  margin: 0.45rem 0 0.55rem 0;
  background: rgba(11, 17, 33, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0.45rem 0.65rem;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Biến thể Compact lồng trong dòng điểm số */
.unit-status-row.compact .line-level-meter,
.line-level-meter:has(.line-meter-track.compact) {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  width: auto;
}

.line-meter-track {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
  width: 100%;
  height: 8px;
}

.line-meter-track.compact {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 3px;
  width: 72px;
  height: 6px;
  cursor: pointer;
}

.line-meter-seg {
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  transition: all 0.25s ease;
  position: relative;
}

.line-meter-track.compact .line-meter-seg {
  border-radius: 2px;
}

/* Các bậc Hào khi Active */
.line-meter-seg.active-1 {
  background: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}
.line-meter-seg.active-2 {
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
}
.line-meter-seg.active-3 {
  background: #facc15;
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.6);
}
.line-meter-seg.active-4 {
  background: #fb923c;
  box-shadow: 0 0 8px rgba(251, 146, 60, 0.6);
}
.line-meter-seg.active-5 {
  background: #f43f5e;
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.6);
}
.line-meter-seg.active-6 {
  background: linear-gradient(135deg, #facc15 0%, #e11d48 100%);
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.9);
}

.line-meter-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  font-size: 0.73rem;
  color: #cbd5e1;
}

.line-meter-label {
  font-weight: 700;
  color: var(--gold-300);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.line-meter-pct {
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 600;
  white-space: nowrap;
}

/* 3. Phổ Tần Số Chuyển Hóa 3 Tầng (Minimalist Step-List - Tinh Gọn, Thanh Mảnh) */
.frequency-spectrum-box {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  width: 100%;
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-bottom: none;
  box-sizing: border-box;
}

.spectrum-pipeline {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  width: 100%;
}

.spectrum-step {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  padding: 0.22rem 0.45rem;
  border-radius: 6px;
  border: 1px solid transparent;
  width: 100%;
  box-sizing: border-box;
  transition: all 0.2s ease;
  cursor: pointer;
}

.spectrum-step .step-tier {
  font-size: 0.69rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 80px;
}

.spectrum-step .step-val {
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.35;
  color: #cbd5e1;
  flex: 1 1 auto;
  word-break: break-word;
}

/* Step 1: Bóng tối (Shadow) - Minimalist flat row */
.spectrum-step.shadow {
  background: transparent;
  border-color: transparent;
}
.spectrum-step.shadow .step-tier {
  color: #fb7185;
}
.spectrum-step.shadow .step-val {
  color: #fca5a5;
}
.spectrum-step.shadow:hover {
  background: rgba(244, 63, 94, 0.08);
  border-color: rgba(244, 63, 94, 0.25);
}

/* Step 2: Món quà (Gift) - Trọng tâm khai phóng năng lực (Thanh lịch & Nhẹ nhàng) */
.spectrum-step.gift {
  background: rgba(16, 185, 129, 0.09);
  border-color: transparent transparent transparent #10b981;
  border-left: 3px solid #10b981;
  box-shadow: none;
}
.spectrum-step.gift .step-tier {
  color: #34d399;
  font-weight: 800;
}
.spectrum-step.gift .step-val {
  color: #ecfdf5;
  font-weight: 600;
}
.spectrum-step.gift:hover {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.35) rgba(16, 185, 129, 0.35) rgba(16, 185, 129, 0.35) #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}

/* Step 3: Giác ngộ (Siddhi) - Minimalist flat row */
.spectrum-step.siddhi {
  background: transparent;
  border-color: transparent;
}
.spectrum-step.siddhi .step-tier {
  color: #c084fc;
}
.spectrum-step.siddhi .step-val {
  color: #e9d5ff;
}
.spectrum-step.siddhi:hover {
  background: rgba(168, 85, 247, 0.08);
  border-color: rgba(168, 85, 247, 0.25);
}

.spectrum-arrow {
  display: none !important;
}

/* 4. Indicator bổ trợ trong Metric Cards */
.metric-benchmark-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.3rem 0;
}

.metric-meter-track {
  display: flex;
  gap: 3px;
  flex: 1;
  height: 5px;
}

.metric-meter-seg {
  flex: 1;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
}

.metric-meter-seg.active {
  background: var(--gold-400);
  box-shadow: 0 0 6px var(--gold-400);
}

/* 5. Dual Line Meters cho Profile Human Design */
.hd-profile-dual-meter {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.35rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
}

.hd-profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.72rem;
}

.hd-profile-label {
  color: #cbd5e1;
  font-weight: 600;
  white-space: nowrap;
}

.hd-mini-track {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 3px;
  width: 90px;
  height: 6px;
}

.hd-mini-seg {
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
}

.hd-mini-seg.active-p {
  background: #38bdf8;
  box-shadow: 0 0 6px #38bdf8;
}

.hd-mini-seg.active-d {
  background: #f43f5e;
  box-shadow: 0 0 6px #f43f5e;
}

/* ==========================================================================
   GLOBAL RICHTEXT TOOLTIP SYSTEM
   Giao diện Tooltip RichText sang trọng, giải nghĩa tiếng Việt đời thường
   ========================================================================== */
.app-rich-tooltip {
  position: fixed;
  z-index: 999999;
  max-width: 320px;
  min-width: 220px;
  background: rgba(10, 15, 29, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 0.75rem 0.95rem;
  box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.85), 0 0 20px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  pointer-events: none;
  font-family: var(--font-sans);
  line-height: 1.45;
  color: #f1f5f9;
  opacity: 0;
  transform: translateY(4px) scale(0.97);
  transition: opacity 0.15s cubic-bezier(0.16, 1, 0.3, 1), transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.app-rich-tooltip.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Dải dạ quang điểm nhấn trên đầu Tooltip */
.app-rich-tooltip::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12px;
  right: 12px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--gold-400);
}

.app-rich-tooltip.theme-shadow::before { background: linear-gradient(90deg, #f43f5e, #fb7185); }
.app-rich-tooltip.theme-shadow { border-color: rgba(244, 63, 94, 0.4); box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.85), 0 0 18px rgba(244, 63, 94, 0.25); }

.app-rich-tooltip.theme-gift::before { background: linear-gradient(90deg, #10b981, #34d399); }
.app-rich-tooltip.theme-gift { border-color: rgba(16, 185, 129, 0.5); box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.85), 0 0 22px rgba(16, 185, 129, 0.3); }

.app-rich-tooltip.theme-siddhi::before { background: linear-gradient(90deg, #a855f7, #c084fc); }
.app-rich-tooltip.theme-siddhi { border-color: rgba(168, 85, 247, 0.45); box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.85), 0 0 20px rgba(168, 85, 247, 0.25); }

.app-rich-tooltip.theme-gold::before { background: var(--gold-metallic); }
.app-rich-tooltip.theme-gold { border-color: rgba(234, 179, 8, 0.5); box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.85), 0 0 20px rgba(234, 179, 8, 0.3); }

.app-rich-tooltip.theme-cyan::before { background: linear-gradient(90deg, #0284c7, #38bdf8); }
.app-rich-tooltip.theme-cyan { border-color: rgba(56, 189, 248, 0.45); box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.85), 0 0 18px rgba(56, 189, 248, 0.25); }

/* Header của Tooltip RichText */
.art-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.art-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.art-badge.shadow { background: rgba(244, 63, 94, 0.2); color: #fda4af; border: 1px solid rgba(244, 63, 94, 0.4); }
.art-badge.gift { background: rgba(16, 185, 129, 0.22); color: #a7f3d0; border: 1px solid rgba(16, 185, 129, 0.45); }
.art-badge.siddhi { background: rgba(168, 85, 247, 0.2); color: #e9d5ff; border: 1px solid rgba(168, 85, 247, 0.4); }
.art-badge.gold { background: rgba(234, 179, 8, 0.2); color: #fde047; border: 1px solid rgba(234, 179, 8, 0.45); }
.art-badge.cyan { background: rgba(56, 189, 248, 0.2); color: #bae6fd; border: 1px solid rgba(56, 189, 248, 0.4); }

.art-sub {
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 600;
}

.art-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.25rem;
  line-height: 1.35;
}

.art-value-highlight {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--gold-300);
  margin-bottom: 0.35rem;
  padding: 2px 6px;
  background: rgba(234, 179, 8, 0.1);
  border-radius: 4px;
  display: inline-block;
}

.art-meaning {
  font-size: 0.74rem;
  color: #cbd5e1;
  line-height: 1.45;
  margin-bottom: 0.4rem;
}

.art-tip {
  font-size: 0.71rem;
  color: #94a3b8;
  background: rgba(0, 0, 0, 0.35);
  border-left: 2px solid var(--gold-400);
  border-radius: 0 4px 4px 0;
  padding: 0.3rem 0.5rem;
  line-height: 1.4;
}

.art-tip strong {
  color: var(--gold-300);
}

/* ==========================================================================
   7 CHAKRAS (LUÂN XA) & ÂM DƯƠNG SYSTEM STYLING
   ========================================================================== */

.chakra-analytics-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* 1. THẺ TỔNG QUAN HỆ THỐNG LUÂN XA */
.chakra-holistic-card {
  background: radial-gradient(circle at 50% 0%, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(234, 179, 8, 0.25);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.chakra-holistic-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #ef4444, #f97316, #eab308, #22c55e, #06b6d4, #6366f1, #a855f7);
}

.chakra-holistic-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.chakra-symbol-glow {
  font-size: 2.2rem;
  color: var(--gold-300);
  text-shadow: 0 0 16px rgba(234, 179, 8, 0.6);
  line-height: 1;
}

.chakra-overall-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0.15rem 0;
}

.chakra-overall-sub {
  font-size: 0.8rem;
  color: #94a3b8;
}

.chakra-header-metrics {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.chakra-badge-pill {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.4);
  color: var(--gold-300);
}

.chakra-badge-pill.axis {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

/* 2. THƯỚC ĐO CÂN BẰNG ÂM - DƯƠNG */
.chakra-polarity-meter-box {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.polarity-labels-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.polarity-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.polarity-label.yang {
  color: #facc15;
}

.polarity-label.yin {
  color: #38bdf8;
  text-align: right;
}

.polarity-label .polarity-hint {
  font-size: 0.72rem;
  color: #94a3b8;
}

.polarity-verdict-tag {
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #4ade80;
  padding: 3px 10px;
  border-radius: 12px;
}

.polarity-dual-bar {
  display: flex;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 0.6rem;
}

.polarity-bar-fill.yang {
  background: linear-gradient(90deg, #ca8a04, #facc15);
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.5);
  transition: width 0.6s ease;
}

.polarity-bar-fill.yin {
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
  transition: width 0.6s ease;
}

.polarity-advice-text {
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.45;
  font-style: italic;
}

/* 3. BA THẺ TỤ NĂNG LƯỢNG LUÂN XA */
.chakra-triad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.chakra-triad-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.chakra-triad-card:hover {
  transform: translateY(-2px);
  border-color: rgba(234, 179, 8, 0.4);
}

.chakra-triad-card .triad-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

.chakra-triad-card .triad-tag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

.chakra-triad-card .triad-val {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.2rem;
}

.chakra-triad-card .triad-score {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.chakra-triad-card .triad-desc {
  font-size: 0.74rem;
  color: #94a3b8;
  line-height: 1.35;
}

.chakra-triad-card.dominant .triad-score {
  color: #eab308;
}

.chakra-triad-card.sushumna .triad-score {
  color: #38bdf8;
}

.chakra-triad-card.challenge .triad-score {
  color: #ef4444;
}

.chakra-kundaliniAdvice {
  background: rgba(234, 179, 8, 0.08);
  border-left: 3px solid var(--gold-400);
  border-radius: 0 8px 8px 0;
  padding: 0.85rem 1rem;
  color: #e2e8f0;
}

/* 4. BỘ LỌC VÀ HEADER DANH SÁCH CARDS */
.chakra-cards-container-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.chakra-filter-pills {
  display: flex;
  gap: 0.4rem;
  background: rgba(15, 23, 42, 0.8);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.chakra-filter-pill {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chakra-filter-pill:hover {
  color: #ffffff;
}

.chakra-filter-pill.active {
  background: rgba(234, 179, 8, 0.2);
  color: var(--gold-300);
  border: 1px solid rgba(234, 179, 8, 0.4);
}

/* 5. DANH SÁCH 7 CARDS CHI TIẾT LUÂN XA */
.chakra-cards-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.chakra-card-item {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.35rem;
  position: relative;
  transition: all 0.25s ease;
}

.chakra-card-item:hover {
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.chakra-card-item.side-center {
  border-left: 4px solid #ffffff;
}

.chakra-card-item.side-left {
  border-left: 4px solid #eab308;
}

.chakra-card-item.side-right {
  border-left: 4px solid #38bdf8;
}

.chakra-card-item.selected-chakra-highlight {
  border-color: var(--gold-400);
  box-shadow: 0 0 25px rgba(234, 179, 8, 0.35);
  background: rgba(20, 30, 50, 0.9);
}

.chakra-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.chakra-avatar-wrap {
  flex-shrink: 0;
}

.chakra-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.chakra-avatar-num {
  font-size: 0.72rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1;
}

.chakra-avatar-mantra {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
}

.chakra-card-title-group {
  flex: 1;
}

.chakra-card-top-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.25rem;
}

.chakra-name-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.chakra-status-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

.chakra-status-pill.success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #4ade80;
}

.chakra-status-pill.gold {
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.35);
  color: #facc15;
}

.chakra-status-pill.warning {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
}

.chakra-card-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.chakra-polarity-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}

.chakra-polarity-badge.yang {
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.3);
  color: #facc15;
}

.chakra-polarity-badge.yin {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
}

.chakra-polarity-badge.neutral {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #f8fafc;
}

.chakra-meta-pill {
  font-size: 0.72rem;
  color: #94a3b8;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
}

.chakra-meta-pill strong {
  color: #e2e8f0;
}

.chakra-score-box {
  text-align: right;
  flex-shrink: 0;
}

.chakra-score-num {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1;
}

.chakra-score-lbl {
  font-size: 0.68rem;
  color: #64748b;
  text-transform: uppercase;
}

.chakra-bar-track {
  height: 6px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.chakra-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 4 KHỐI ĐỐI CHIẾU ĐA HỆ THỐNG */
.chakra-matrix-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.chakra-matrix-item {
  background: rgba(10, 15, 28, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
}

.matrix-item-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 0.2rem;
}

.matrix-item-val {
  font-size: 0.85rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 0.15rem;
}

.matrix-item-sub {
  font-size: 0.72rem;
  color: #64748b;
  line-height: 1.3;
}

/* LUẬN ĐOÁN VÀ DẤU HIỆU MẤT CÂN BẰNG */
.chakra-diagnostic-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.9rem;
}

.diagnostic-row {
  display: flex;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.diagnostic-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.diagnostic-content strong {
  font-size: 0.85rem;
  color: var(--gold-300);
}

.diagnostic-content p {
  font-size: 0.82rem;
  color: #cbd5e1;
  margin: 0.25rem 0 0.4rem 0;
  line-height: 1.45;
}

.diagnostic-cross-lore {
  font-size: 0.76rem !important;
  color: #94a3b8 !important;
  margin: 0.15rem 0 !important;
}

.diagnostic-dual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.imbalance-col {
  font-size: 0.76rem;
  line-height: 1.4;
}

.imbalance-tag.under {
  color: #f87171;
  font-weight: 700;
  display: block;
  margin-bottom: 0.2rem;
}

.imbalance-tag.over {
  color: #facc15;
  font-weight: 700;
  display: block;
  margin-bottom: 0.2rem;
}

.imbalance-col p {
  color: #94a3b8;
  margin: 0;
}

/* PHÁC ĐỒ CHỮA LÀNH */
.chakra-healing-protocol {
  background: rgba(6, 12, 22, 0.8);
  border: 1px solid rgba(234, 179, 8, 0.15);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.9rem;
}

.protocol-header {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold-300);
  margin-bottom: 0.5rem;
}

.protocol-body-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1rem;
}

.protocol-unit {
  font-size: 0.76rem;
  line-height: 1.4;
}

.protocol-unit .unit-lbl {
  color: #94a3b8;
  font-weight: 600;
  display: block;
}

.protocol-unit .unit-text {
  color: #e2e8f0;
}

.protocol-unit.affirmation {
  grid-column: span 2;
  background: rgba(234, 179, 8, 0.06);
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border-left: 2px solid var(--gold-400);
}

.protocol-unit.affirmation .unit-text {
  color: var(--gold-300);
  font-style: italic;
  font-weight: 600;
}

/* NÚT TƯƠNG TÁC CARD */
.chakra-card-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
}

.btn-chakra-audio, .btn-chakra-focus {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-chakra-audio {
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.35);
  color: var(--gold-300);
}

.btn-chakra-audio:hover {
  background: rgba(234, 179, 8, 0.25);
  border-color: var(--gold-400);
  transform: translateY(-1px);
}

.btn-chakra-focus {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}

.btn-chakra-focus:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  transform: translateY(-1px);
}

/* RESPONSIVE CHAKRAS */
@media (max-width: 1024px) {
  .chakra-matrix-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .protocol-body-grid {
    grid-template-columns: 1fr;
  }
  .protocol-unit.affirmation {
    grid-column: span 1;
  }
}

@media (max-width: 768px) {
  .chakra-triad-grid {
    grid-template-columns: 1fr;
  }
  .diagnostic-dual-grid {
    grid-template-columns: 1fr;
  }
  .chakra-card-header {
    flex-wrap: wrap;
  }
  .chakra-score-box {
    text-align: left;
    margin-left: 68px;
  }
}

/* CHAKRA VISUALIZER SVG & TOOLTIP HUD STYLES */
.chakra-hud-tooltip {
  position: fixed !important;
  width: 340px !important;
  min-width: 320px !important;
  max-width: 360px !important;
  box-sizing: border-box !important;
  pointer-events: none !important;
  background: rgba(8, 14, 28, 0.96) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 14px !important;
  padding: 12px 16px !important;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.85), 0 0 20px rgba(0, 0, 0, 0.5) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  color: #f8fafc !important;
  font-family: var(--font-sans) !important;
  z-index: 99999 !important;
  line-height: 1.45 !important;
  word-wrap: break-word !important;
  transition: opacity 0.12s ease !important;
}

.chakra-label-group {
  transition: opacity 0.25s ease, transform 0.25s ease;
  user-select: none;
}

.chakra-label-group:hover rect,
.chakra-label-group.hovered rect {
  stroke-opacity: 0.95 !important;
  stroke-width: 1.5px !important;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.35)) !important;
}

.chakra-node-item {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chakra-node-item:hover,
.chakra-node-item.hovered {
  filter: brightness(1.22) drop-shadow(0 0 12px rgba(255, 255, 255, 0.45));
}

/* CHAKRA INSPECTOR DETAIL PANEL STYLES */
#chakraInspectorDetailPanel {
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.chakra-insp-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 1rem;
}

.chakra-insp-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-chakra-audio-insp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 8px;
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.4);
  color: var(--gold-300);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-chakra-audio-insp:hover {
  background: rgba(234, 179, 8, 0.28);
  border-color: var(--gold-400);
  box-shadow: 0 0 12px rgba(234, 179, 8, 0.35);
  transform: translateY(-1px);
}

.chakra-insp-card {
  background: rgba(11, 19, 38, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.chakra-insp-header {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}

.chakra-insp-avatar-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, #1e293b 0%, #070d1d 90%);
  border: 2.5px solid #ffffff;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

.chakra-insp-avatar-num {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  line-height: 1;
}

.chakra-insp-avatar-mantra {
  font-size: 1.25rem;
  font-weight: 800;
  font-family: 'Cinzel', serif;
  color: #ffffff;
  line-height: 1.2;
}

.chakra-insp-title-group {
  flex: 1;
  min-width: 220px;
}

.chakra-insp-main-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chakra-insp-sub-title {
  font-size: 0.88rem;
  color: #94a3b8;
  margin-bottom: 6px;
}

.chakra-insp-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.chakra-insp-score-box {
  text-align: right;
  min-width: 110px;
}

.chakra-insp-score-val {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
}

.chakra-insp-score-lbl {
  font-size: 0.75rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Quick Nav Pills 1-7 in Inspector */
.chakra-quick-nav-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
  padding-bottom: 4px;
}

.chakra-quick-nav-label {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 600;
  white-space: nowrap;
  margin-right: 4px;
}

.chakra-quick-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.chakra-quick-nav-btn:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
  transform: translateY(-1px);
}

.chakra-quick-nav-btn.active {
  background: rgba(255, 255, 255, 0.15);
  border-color: #ffffff;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.25);
}
.temporal-controls { display: grid; gap: .55rem; padding: .25rem .1rem .9rem; border-bottom: 1px solid rgba(234,179,8,.2); margin-bottom: .8rem; }
.temporal-controls label { color: #cbd5e1; font-size: .78rem; font-weight: 700; }
.temporal-mode-buttons, .temporal-year-row { display: flex; gap: .45rem; }
.temporal-mode-btn, .temporal-now-btn { border: 1px solid rgba(234,179,8,.35); border-radius: 9px; background: #101827; color: #cbd5e1; padding: .5rem .65rem; cursor: pointer; font: inherit; font-size: .76rem; }
.temporal-mode-btn { flex: 1; }
.temporal-mode-btn.active { color: #111827; background: #facc15; border-color: #facc15; font-weight: 800; }
.temporal-year-row .form-input { min-width: 0; flex: 1; }
.temporal-now-btn { white-space: nowrap; }
.temporal-year-group {
  display: grid;
  gap: 0.5rem;
  transition: all 0.25s ease;
}
.discipline-temporal-badge {
  font-size: 0.73rem;
  line-height: 1.4;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  margin-bottom: 0.65rem;
  transition: all 0.2s ease;
}
.discipline-temporal-badge.active {
  background: rgba(234, 179, 8, 0.09);
  border: 1px solid rgba(234, 179, 8, 0.25);
  color: #fde047;
}
.discipline-temporal-badge.info {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #38bdf8;
}
.discipline-temporal-badge.warning {
  background: rgba(244, 63, 94, 0.09);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fb7185;
}
.sidebar-card.compact-cycles-card.discipline-disabled {
  opacity: 0.42;
  filter: grayscale(0.6);
  pointer-events: none;
  user-select: none;
  position: relative;
}
.natal-mode-notice {
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(234, 179, 8, 0.3);
  border-radius: 9px;
  background: rgba(234, 179, 8, 0.06);
  color: #e2e8f0;
  font-size: 0.75rem;
  line-height: 1.5;
  margin-top: 0.4rem;
}
.natal-mode-notice .natal-notice-header {
  color: var(--gold-300);
  font-weight: 700;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.indicator-context { margin-top: .55rem; padding: .5rem .6rem; border: 1px solid rgba(56,189,248,.2); background: rgba(15,23,42,.55); border-radius: 8px; color: #cbd5e1; font-size: .73rem; line-height: 1.45; }
.indicator-context strong { color: #facc15; }
.indicator-context .delta-up { color: #4ade80; }
.indicator-context .delta-down { color: #fb7185; }
.indicator-context .delta-flat { color: #94a3b8; }
#temporalCycleDetails[hidden], #natalModeNotice[hidden], #cycleStageContentCard[hidden] { display: none !important; }

/* ==========================================================================
   SACRED TOOLTIP ENGINE - TOP-LAYER, BOUNDARY-SAFE, ZERO-DRIFT TOOLTIP SYSTEM
   ========================================================================== */
.sacred-rich-tooltip {
  position: fixed;
  z-index: 1000005;
  max-width: min(440px, calc(100vw - 24px));
  min-width: 250px;
  max-height: min(480px, calc(100vh - 36px));
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  background: rgba(10, 15, 29, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.85), 0 0 20px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  pointer-events: auto;
  font-family: var(--font-sans, system-ui, sans-serif);
  line-height: 1.5;
  color: #f1f5f9;
  opacity: 0;
  transform: translateY(4px) scale(0.97);
  transition: opacity 0.15s cubic-bezier(0.16, 1, 0.3, 1), transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
}

.sacred-rich-tooltip::-webkit-scrollbar {
  width: 4px;
}
.sacred-rich-tooltip::-webkit-scrollbar-track {
  background: transparent;
}
.sacred-rich-tooltip::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.sacred-rich-tooltip.active {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Dải màu nhận diện trên đỉnh Tooltip */
.sacred-rich-tooltip::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12px;
  right: 12px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--gold-400, #facc15);
}

.sacred-rich-tooltip.theme-gold::before { background: linear-gradient(90deg, #eab308, #f59e0b); }
.sacred-rich-tooltip.theme-gold { border-color: rgba(234, 179, 8, 0.5); box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.85), 0 0 20px rgba(234, 179, 8, 0.28); }

.sacred-rich-tooltip.theme-cyan::before { background: linear-gradient(90deg, #0284c7, #38bdf8); }
.sacred-rich-tooltip.theme-cyan { border-color: rgba(56, 189, 248, 0.45); box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.85), 0 0 18px rgba(56, 189, 248, 0.25); }

.sacred-rich-tooltip.theme-gift::before,
.sacred-rich-tooltip.theme-emerald::before { background: linear-gradient(90deg, #10b981, #34d399); }
.sacred-rich-tooltip.theme-gift,
.sacred-rich-tooltip.theme-emerald { border-color: rgba(16, 185, 129, 0.5); box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.85), 0 0 22px rgba(16, 185, 129, 0.28); }

.sacred-rich-tooltip.theme-shadow::before { background: linear-gradient(90deg, #f43f5e, #fb7185); }
.sacred-rich-tooltip.theme-shadow { border-color: rgba(244, 63, 94, 0.45); box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.85), 0 0 18px rgba(244, 63, 94, 0.25); }

.sacred-rich-tooltip.theme-siddhi::before { background: linear-gradient(90deg, #a855f7, #c084fc); }
.sacred-rich-tooltip.theme-siddhi { border-color: rgba(168, 85, 247, 0.45); box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.85), 0 0 20px rgba(168, 85, 247, 0.25); }

.sacred-rich-tooltip.theme-chakra::before,
.sacred-rich-tooltip.theme-purple::before { background: linear-gradient(90deg, #8b5cf6, #ec4899, #f59e0b); }
.sacred-rich-tooltip.theme-chakra,
.sacred-rich-tooltip.theme-purple { border-color: rgba(168, 85, 247, 0.45); box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.85), 0 0 22px rgba(168, 85, 247, 0.28); }

/* Các khối nội dung bên trong SacredTooltip */
.srt-header,
.srt-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

.srt-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}
.srt-badge.gold { background: rgba(234, 179, 8, 0.2); color: #fde047; border: 1px solid rgba(234, 179, 8, 0.45); }
.srt-badge.cyan { background: rgba(56, 189, 248, 0.2); color: #bae6fd; border: 1px solid rgba(56, 189, 248, 0.4); }
.srt-badge.gift, .srt-badge.emerald { background: rgba(16, 185, 129, 0.22); color: #a7f3d0; border: 1px solid rgba(16, 185, 129, 0.45); }
.srt-badge.shadow { background: rgba(244, 63, 94, 0.2); color: #fda4af; border: 1px solid rgba(244, 63, 94, 0.4); }
.srt-badge.siddhi { background: rgba(168, 85, 247, 0.2); color: #e9d5ff; border: 1px solid rgba(168, 85, 247, 0.4); }
.srt-badge.chakra, .srt-badge.purple { background: rgba(168, 85, 247, 0.22); color: #d8b4fe; border: 1px solid rgba(168, 85, 247, 0.45); }

.srt-sub {
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 600;
}

.srt-cross {
  font-size: 0.68rem;
  color: #fde047;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(234, 179, 8, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
}

.srt-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.25rem;
  line-height: 1.35;
}

.srt-subtitle {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-bottom: 0.35rem;
}

.srt-val-box {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--gold-300, #fde047);
  margin-bottom: 0.35rem;
  padding: 2px 7px;
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.22);
  border-radius: 4px;
  display: inline-block;
}

.srt-meaning {
  font-size: 0.74rem;
  color: #cbd5e1;
  line-height: 1.45;
  margin-bottom: 0.4rem;
}

.srt-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.35rem;
  margin: 0.4rem 0;
}

.srt-metric-item {
  background: rgba(15, 23, 42, 0.6);
  padding: 4px 7px;
  border-radius: 5px;
  font-size: 0.71rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Sacred Tooltip Metric Rows (Dual CK & Year) */
.srt-dual-metrics {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.35rem 0 0.45rem 0;
  padding: 0.45rem 0.6rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.srt-metric-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  line-height: 1.35;
}

.srt-metric-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 1px 6px;
  border-radius: 4px;
  line-height: 1.2;
}

.srt-metric-tag.tag-cycle {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.45);
}

.srt-metric-tag.tag-year {
  background: rgba(253, 224, 71, 0.2);
  color: #fde047;
  border: 1px solid rgba(253, 224, 71, 0.45);
}

.srt-metric-tag.tag-gold {
  background: rgba(234, 179, 8, 0.2);
  color: #fde047;
  border: 1px solid rgba(234, 179, 8, 0.45);
}

.srt-metric-tag.tag-purple {
  background: rgba(168, 85, 247, 0.2);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.45);
}

.srt-metric-name {
  color: #94a3b8;
  font-size: 0.75rem;
}

.srt-metric-val {
  font-weight: 700;
  font-size: 0.85rem;
}

.srt-metric-val.val-cycle {
  color: #38bdf8;
}

.srt-metric-val.val-year {
  color: #fde047;
}

.srt-metric-total {
  font-size: 0.72rem;
  color: #cbd5e1;
  font-weight: normal;
  margin-left: 0.25rem;
}

.srt-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.7rem;
  color: #94a3b8;
  margin-top: 0.25rem;
  margin-bottom: 0.35rem;
  padding: 2px 4px;
}

.srt-tip {
  font-size: 0.71rem;
  color: #94a3b8;
  background: rgba(0, 0, 0, 0.35);
  border-left: 2px solid var(--gold-400, #facc15);
  border-radius: 0 4px 4px 0;
  padding: 0.3rem 0.5rem;
  line-height: 1.4;
  margin-top: 0.35rem;
}
.srt-tip strong {
  color: var(--gold-300, #fde047);
}

.srt-receptive-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(56, 189, 248, 0.12);
  color: #bae6fd;
  border: 1px dashed rgba(56, 189, 248, 0.45);
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 0.3rem;
  line-height: 1.35;
}

.srt-transmitting-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(234, 179, 8, 0.15);
  color: #fde047;
  border: 1px solid rgba(234, 179, 8, 0.45);
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 0.3rem;
  line-height: 1.35;
}

.srt-qliphoth-alert {
  background: rgba(244, 63, 94, 0.14);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.45);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.71rem;
  font-weight: 500;
  margin-top: 0.35rem;
  line-height: 1.35;
}

.srt-wisdom-box {
  background: rgba(0, 0, 0, 0.3);
  border-left: 2px solid #38bdf8;
  border-radius: 0 4px 4px 0;
  padding: 0.28rem 0.5rem;
  font-size: 0.71rem;
  color: #cbd5e1;
  margin-top: 0.25rem;
  line-height: 1.35;
}

.srt-wisdom-box strong {
  color: #7dd3fc;
}

/* Sacred Tooltip 3D Semantic Taxonomy (#Competency, #Shadow, #Environment) */
.srt-tags-3d {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.45rem 0;
  padding: 0.5rem 0.65rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.srt-tag-row {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  font-size: 0.73rem;
  line-height: 1.4;
}

.srt-tag-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 1px;
}

.srt-tag-row.tag-competency .srt-tag-chip {
  background: rgba(16, 185, 129, 0.22);
  color: #a7f3d0;
  border: 1px solid rgba(16, 185, 129, 0.45);
}

.srt-tag-row.tag-shadow .srt-tag-chip {
  background: rgba(244, 63, 94, 0.22);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.45);
}

.srt-tag-row.tag-environment .srt-tag-chip {
  background: rgba(56, 189, 248, 0.2);
  color: #bae6fd;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.srt-tag-text {
  color: #e2e8f0;
  flex: 1;
}

/* Sacred Tooltip 7-Segment Kabbalistic Ascent Mini-Bars */
.srt-ascent-box {
  margin: 0.4rem 0 0.45rem 0;
  padding: 0.45rem 0.65rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(234, 179, 8, 0.25);
  border-radius: 8px;
}

.srt-ascent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
}

.srt-ascent-title {
  color: #fde047;
  font-weight: 700;
}

.srt-ascent-val {
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 600;
}

.srt-ascent-bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  height: 6px;
}

.srt-ascent-seg {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  transition: all 0.2s ease;
}

.srt-ascent-seg.active {
  background: linear-gradient(90deg, #eab308, #f59e0b);
  box-shadow: 0 0 6px rgba(234, 179, 8, 0.5);
}

/* Option B Lock Teaser Styles */
.srt-lock-header {
  border-bottom-color: rgba(244, 63, 94, 0.3);
}

.srt-lock-teaser {
  margin-top: 0.45rem;
  padding: 0.55rem 0.7rem;
  background: rgba(30, 41, 59, 0.7);
  border: 1px dashed rgba(244, 63, 94, 0.35);
  border-radius: 8px;
}

.srt-lock-desc {
  font-size: 0.73rem;
  color: #cbd5e1;
  line-height: 1.45;
  margin-bottom: 0.55rem;
}

.srt-lock-action {
  display: flex;
  justify-content: flex-end;
}

.srt-lock-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fde047;
  background: rgba(234, 179, 8, 0.18);
  border: 1px solid rgba(234, 179, 8, 0.45);
  border-radius: 6px;
  padding: 3px 9px;
  text-decoration: none;
  transition: all 0.15s ease;
}
.srt-lock-btn:hover {
  background: rgba(234, 179, 8, 0.32);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.35);
}

/* Frontend In-Place Hover Tier Editor (Super Admin Only) */
.in-place-tier-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 0.35rem;
  vertical-align: middle;
}

.in-place-tier-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 1px 6px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.in-place-tier-pill.tier-public {
  background: rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.35);
}
.in-place-tier-pill.tier-basic {
  background: rgba(56, 189, 248, 0.2);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.4);
}
.in-place-tier-pill.tier-advanced {
  background: rgba(168, 85, 247, 0.2);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.45);
}
.in-place-tier-pill.tier-vip {
  background: rgba(234, 179, 8, 0.22);
  color: #fde047;
  border: 1px solid rgba(234, 179, 8, 0.5);
  box-shadow: 0 0 8px rgba(234, 179, 8, 0.25);
}
.in-place-tier-pill:hover {
  filter: brightness(1.2);
  transform: translateY(-1px);
}

.in-place-tier-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 1000010;
  min-width: 110px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.in-place-tier-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  font-size: 0.68rem;
  font-weight: 600;
  color: #e2e8f0;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.in-place-tier-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}
.in-place-tier-item.active {
  background: rgba(234, 179, 8, 0.2);
  color: #fde047;
  font-weight: 700;
}

/* ==========================================================================
   UNIFIED COMPONENTS & CROSS-DISCIPLINE RESONANCE
   ========================================================================== */
.cross-resonance-section {
  margin-top: 0.9rem;
  padding: 0.85rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  backdrop-filter: blur(10px);
}

.cross-resonance-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #fde047;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cross-resonance-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
  user-select: none;
}

.cross-resonance-btn.cyan {
  background: rgba(14, 165, 233, 0.15);
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.4);
}
.cross-resonance-btn.cyan:hover {
  background: rgba(14, 165, 233, 0.3);
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}

.cross-resonance-btn.emerald {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.4);
}
.cross-resonance-btn.emerald:hover {
  background: rgba(16, 185, 129, 0.3);
  border-color: #34d399;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.4);
  transform: translateY(-1px);
}

.cross-resonance-btn.gold {
  background: rgba(234, 179, 8, 0.15);
  color: #fde047;
  border-color: rgba(234, 179, 8, 0.4);
}
.cross-resonance-btn.gold:hover {
  background: rgba(234, 179, 8, 0.3);
  border-color: #facc15;
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.4);
  transform: translateY(-1px);
}

.cross-resonance-btn.purple {
  background: rgba(168, 85, 247, 0.15);
  color: #d8b4fe;
  border-color: rgba(192, 132, 252, 0.4);
}
.cross-resonance-btn.purple:hover {
  background: rgba(168, 85, 247, 0.3);
  border-color: #c084fc;
  box-shadow: 0 0 10px rgba(192, 132, 252, 0.4);
  transform: translateY(-1px);
}

.inspector-connected-pill.clickable-pill {
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
}
.inspector-connected-pill.clickable-pill:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.35);
  transform: translateY(-1px);
}

.gate-act-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 0.74rem;
  font-weight: 600;
  margin-right: 4px;
  margin-bottom: 4px;
}
.gate-act-tag.personality {
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.35);
}
.gate-act-tag.design {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

/* ==========================================================================
   RESPONSIVE CONTAINER QUERIES (CHỐNG BỊ BẦU / CẮT MẤT TRÊN CÁC PANEL HẸP)
   ========================================================================== */
.analytics-panel,
.inspector-panel-content,
.inspector-card,
.overview-panel-content,
.unified-card {
  container-type: inline-size;
  container-name: inspector;
}

@container inspector (max-width: 850px) {
  .holistic-triad-grid {
    grid-template-columns: 1fr !important;
  }
}

@container inspector (max-width: 520px) {
  .inspector-grid {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
  }
  .inspector-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
  }
  .inspector-hebrew-big {
    align-self: flex-start !important;
  }
  .primary-metrics-grid {
    grid-template-columns: 1fr !important;
  }
  .cross-resonance-btn {
    width: 100% !important;
    justify-content: center !important;
  }
}

/* ==========================================================================
   MOBILE ACCESSIBILITY & TOUCH TARGET OPTIMIZATIONS (WCAG 44px+)
   ========================================================================== */
@media (max-width: 768px) {
  .btn-header,
  .btn-tool-action,
  .btn-load-history,
  .history-search-wrap,
  .btn-close-modal,
  .shmita-pill-btn,
  .scope-btn,
  .nav-tab-btn {
    min-height: 44px;
  }

  .history-modal-overlay {
    padding: 0.5rem;
  }

  .history-modal-container {
    max-height: 92vh;
    border-radius: 14px;
  }

  .history-modal-toolbar {
    padding: 0.6rem 1rem;
    gap: 0.5rem;
  }

  .history-search-wrap {
    min-width: 100%;
  }

  .history-toolbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .history-item-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .btn-load-history {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}

/* ==========================================================================
   USER AUTHENTICATION, RBAC & ACCESS GATEWAY STYLES
   ========================================================================== */

/* Header buttons & Pills */
.btn-header-admin {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.25) 0%, rgba(202, 138, 4, 0.35) 100%) !important;
  border-color: var(--gold-400) !important;
  color: var(--gold-300) !important;
  box-shadow: 0 0 12px rgba(234, 179, 8, 0.25);
  font-weight: 700;
}
.btn-header-admin:hover {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.45) 0%, rgba(202, 138, 4, 0.55) 100%) !important;
  box-shadow: 0 0 18px rgba(234, 179, 8, 0.5);
  transform: translateY(-1px);
}

.btn-header-auth {
  background: rgba(15, 23, 42, 0.8) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  color: #f8fafc !important;
}
.btn-header-auth:hover {
  border-color: var(--gold-400) !important;
  background: rgba(30, 41, 59, 0.9) !important;
}

.role-badge-pill {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  vertical-align: middle;
  margin-left: 4px;
}
.role-badge-pill.admin {
  background: rgba(234, 179, 8, 0.2);
  color: #fde047;
  border: 1px solid rgba(234, 179, 8, 0.5);
}
.role-badge-pill.editor {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.5);
}
.role-badge-pill.user {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.4);
}
.role-badge-pill.viewer {
  background: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.3);
}

.status-badge-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.status-badge-pill.status-approved {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.5);
}
.status-badge-pill.status-pending {
  background: rgba(234, 179, 8, 0.2);
  color: #fde047;
  border: 1px solid rgba(234, 179, 8, 0.5);
}

/* Application Access Banner */
.app-access-banner {
  width: 100%;
  padding: 0.65rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  animation: fadeInDown 0.3s ease-out;
  position: relative;
  z-index: 50;
}
.app-access-banner.banner-locked {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.22) 0%, rgba(185, 28, 28, 0.35) 100%);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fecaca;
}
.app-access-banner.banner-pending {
  background: linear-gradient(90deg, rgba(234, 179, 8, 0.2) 0%, rgba(180, 83, 9, 0.3) 100%);
  border-color: rgba(234, 179, 8, 0.4);
  color: #fef08a;
}
.app-access-banner.banner-limited {
  background: linear-gradient(90deg, rgba(234, 179, 8, 0.22) 0%, rgba(202, 138, 4, 0.35) 100%);
  border-color: rgba(234, 179, 8, 0.45);
  color: #fef08a;
}
.app-access-banner.banner-invite {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.22) 0%, rgba(13, 148, 136, 0.35) 100%);
  border-color: rgba(16, 185, 129, 0.5);
  color: #a7f3d0;
}

/* Limited Mode: Hiding Indicators & Detailed Interpretations for Guests */
body.limited-mode .line-level-meter,
body.limited-mode .unit-scale-badges,
body.limited-mode .metric-benchmark-bar,
body.limited-mode .hd-profile-dual-meter,
body.limited-mode .frequency-spectrum-box {
  display: none !important;
}

.limited-locked-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px dashed rgba(234, 179, 8, 0.4);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 0.5rem 0;
  text-align: center;
  color: #cbd5e1;
}
.limited-locked-box .limited-icon {
  font-size: 1.4rem;
  display: block;
  margin-bottom: 0.25rem;
}
.limited-locked-box .limited-title {
  font-weight: 700;
  color: #facc15;
  font-size: 0.88rem;
  margin-bottom: 0.2rem;
}
.limited-locked-box .limited-desc {
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.4;
}
.limited-locked-box a {
  color: #38bdf8;
  font-weight: 600;
  text-decoration: underline;
}
.access-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1400px;
  margin: 0 auto;
}
.access-banner-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}
.access-banner-text-wrap {
  flex: 1;
  font-size: 0.88rem;
  line-height: 1.4;
}
.btn-banner-action {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid currentColor;
  color: inherit;
  font-weight: 700;
  padding: 0.35rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}
.btn-banner-action:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

/* ==========================================================================
   AUTH MODAL STYLING
   ========================================================================== */
.auth-modal-overlay,
.admin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.25s ease-out;
}

.auth-modal-container {
  background: linear-gradient(145deg, rgba(13, 19, 36, 0.95) 0%, rgba(7, 10, 20, 0.98) 100%);
  border: 1px solid var(--bg-card-border);
  box-shadow: var(--box-glow), 0 0 30px rgba(0, 0, 0, 0.9);
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.auth-modal-header,
.admin-modal-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 15, 30, 0.5);
}

.auth-modal-title,
.admin-modal-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.auth-modal-title .icon,
.admin-modal-title .icon {
  font-size: 1.6rem;
}
.auth-modal-title h3,
.admin-modal-title h3 {
  font-family: var(--font-sacred);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold-300);
  letter-spacing: 0.5px;
  margin: 0;
}
.auth-modal-subtitle,
.admin-modal-subtitle {
  font-size: 0.75rem;
  color: #94a3b8;
  margin: 0;
}

.auth-modal-nav,
.admin-modal-nav {
  display: flex;
  background: rgba(7, 10, 20, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.35rem 0.5rem;
  gap: 0.35rem;
  overflow-x: auto;
}

.auth-tab-btn,
.admin-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.auth-tab-btn:hover,
.admin-tab-btn:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.05);
}
.auth-tab-btn.active,
.admin-tab-btn.active {
  color: var(--gold-300);
  background: rgba(234, 179, 8, 0.15);
  border-color: rgba(234, 179, 8, 0.4);
}

.auth-panel,
.admin-tab-panel {
  display: none;
  padding: 1.5rem;
}
.auth-panel.active,
.admin-tab-panel.active {
  display: block;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.btn-auth-submit {
  width: 100%;
  background: linear-gradient(135deg, #facc15 0%, #ca8a04 100%);
  color: #0f172a;
  border: none;
  font-weight: 700;
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(234, 179, 8, 0.3);
  transition: all 0.2s ease;
}
.btn-auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(234, 179, 8, 0.45);
}
.btn-auth-submit.btn-register {
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}

.auth-alert-message {
  padding: 0.65rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  line-height: 1.4;
}
.auth-alert-message.alert-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}
.auth-alert-message.alert-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #86efac;
}

.auth-panel-footer {
  text-align: center;
  font-size: 0.85rem;
  color: #94a3b8;
  margin-top: 1.25rem;
}
.auth-panel-footer a {
  color: var(--gold-400);
  text-decoration: underline;
  font-weight: 600;
}

.auth-notice-card {
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.45;
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input-wrapper .form-input {
  padding-right: 2.6rem;
}

.btn-toggle-password {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  padding: 0.25rem 0.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  line-height: 1;
  transition: color 0.2s ease, transform 0.15s ease;
  user-select: none;
}

.btn-toggle-password:hover {
  color: var(--gold-400);
  transform: translateY(-50%) scale(1.1);
}

.btn-toggle-password:focus-visible {
  outline: 2px solid var(--gold-400);
  border-radius: 4px;
}

.profile-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  background: rgba(15, 23, 42, 0.5);
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.profile-field-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.profile-field-row .label {
  font-size: 0.75rem;
  color: #94a3b8;
}
.profile-field-row .val {
  font-size: 0.9rem;
  font-weight: 600;
  color: #f8fafc;
}
.auth-divider {
  text-align: center;
  position: relative;
  margin: 1.5rem 0 1rem;
}
.auth-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.auth-divider span {
  position: relative;
  background: rgba(13, 19, 36, 1);
  padding: 0 0.75rem;
  font-size: 0.8rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   ADMIN CONTROL CENTER MODAL
   ========================================================================== */
.admin-modal-container {
  background: linear-gradient(145deg, rgba(13, 19, 36, 0.98) 0%, rgba(5, 7, 15, 0.99) 100%);
  border: 1px solid rgba(234, 179, 8, 0.35);
  box-shadow: var(--box-glow), 0 0 50px rgba(0, 0, 0, 0.95);
  border-radius: 18px;
  width: 95vw;
  max-width: 1200px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-tab-panel {
  overflow-y: auto;
  max-height: calc(90vh - 130px);
}

.admin-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-stat-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
}
.admin-stat-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}
.admin-stat-card.highlight-pending {
  border-color: rgba(234, 179, 8, 0.5);
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.1) 0%, rgba(15, 23, 42, 0.7) 100%);
}
.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.stat-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.5px;
}
.stat-icon {
  font-size: 1.15rem;
}
.stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: #f8fafc;
  margin: 0.35rem 0;
  font-family: var(--font-sacred);
}
.stat-subtitle {
  font-size: 0.75rem;
  color: #94a3b8;
}
.stat-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}
.stat-badge.badge-public {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.5);
}
.stat-badge.badge-restricted {
  background: rgba(239, 68, 68, 0.25);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.5);
}

.admin-quick-actions-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.25rem;
}
.admin-quick-actions-box h4 {
  color: var(--gold-300);
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}
.admin-quick-actions-box ul {
  padding-left: 1.25rem;
  color: #cbd5e1;
  font-size: 0.85rem;
  line-height: 1.6;
}

/* User Table */
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.admin-search-wrap {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  min-width: 280px;
  flex: 1;
}
.admin-search-input {
  background: transparent;
  border: none;
  color: #f8fafc;
  outline: none;
  font-size: 0.85rem;
  width: 100%;
  margin-left: 0.5rem;
}
.admin-toolbar-filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.admin-filter-select {
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
}

.admin-table-container {
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(10, 15, 30, 0.4);
}
.admin-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.admin-data-table th {
  background: rgba(15, 23, 42, 0.95);
  color: #94a3b8;
  text-align: left;
  padding: 0.85rem 1rem;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.admin-data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}
.admin-data-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.user-cell-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.user-avatar-sm {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8 0%, #1e40af 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #ffffff;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.user-cell-name {
  font-weight: 600;
  color: #f1f5f9;
}
.user-cell-sub {
  font-size: 0.75rem;
  color: #94a3b8;
}

.admin-role-select {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f8fafc;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
}

.user-status-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.user-status-pill.status-approved {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}
.user-status-pill.status-pending {
  background: rgba(234, 179, 8, 0.2);
  color: #fde047;
}
.user-status-pill.status-suspended {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.admin-actions-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
}
.btn-table-action {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}
.btn-table-action.btn-approve {
  background: rgba(16, 185, 129, 0.25);
  border-color: rgba(16, 185, 129, 0.6);
  color: #34d399;
}
.btn-table-action.btn-approve:hover {
  background: rgba(16, 185, 129, 0.45);
  transform: translateY(-1px);
}
.btn-table-action.btn-suspend {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}
.btn-table-action.btn-unlock {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}
.btn-table-action.btn-delete {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
  color: #94a3b8;
}
.btn-table-action.btn-delete:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #f87171;
}

/* Config Section Cards */
.admin-config-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.config-section-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1.5rem;
}
.config-section-card .section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.config-section-card .section-title span {
  font-size: 1.4rem;
}
.config-section-card .section-title h4 {
  font-size: 1rem;
  color: var(--gold-300);
  margin: 0;
}
.config-section-card .section-title .subtitle {
  font-size: 0.78rem;
  color: #94a3b8;
  margin: 0;
}

.mode-selection-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.mode-card-radio {
  display: block;
  cursor: pointer;
  position: relative;
}
.mode-card-radio input[type="radio"] {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  accent-color: var(--gold-400);
  width: 18px;
  height: 18px;
}
.mode-card-content {
  background: rgba(10, 15, 30, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.25rem;
  transition: all 0.2s ease;
  height: 100%;
}
.mode-card-radio input[type="radio"]:checked + .mode-card-content {
  border-color: var(--gold-400);
  background: rgba(234, 179, 8, 0.08);
  box-shadow: 0 0 15px rgba(234, 179, 8, 0.2);
}
.mode-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.mode-badge.public {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}
.mode-badge.restricted {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}
.mode-card-desc {
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.45;
  margin: 0;
}

/* Switch Toggles */
.toggle-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.toggle-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-width: 80%;
}
.toggle-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #f1f5f9;
}
.toggle-desc {
  font-size: 0.78rem;
  color: #94a3b8;
}

.switch-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-toggle .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.2);
  transition: 0.25s;
  border-radius: 34px;
}
.switch-toggle .slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s;
  border-radius: 50%;
}
.switch-toggle input:checked + .slider {
  background-color: var(--gold-400);
}
.switch-toggle input:checked + .slider:before {
  transform: translateX(20px);
  background-color: #04050a;
}

.feature-toggles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}
.feature-toggle-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  background: rgba(10, 15, 30, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
}
.feature-toggle-pill input {
  accent-color: var(--gold-400);
}

.btn-save-config {
  background: linear-gradient(135deg, #facc15 0%, #ca8a04 100%);
  color: #0f172a;
  border: none;
  font-weight: 700;
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(234, 179, 8, 0.3);
  transition: all 0.2s ease;
}
.btn-save-config:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(234, 179, 8, 0.45);
}

.webhook-test-result {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
}
.webhook-test-result.testing {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}
.webhook-test-result.success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.webhook-test-result.error {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

/* Audit Log List */
.admin-audit-log-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.audit-log-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}
.audit-log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}
.audit-action-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  font-family: monospace;
}
.audit-action-tag.default {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
}
.audit-action-tag.approve {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}
.audit-action-tag.config {
  background: rgba(234, 179, 8, 0.2);
  color: #fde047;
}
.audit-action-tag.delete {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}
.audit-time {
  font-size: 0.75rem;
  color: #94a3b8;
}
.audit-log-body {
  font-size: 0.82rem;
  color: #e2e8f0;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .mode-selection-grid {
    grid-template-columns: 1fr;
  }
  .admin-metrics-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ==========================================================================
   AI AGENT INTEGRATION PROMPT MODAL & M2M CONTROLS (PHASE 4)
   ========================================================================== */
.ai-prompt-codebox {
  background: #060913 !important;
  color: #e2e8f0;
  padding: 1.25rem;
  border-radius: 8px;
  font-family: 'Fira Code', 'Cascadia Code', Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  max-height: 58vh;
  overflow-y: auto;
  white-space: pre-wrap;
  border: 1px solid rgba(234, 179, 8, 0.25);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
  user-select: text;
}

.ai-prompt-codebox::-webkit-scrollbar {
  width: 8px;
}
.ai-prompt-codebox::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}
.ai-prompt-codebox::-webkit-scrollbar-thumb {
  background: rgba(234, 179, 8, 0.3);
  border-radius: 4px;
}
.ai-prompt-codebox::-webkit-scrollbar-thumb:hover {
  background: var(--gold-500);
}

.btn-copy-ai-prompt {
  background: rgba(234, 179, 8, 0.12) !important;
  border: 1px solid var(--gold-400) !important;
  color: var(--gold-300) !important;
  font-weight: 600 !important;
  transition: all 0.2s ease;
}
.btn-copy-ai-prompt:hover {
  background: var(--gold-500) !important;
  color: #04050a !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(234, 179, 8, 0.3);
}

.btn-reset-totp {
  background: rgba(168, 85, 247, 0.12) !important;
  border: 1px solid rgba(168, 85, 247, 0.4) !important;
  color: #c084fc !important;
}
.btn-reset-totp:hover {
  background: rgba(168, 85, 247, 0.25) !important;
  border-color: #a855f7 !important;
}




/* ==========================================================================
   ACCESSIBILITY & FOCUS VISIBLE (WCAG 2.4.7 COMPLIANCE)
   ========================================================================== */
:focus-visible {
  outline: 2px solid var(--gold-400, #eab308) !important;
  outline-offset: 2px !important;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--gold-400, #eab308) !important;
  outline-offset: 2px !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   CROSS-DISCIPLINARY QUANTITATIVE INDICATOR SUITE & LIGHTNING FLASH UI
   ========================================================================== */
.kabbala-indicator-suite-card,
.hd-vitality-card,
.chakra-coherence-box {
  background: var(--bg-card, rgba(13, 19, 36, 0.72));
  border: 1px solid var(--bg-card-border, rgba(212, 175, 55, 0.22));
  border-radius: 12px;
  padding: 1.1rem;
  backdrop-filter: var(--glass-blur, blur(20px));
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.indicator-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.ascent-label-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: #f1f5f9;
}

.ascent-icon {
  font-size: 1.15rem;
}

.ascent-level-tag,
.bottleneck-tag,
.grounding-status-tag,
.coherence-level-badge,
.hemisphere-tag,
.solfeggio-state-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid var(--gold-400, #facc15);
  color: var(--gold-300, #fde047);
}

.ascent-score-badge {
  font-size: 1.05rem;
  font-weight: 800;
  padding: 0.2rem 0.65rem;
  border-radius: 6px;
  background: rgba(234, 179, 8, 0.15);
  color: var(--gold-400, #facc15);
  border: 1px solid rgba(234, 179, 8, 0.35);
  font-family: var(--font-sacred, serif);
}

.ascent-score-badge.gold {
  color: #facc15;
  border-color: rgba(250, 204, 21, 0.4);
}

.ascent-score-badge.emerald {
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(52, 211, 153, 0.4);
}

.ascent-mini-bars-track {
  display: flex;
  gap: 5px;
  width: 100%;
  height: 12px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 6px;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.mini-bar-seg {
  flex: 1;
  height: 100%;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.mini-bar-seg.full {
  background: linear-gradient(90deg, #ca8a04, #facc15);
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.5);
}

.mini-bar-seg.partial .mini-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  border-radius: 3px;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}

.mini-bar-seg.potential {
  border: 1px dashed rgba(250, 204, 21, 0.4);
  background: rgba(250, 204, 21, 0.08);
}

.ascent-level-hint,
.flash-remedy-text,
.hd-vitality-advice,
.hd-bandwidth-desc,
.cdci-synthesis-text,
.solfeggio-advice-text {
  font-size: 0.8rem;
  color: #cbd5e1;
  line-height: 1.5;
  margin-top: 0.5rem;
}

.flash-descent-steps-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.6rem 0;
}

.flash-step-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.72rem;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

.flash-step-pill.is-bottleneck {
  border-color: #f43f5e;
  background: rgba(244, 63, 94, 0.18);
  color: #fda4af;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.35);
  animation: pulse-border 2s infinite;
}

.olamot-vector-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-top: 0.6rem;
}

.olamot-bar-col {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.75rem;
}

.olamot-bar-label {
  color: #94a3b8;
  font-weight: 500;
}

.olamot-track {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 4px;
  overflow: hidden;
}

.olamot-fill.atziluth { background: #f43f5e; }
.olamot-fill.beriah { background: #38bdf8; }
.olamot-fill.yetzirah { background: #a855f7; }
.olamot-fill.assiah { background: #10b981; }

.olamot-pct {
  font-weight: 700;
  color: #f1f5f9;
}

/* Vitality & Burnout Meters */
.vitality-dual-meter {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.6rem 0;
}

.meter-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.78rem;
  color: #e2e8f0;
}

.meter-track {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 4px;
  overflow: hidden;
}

.meter-fill.vitality {
  height: 100%;
  background: linear-gradient(90deg, #059669, #10b981);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.meter-fill.burnout {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #f43f5e);
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.4);
}

.burnout-badge-pill {
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.burnout-badge-pill.low {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid #10b981;
  color: #34d399;
}

.burnout-badge-pill.elevated {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid #f59e0b;
  color: #fbbf24;
}

.burnout-badge-pill.critical {
  background: rgba(244, 63, 94, 0.18);
  border: 1px solid #f43f5e;
  color: #fda4af;
  animation: pulse-border 2s infinite;
}

/* Bandwidth Split Bar */
.bandwidth-split-bar {
  display: flex;
  gap: 1rem;
  margin: 0.6rem 0;
}

.split-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.78rem;
  color: #e2e8f0;
}

.split-track {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 4px;
  overflow: hidden;
}

.split-fill.logic {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
}

.split-fill.intuition {
  height: 100%;
  background: linear-gradient(90deg, #7c3aed, #c084fc);
}

/* CDCI Coherence Track */
.coherence-progress-track {
  width: 100%;
  height: 10px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 5px;
  overflow: hidden;
  margin: 0.6rem 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.coherence-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #facc15 60%, #10b981 100%);
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.4);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.solfeggio-score-val {
  font-weight: 800;
  color: var(--gold-400, #facc15);
  margin-left: auto;
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.6); }
  70% { box-shadow: 0 0 0 6px rgba(244, 63, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); }
}

@media (max-width: 640px) {
  .olamot-vector-bars {
    grid-template-columns: repeat(2, 1fr);
  }
  .bandwidth-split-bar {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* ==========================================================================
   COACH BRIEF MODAL & GAP REPORT STYLES
   ========================================================================== */
.coach-brief-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 6, 14, 0.88);
  backdrop-filter: blur(16px);
  z-index: 10005;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.coach-brief-modal-overlay.active {
  display: flex;
  animation: hudAppear 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.coach-brief-modal-container {
  width: 100%;
  max-width: 960px;
  max-height: 90vh;
  background: radial-gradient(circle at top right, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(234, 179, 8, 0.35);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 35px rgba(234, 179, 8, 0.15);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.coach-brief-header {
  padding: 1.25rem 1.75rem;
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid rgba(234, 179, 8, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.coach-brief-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.coach-brief-body {
  padding: 1.75rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.coach-brief-card {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 1.25rem;
}

.coach-brief-redflags {
  border-left: 4px solid #f43f5e;
  background: rgba(244, 63, 94, 0.06);
}

.coach-brief-grounding {
  border-left: 4px solid #10b981;
  background: rgba(16, 185, 129, 0.06);
}

/* ==========================================================================
   OPTION B TEASER CARD PLACEHOLDER STYLES
   ========================================================================== */
.section-teaser-placeholder {
  position: relative;
  border: 1px dashed rgba(234, 179, 8, 0.4);
  background: radial-gradient(circle at center, rgba(30, 41, 59, 0.4), rgba(15, 23, 42, 0.7));
  border-radius: 12px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
}

.teaser-lock-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: var(--gold-400);
}

.teaser-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(234, 179, 8, 0.2);
  color: var(--gold-300);
  border: 1px solid rgba(234, 179, 8, 0.4);
}

.teaser-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
}

.teaser-message {
  max-width: 600px;
  color: #94a3b8;
  font-size: 0.9rem;
  line-height: 1.6;
}

.teaser-cta-btn {
  padding: 0.65rem 1.5rem;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--gold-500), #b45309);
  color: #000;
  font-weight: 700;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(234, 179, 8, 0.3);
  transition: all 0.2s ease;
}

.teaser-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(234, 179, 8, 0.5);
}

/* ==========================================================================
   ADMIN IN-PLACE PREVIEW TOOLBAR
   ========================================================================== */
.admin-inplace-toolbar {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9990;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(234, 179, 8, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(234, 179, 8, 0.2);
  border-radius: 12px;
  padding: 0.65rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  backdrop-filter: blur(12px);
}

.admin-inplace-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.admin-inplace-select {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  outline: none;
}

.admin-inplace-btn {
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid var(--gold-400);
  color: var(--gold-300);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-inplace-btn:hover {
  background: var(--gold-400);
  color: #000;
}


/* ==========================================================================
   DEDICATED LOCKOUT SCREEN (CHẾ ĐỘ BẢO MẬT RIÊNG TƯ / LOCK MODE)
   ========================================================================== */
.app-lockout-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 72px);
  padding: 2.5rem 1.25rem;
  background: radial-gradient(circle at center, rgba(30, 27, 75, 0.5) 0%, rgba(7, 10, 20, 0.98) 75%);
  position: relative;
  z-index: 10;
  animation: fadeIn 0.3s ease-out;
  box-sizing: border-box;
}

.lockout-card {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.96) 0%, rgba(7, 10, 20, 0.98) 100%);
  border: 1px solid rgba(234, 179, 8, 0.35);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.85), 0 0 35px rgba(234, 179, 8, 0.18);
  border-radius: 24px;
  max-width: 620px;
  width: 100%;
  padding: 3rem 2.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.lockout-shield-wrap {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: rgba(234, 179, 8, 0.12);
  border: 2px solid var(--gold-400);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  box-shadow: 0 0 25px rgba(234, 179, 8, 0.35);
  animation: pulseGlow 2.5s infinite ease-in-out;
}

.lockout-shield-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.lockout-badge-pill {
  display: inline-block;
  padding: 0.4rem 1.1rem;
  border-radius: 999px;
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.4);
  color: var(--gold-300);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 1.25rem;
}

.lockout-title {
  font-family: var(--font-sacred);
  font-size: 1.45rem;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
  line-height: 1.35;
}

.lockout-description {
  font-size: 0.92rem;
  color: #94a3b8;
  line-height: 1.65;
  margin-bottom: 2rem;
  max-width: 520px;
}

.lockout-action-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
  margin-bottom: 1.5rem;
}

.btn-lockout-action {
  padding: 0.85rem 1.8rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  border: none;
}

.btn-lockout-primary {
  background: linear-gradient(135deg, #facc15 0%, #ca8a04 100%);
  color: #0f172a;
  box-shadow: 0 4px 20px rgba(234, 179, 8, 0.35);
}

.btn-lockout-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(234, 179, 8, 0.5);
}

.btn-lockout-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-lockout-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--gold-400);
  color: var(--gold-300);
}

.btn-lockout-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.btn-lockout-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ffffff;
}

.lockout-footer-note {
  font-size: 0.82rem;
  color: #64748b;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1.25rem;
  width: 100%;
}

.lockout-footer-note a {
  color: var(--gold-400);
  text-decoration: underline;
  cursor: pointer;
}
