/* ==========================================================================
   NEXUS UI SYSTEM — Intuition Club
   Next-Generation Application Architecture & Layout Engine
   ========================================================================== */

/* 1. Global Reset & Layout Root */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: var(--ip-font-sans, 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif);
  background-color: var(--ip-bg-canvas, #FAFAF9);
  color: #1C1917;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.nexus-app {
  display: flex !important;
  width: 100vw !important;
  height: 100vh !important;
  overflow: hidden !important;
  position: relative !important;
  background-color: var(--ip-bg-canvas, #FAFAF9) !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* 2. Left Application Rail (Desktop) */
.nexus-rail,
.nexus-app .nexus-rail.pc-sidebar {
  position: relative !important;
  top: 0 !important;
  left: 0 !important;
  bottom: 0 !important;
  width: 270px !important;
  min-width: 270px !important;
  max-width: 270px !important;
  height: 100vh !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
  background: #FFFFFF !important;
  border-right: 1px solid var(--ip-border, #E7E5E4) !important;
  display: flex !important;
  flex-direction: column !important;
  z-index: 100 !important;
  transition: margin-left 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), width 0.25s ease !important;
  box-shadow: 4px 0 24px -10px rgba(28, 25, 23, 0.05) !important;
}

/* Desktop sidebar collapsed state */
.nexus-app.sidebar-collapsed .nexus-rail,
.nexus-app.sidebar-collapsed .nexus-rail.pc-sidebar,
.nexus-app .nexus-rail.pc-sidebar-hide {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  border-right: none !important;
  visibility: hidden;
  opacity: 0;
}

.nexus-rail-brand {
  height: 70px;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--ip-border, #E7E5E4);
  background: #FFFFFF;
}

.nexus-rail-brand .brand-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}

.nexus-rail-brand .brand-logo img {
  max-height: 38px;
  width: auto;
  object-fit: contain;
}

.nexus-rail-brand .brand-title {
  font-family: var(--ip-font-display, 'Outfit', sans-serif);
  font-weight: 800;
  font-size: 1.15rem;
  color: #1C1917;
  letter-spacing: -0.02em;
  margin: 0;
}

.nexus-rail-nav,
.nexus-app .nexus-rail-nav.navbar-content {
  flex: 1 1 auto;
  overflow: hidden !important;
  overflow-y: hidden !important;
  padding: 1.25rem 0.85rem;
  min-height: 0;
  height: auto !important;
}

/* Ensure single smooth SimpleBar scroll without native duplicate */
.nexus-rail-nav .simplebar-content-wrapper {
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

.nexus-rail-nav .simplebar-track.simplebar-vertical {
  width: 5px !important;
  right: 2px !important;
  background: transparent !important;
}

.nexus-rail-nav .simplebar-track.simplebar-vertical .simplebar-scrollbar:before {
  background: #D6D3D1 !important;
  border-radius: 4px !important;
  left: 0 !important;
  right: 0 !important;
  opacity: 0.6;
}

body[data-pc-theme="dark"] .nexus-rail-nav .simplebar-track.simplebar-vertical .simplebar-scrollbar:before {
  background: #57534E !important;
}

.nexus-nav-section {
  margin-bottom: 1.5rem;
}

.nexus-nav-header {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #A8A29E;
  padding: 0.35rem 0.75rem;
  margin-bottom: 0.25rem;
}

.nexus-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.nexus-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border-radius: var(--ip-radius-control, 12px);
  color: #57534E;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.18s ease;
  position: relative;
}

.nexus-nav-link:hover {
  background: #F5F5F4;
  color: #1C1917;
  transform: translateX(2px);
}

.nexus-nav-link.active {
  background: #FFF7ED;
  color: var(--ip-primary, #EA580C);
  font-weight: 700;
  box-shadow: 0 2px 8px -2px var(--ip-primary-glow, rgba(234, 88, 12, 0.25));
}

.nexus-nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  bottom: 15%;
  width: 3.5px;
  background: var(--ip-primary, #EA580C);
  border-radius: 0 4px 4px 0;
}

.nexus-nav-item-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nexus-nav-icon {
  font-size: 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #78716C;
  transition: color 0.18s ease;
}

.nexus-nav-link.active .nexus-nav-icon {
  color: var(--ip-primary, #EA580C);
}

.nexus-nav-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  background: #E7E5E4;
  color: #44403C;
}

.nexus-nav-link.active .nexus-nav-badge {
  background: var(--ip-primary, #EA580C);
  color: #FFFFFF;
}

/* Submenu in Rail */
.nexus-subnav-list {
  list-style: none;
  padding: 0.25rem 0 0.25rem 2.5rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.nexus-subnav-link {
  display: block;
  padding: 0.45rem 0.65rem;
  font-size: 0.8125rem;
  color: #78716C;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.nexus-subnav-link:hover {
  color: #1C1917;
  background: #F5F5F4;
}

.nexus-subnav-link.active {
  color: var(--ip-primary, #EA580C);
  font-weight: 700;
}

/* Rail Footer */
.nexus-rail-footer {
  padding: 0.9rem 1rem;
  border-top: 1px solid #E2E8F0;
  background: #FFFFFF !important;
}

.nexus-user-dock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.65rem;
  border-radius: var(--ip-radius-control, 12px);
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.nexus-user-dock:hover {
  border-color: #D6D3D1;
  box-shadow: 0 4px 12px -2px rgba(28, 25, 23, 0.06);
}

.nexus-user-dock-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #FFF7ED;
}

.nexus-user-dock-initials {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ip-primary, #EA580C);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}

.nexus-user-dock-meta {
  flex: 1;
  min-width: 0;
  margin-left: 0.65rem;
}

.nexus-user-dock-name {
  font-size: 0.825rem;
  font-weight: 700;
  color: #1C1917;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nexus-user-dock-role {
  font-size: 0.68rem;
  color: #78716C;
  font-weight: 600;
  text-transform: uppercase;
}

/* 3. Main Stage & Topbar */
.nexus-stage,
.nexus-app .nexus-stage {
  flex: 1 1 0% !important;
  min-width: 0 !important;
  width: auto !important;
  max-width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100vh !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  position: relative !important;
  background: var(--ip-bg-canvas, #FAFAF9) !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.nexus-topbar,
.nexus-app .nexus-topbar.pc-header {
  position: relative !important;
  left: 0 !important;
  right: 0 !important;
  top: 0 !important;
  width: 100% !important;
  height: 70px !important;
  min-height: 70px !important;
  max-height: 70px !important;
  padding: 0 1.75rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 1.25rem !important;
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(12px) !important;
  border-bottom: 1px solid var(--ip-border, #E7E5E4) !important;
  z-index: 50 !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
}

.nexus-topbar-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.nexus-toggle-btn {
  display: inline-flex !important;
  background: transparent;
  border: 1px solid var(--ip-border, #E7E5E4);
  border-radius: 10px;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  color: #44403C;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nexus-toggle-btn:hover {
  background: #F5F5F4;
  color: var(--ip-primary, #EA580C);
  border-color: #D6D3D1;
}

.nexus-scope-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: #F5F5F4;
  border: 1px solid #E7E5E4;
  border-radius: 9999px;
  font-size: 0.775rem;
  font-weight: 700;
  color: #44403C;
}

.nexus-scope-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ip-primary, #10B981);
  box-shadow: 0 0 0 3px var(--ip-primary-glow, rgba(16, 185, 129, 0.2));
}

.nexus-topbar-center {
  flex: 1;
  max-width: 480px;
  display: flex;
  align-items: center;
}

.nexus-search-dock {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
}

.nexus-search-dock input {
  width: 100%;
  height: 40px;
  background: #F5F5F4;
  border: 1px solid transparent;
  border-radius: 9999px;
  padding: 0 2.25rem 0 2.4rem;
  font-size: 0.85rem;
  color: #1C1917;
  transition: all 0.2s ease;
}

.nexus-search-dock input:focus {
  background: #FFFFFF;
  border-color: var(--ip-primary, #EA580C);
  outline: none;
  box-shadow: 0 0 0 3px var(--ip-primary-glow, rgba(234, 88, 12, 0.15));
}

.nexus-search-icon {
  position: absolute;
  left: 0.85rem;
  color: #A8A29E;
  pointer-events: none;
  font-size: 1rem;
}

.glass-search-box input,
.glass-search-box .form-control {
  padding-left: 2.35rem !important;
  padding-right: 2.2rem !important;
}

.nexus-search-kbd {
  position: absolute;
  right: 0.75rem;
  font-size: 0.65rem;
  font-weight: 700;
  background: #E7E5E4;
  color: #57534E;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px solid #D6D3D1;
  pointer-events: none;
}

.nexus-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nexus-hud-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 38px;
  padding: 0 0.85rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
}

.nexus-streak-chip {
  background: #FFF1F2;
  color: #E11D48;
  border-color: #FFE4E6;
}

.nexus-streak-chip:hover {
  background: #FFE4E6;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.2);
}

.nexus-points-chip {
  background: #FFFBEB;
  color: #D97706;
  border-color: #FEF3C7;
}

.nexus-points-chip:hover {
  background: #FEF3C7;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.nexus-action-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #F5F5F4;
  border: 1px solid #E7E5E4;
  color: #57534E;
  text-decoration: none;
  position: relative;
  transition: all 0.2s ease;
}

.nexus-action-btn:hover {
  background: #E7E5E4;
  color: #1C1917;
}

.nexus-action-btn::after,
.nexus-action-btn.dropdown-toggle::after {
  display: none !important;
}

.nexus-badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ip-primary, #EA580C);
  border: 2px solid #FFFFFF;
}

/* Crisp, high-contrast notification badge */
.nexus-badge-pill {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9999px;
  background: #EF4444 !important;
  color: #FFFFFF !important;
  font-size: 0.65rem !important;
  font-weight: 800 !important;
  font-family: var(--ip-font-sans, sans-serif) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 2px solid #FFFFFF !important;
  line-height: 1 !important;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4) !important;
  pointer-events: none !important;
}

/* 4. Canvas & Layout Regions */
.nexus-canvas,
.nexus-app .nexus-canvas.pc-container,
.nexus-app .pc-container {
  flex: 1 1 auto !important;
  position: relative !important;
  top: 0 !important;
  margin: 0 !important;
  margin-top: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  min-height: 0 !important;
  height: auto !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 1.25rem 1.75rem 1.75rem !important;
  background: var(--ip-bg-canvas, #FAFAF9) !important;
  scroll-behavior: smooth !important;
}

.nexus-canvas-inner,
.nexus-app .nexus-canvas-inner.pc-content,
.nexus-app .pc-container .pc-content {
  max-width: 1400px;
  margin: 0 auto !important;
  padding: 0 !important;
}

/* Neutralize legacy Able Pro fixed offsets that cause unwanted space */
.pc-container .page-header + .pc-content,
.pc-container .page-header + .row,
[data-pc-layout=color-header] .pc-container,
[data-pc-layout=color-header] .pc-container .page-header {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

.page-header,
.nexus-workspace-header,
.nexus-workspace-header.page-header,
.pc-content .page-header {
  position: static !important;
  top: 0 !important;
  left: 0 !important;
  right: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin-top: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.nexus-footer,
.nexus-app .nexus-footer.pc-footer {
  position: relative !important;
  margin: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 48px !important;
  min-height: 48px !important;
  max-height: 48px !important;
  flex-shrink: 0 !important;
  z-index: 40 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0 1.75rem !important;
  border-top: 1px solid var(--ip-border, #E7E5E4) !important;
  background: #FFFFFF !important;
  font-size: 0.775rem !important;
  color: #78716C !important;
}

/* 5. Modern Workspace Header Block */
.nexus-workspace-header {
  margin-bottom: 1.25rem !important;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.nexus-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.775rem;
  font-weight: 600;
  color: #78716C;
  margin-bottom: 0.4rem;
}

.nexus-breadcrumbs a {
  color: #78716C;
  text-decoration: none;
  transition: color 0.15s;
}

.nexus-breadcrumbs a:hover {
  color: var(--ip-primary, #EA580C);
}

.nexus-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.nexus-page-title {
  font-family: var(--ip-font-display, 'Outfit', sans-serif);
  font-size: 1.75rem;
  font-weight: 800;
  color: #1C1917;
  letter-spacing: -0.025em;
  margin: 0;
  line-height: 1.2;
}

.nexus-header-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background: #FFF7ED;
  color: var(--ip-primary, #EA580C);
  border: 1px solid #FFEDD5;
}

.nexus-header-subtitle {
  font-size: 0.85rem;
  color: #78716C;
  margin-top: 0.35rem;
}

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

/* 6. High-Impact Hero Training Deck */
.nexus-hero-deck {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.nexus-hero-main {
  background: linear-gradient(135deg, #FFF7ED 0%, #FFFFFF 100%);
  border: 1px solid #FED7AA;
  border-radius: var(--ip-radius-card, 16px);
  padding: 1.25rem 1.35rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--ip-shadow-card, 0 10px 30px -5px rgba(28, 25, 23, 0.04));
}

.nexus-hero-main::after {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.2) 0%, transparent 70%);
  pointer-events: none;
}

.nexus-hero-side {
  background: #FFFFFF;
  border: 1px solid var(--ip-border, #E7E5E4);
  border-radius: var(--ip-radius-card, 16px);
  padding: 1.25rem 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--ip-shadow-card, 0 10px 30px -5px rgba(28, 25, 23, 0.04));
}

/* Telemetry Grid */
.nexus-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.nexus-kpi-card {
  background: #FFFFFF;
  border: 1px solid var(--ip-border, #E7E5E4);
  border-radius: var(--ip-radius-card, 20px);
  padding: 1.35rem 1.5rem;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 16px -4px rgba(28, 25, 23, 0.03);
}

.nexus-kpi-card:hover {
  transform: translateY(-2px);
  border-color: #D6D3D1;
  box-shadow: 0 12px 24px -6px rgba(28, 25, 23, 0.06);
}

.nexus-kpi-info .kpi-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #78716C;
  margin-bottom: 0.35rem;
}

.nexus-kpi-info .kpi-value {
  font-family: var(--ip-font-mono, 'JetBrains Mono', monospace);
  font-size: 1.65rem;
  font-weight: 800;
  color: #1C1917;
  margin: 0;
}

.nexus-kpi-icon-orb {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

/* 7. Quest & Challenge Cards */
.nexus-quest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.85rem;
}

.nexus-quest-card {
  background: #FFFFFF;
  border: 1px solid var(--ip-border, #E7E5E4);
  border-radius: var(--ip-radius-card, 14px);
  padding: 0.9rem 1.05rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.nexus-quest-card:hover {
  transform: translateY(-3px);
  border-color: #FED7AA;
  box-shadow: 0 14px 28px -6px rgba(234, 88, 12, 0.08);
}

.nexus-quest-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.55rem;
}

.nexus-quest-title {
  font-family: var(--ip-font-display, 'Outfit', sans-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: #1C1917;
  margin: 0 0 0.35rem 0;
}

.nexus-quest-desc {
  font-size: 0.85rem;
  color: #57534E;
  line-height: 1.45;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nexus-quest-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.65rem;
  border-top: 1px solid #F5F5F4;
}

/* 8. Modern Data Matrix / List Surface */
.nexus-matrix-card {
  background: #FFFFFF;
  border: 1px solid var(--ip-border, #E7E5E4);
  border-radius: var(--ip-radius-card, 20px);
  overflow: hidden;
  box-shadow: 0 6px 20px -4px rgba(28, 25, 23, 0.04);
}

.nexus-toolbar {
  padding: 1.15rem 1.5rem;
  background: #FFFFFF;
  border-bottom: 1px solid var(--ip-border, #E7E5E4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.nexus-table-wrapper {
  overflow-x: auto;
}

.nexus-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.nexus-table th {
  background: #FAFAF9;
  padding: 0.85rem 1.25rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #78716C;
  border-bottom: 1px solid var(--ip-border, #E7E5E4);
  text-align: left;
}

.nexus-table td {
  padding: 1.1rem 1.25rem;
  font-size: 0.875rem;
  color: #292524;
  border-bottom: 1px solid #F5F5F4;
  vertical-align: middle;
}

.nexus-table tr:last-child td {
  border-bottom: none;
}

.nexus-table tr:hover td {
  background: #FAFAF9;
}

/* 9. Podium Showcase (Leaderboard) */
.nexus-podium-deck {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1.5rem;
  padding: 2.5rem 1rem 1rem 1rem;
  margin-bottom: 2rem;
}

.nexus-podium-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 180px;
}

.nexus-podium-pillar {
  width: 100%;
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0.5rem;
  color: #FFFFFF;
  font-weight: 800;
  box-shadow: 0 10px 30px -5px rgba(28, 25, 23, 0.15);
}

.podium-rank-1 { height: 180px; background: linear-gradient(180deg, #F59E0B 0%, #D97706 100%); order: 2; }
.podium-rank-2 { height: 140px; background: linear-gradient(180deg, #94A3B8 0%, #64748B 100%); order: 1; }
.podium-rank-3 { height: 110px; background: linear-gradient(180deg, #D97706 0%, #92400E 100%); order: 3; }

/* 10. Centered Auth Gateway */
.nexus-auth-canvas {
  min-height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--ip-bg-canvas, #FAFAF9);
  background-image: radial-gradient(ellipse 70% 50% at 50% 10%, rgba(234, 88, 12, 0.08), transparent 70%);
  padding: 2.5rem 1.25rem;
  position: relative;
  overflow-y: auto;
}

.nexus-auth-brand-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.nexus-auth-brand-header .brand-logo-img {
  max-height: 52px;
  width: auto;
  object-fit: contain;
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 4px 12px rgba(234, 88, 12, 0.15));
}

.nexus-auth-brand-header .brand-logo-title {
  font-family: var(--ip-font-display, 'Outfit', sans-serif);
  font-size: 1.65rem;
  font-weight: 900;
  color: #1C1917;
  letter-spacing: -0.025em;
  margin-bottom: 0.25rem;
}

.nexus-auth-brand-header .brand-logo-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ip-primary, #EA580C);
  background: #FFF7ED;
  border: 1px solid #FFEDD5;
  border-radius: 9999px;
  padding: 0.2rem 0.75rem;
  letter-spacing: 0.02em;
}

.nexus-auth-card-container {
  width: 100%;
  max-width: 440px;
  background: #FFFFFF;
  border: 1px solid var(--ip-border, #E7E5E4);
  border-radius: var(--ip-radius-card, 24px);
  padding: 2.5rem 2.25rem;
  box-shadow: 0 20px 45px -10px rgba(28, 25, 23, 0.08), 0 4px 12px -2px rgba(28, 25, 23, 0.02);
  margin-bottom: 1.5rem;
  transition: all 0.2s ease;
}

.nexus-auth-card-container.auth-card-wide {
  max-width: 520px;
}

.nexus-auth-card-footer {
  text-align: center;
  font-size: 0.775rem;
  color: #78716C;
}

body[data-pc-theme="dark"] .nexus-auth-canvas {
  background-color: #0C0A09;
  background-image: radial-gradient(ellipse 70% 50% at 50% 10%, rgba(234, 88, 12, 0.15), transparent 70%);
}

body[data-pc-theme="dark"] .nexus-auth-brand-header .brand-logo-title {
  color: #FFFFFF;
}

body[data-pc-theme="dark"] .nexus-auth-card-container {
  background: #1C1917;
  border-color: #44403C;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.6);
}

/* 11. Mobile Floating Dock */
.nexus-mobile-dock {
  position: fixed;
  bottom: 14px;
  left: 14px;
  right: 14px;
  height: 64px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--ip-border, #E7E5E4);
  border-radius: 9999px;
  box-shadow: 0 12px 36px -4px rgba(28, 25, 23, 0.15);
  display: none;
  align-items: center;
  justify-content: space-around;
  padding: 0 1rem;
  z-index: 1000;
}

.nexus-dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #78716C;
  text-decoration: none;
  font-size: 0.65rem;
  font-weight: 700;
  gap: 0.2rem;
  transition: all 0.15s ease;
}

.nexus-dock-item i {
  font-size: 1.25rem;
}

.nexus-dock-item.active {
  color: var(--ip-primary) !important;
}

.nexus-dock-item.active i {
  color: var(--ip-primary) !important;
}

/* 12. Responsive Breakpoints */
@media (max-width: 1024.98px) {
  .nexus-app .nexus-rail,
  .nexus-app .nexus-rail.pc-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 270px !important;
    min-width: 270px !important;
    max-width: 270px !important;
    height: 100vh !important;
    transform: translateX(-100%) !important;
    margin-left: 0 !important;
    z-index: 1050 !important;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.3) !important;
  }

  .nexus-app .nexus-rail.open,
  .nexus-app .nexus-rail.mob-sidebar-active {
    transform: translateX(0) !important;
  }

  .nexus-app .nexus-stage {
    width: 100% !important;
  }

  .nexus-hero-deck {
    grid-template-columns: 1fr;
  }

  .nexus-mobile-dock {
    display: flex;
  }

  .nexus-canvas {
    padding-bottom: 90px; /* accommodate bottom dock */
  }
}

/* Mobile backdrop */
.nexus-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  z-index: 1040;
  display: none;
}
.nexus-backdrop.show {
  display: block;
}

/* 13. Form Split Studio & Entity Previews */
.form-split-workspace {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 2rem;
}

.form-glass-card {
  background: #FFFFFF;
  border: 1px solid var(--ip-border, #E7E5E4);
  border-radius: var(--ip-radius-card, 20px);
  padding: 2.25rem;
  box-shadow: 0 4px 20px -4px rgba(28, 25, 23, 0.04);
}

.form-preview-card {
  background: #FFFFFF;
  border: 1px solid var(--ip-border, #E7E5E4);
  border-radius: var(--ip-radius-card, 20px);
  padding: 1.75rem;
  box-shadow: 0 4px 20px -4px rgba(28, 25, 23, 0.04);
  position: sticky;
  top: 1.5rem;
}

.form-section-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-bottom: 0.85rem;
  margin-bottom: 1.35rem;
  border-bottom: 1px solid #F5F5F4;
}

.section-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #FFF7ED;
  color: var(--ip-primary, #EA580C);
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid #FED7AA;
}

/* 14. Gamified Podium */
.gamified-podium-container {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem 1rem 1.5rem 1rem;
  margin-bottom: 2rem;
}

.podium-card {
  background: #FFFFFF;
  border: 1px solid var(--ip-border, #E7E5E4);
  border-radius: var(--ip-radius-card, 20px);
  padding: 1.75rem 1.25rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 220px;
  box-shadow: 0 10px 30px -5px rgba(28, 25, 23, 0.06);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.podium-card.rank-1 {
  transform: translateY(-20px);
  border-color: #FBBF24;
  box-shadow: 0 16px 36px -6px rgba(245, 158, 11, 0.22);
  order: 2;
  background: linear-gradient(180deg, #FFFBEB 0%, #FFFFFF 100%);
}

.podium-card.rank-2 {
  order: 1;
  border-color: #CBD5E1;
}

.podium-card.rank-3 {
  order: 3;
  border-color: #FED7AA;
}

.podium-avatar-ring {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--ip-grad-primary, linear-gradient(135deg, #F59E0B 0%, #EA580C 100%));
  color: #FFFFFF;
  font-weight: 800;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
  position: relative;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.3);
}

.podium-card.rank-2 .podium-avatar-ring {
  background: linear-gradient(135deg, #94A3B8 0%, #64748B 100%);
  box-shadow: 0 4px 14px rgba(100, 116, 139, 0.3);
}

.podium-card.rank-3 .podium-avatar-ring {
  background: linear-gradient(135deg, #F97316 0%, #C2410C 100%);
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.3);
}

.podium-rank-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #1C1917;
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #FFFFFF;
}

.podium-crown {
  color: #F59E0B;
  font-size: 1.6rem;
  margin-bottom: 0.35rem;
  filter: drop-shadow(0 2px 4px rgba(245, 158, 11, 0.4));
}

.podium-name {
  font-weight: 700;
  font-size: 1rem;
  color: #1C1917;
  margin-bottom: 0.2rem;
}

.podium-chapter {
  font-size: 0.75rem;
  color: #78716C;
  margin-bottom: 0.65rem;
}

.podium-points {
  font-family: var(--ip-font-mono, monospace);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--ip-primary, #EA580C);
}

@media (max-width: 991px) {
  .form-split-workspace {
    grid-template-columns: 1fr;
  }
  .gamified-podium-container {
    flex-direction: column;
    align-items: center;
  }
  .podium-card.rank-1, .podium-card.rank-2, .podium-card.rank-3 {
    order: unset;
    transform: none;
    width: 100%;
    max-width: 320px;
  }
}
