/**
 * RENALYTICA MASTER SHELL STYLES
 * High-precision styling for TickerBar, HeaderNav, and MegaFooter
 */
@import url('./chat-widget.css');

/* ==========================================================================
   1. TOP UTILITY TICKER BAR (h: 36px)
   ========================================================================== */
ticker-bar {
  display: block;
  width: 100%;
  background-color: #070A10;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  z-index: 100;
}

/* TIER 1: Top Utility Desk & Currency Strip */
.ticker-utility-strip {
  height: 32px;
  background-color: #070A10;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ticker-utility-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  padding-inline: clamp(12px, 2vw, 32px);
}

.ticker-contact-fast {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 11px;
}

.contact-pill {
  color: #F8FAFC;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-sharp);
}

.contact-pill:hover {
  color: var(--accent-momentum);
}

.pulse-dot-green {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #22C55E;
  box-shadow: 0 0 8px #22C55E;
}

.ticker-sep {
  color: #334155;
}

.ticker-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Currency Selector Dropdown */
.currency-dropdown-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #94A3B8;
}

.currency-label {
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #64748B;
}

.currency-select-field {
  background: #111726;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #F8FAFC;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.currency-select-field:hover,
.currency-select-field:focus {
  border-color: var(--accent-momentum);
  box-shadow: 0 0 8px var(--accent-momentum-glow);
}

.portal-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #F8FAFC;
  padding: 3px 9px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-sharp);
  white-space: nowrap;
}

.portal-pill:hover {
  background: rgba(255, 128, 0, 0.15);
  border-color: var(--accent-momentum);
  color: var(--accent-momentum);
}

.portal-signup-pill {
  background: var(--accent-momentum);
  border-color: var(--accent-momentum);
  color: #FFFFFF;
}

.portal-signup-pill:hover {
  background: var(--accent-momentum-hover);
  color: #FFFFFF;
}

/* TIER 2: Dedicated Full-Width Macro Ticker Lane */
.macro-ticker-lane {
  height: 28px;
  background-color: #0B111E;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  overflow: hidden;
  position: relative;
  padding-inline: clamp(12px, 2vw, 32px);
}

.macro-ticker-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  color: var(--accent-momentum);
  letter-spacing: 0.06em;
  padding-right: 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  margin-right: 10px;
  flex-shrink: 0;
  z-index: 2;
  background: #0B111E;
}

.ticker-marquee-track {
  display: flex;
  overflow: hidden;
  white-space: nowrap;
  flex: 1;
  mask-image: linear-gradient(90deg, transparent 0%, black 3%, black 97%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 3%, black 97%, transparent 100%);
}

.ticker-group {
  display: flex;
  align-items: center;
  gap: 28px;
  animation: tickerScroll 42s linear infinite;
  padding-right: 28px;
}

@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

.ticker-marquee-track:hover .ticker-group {
  animation-play-state: paused;
}

.ticker-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #94A3B8;
}

.ticker-symbol {
  color: #64748B;
  font-weight: 700;
}

.ticker-val {
  color: #F8FAFC;
  font-weight: 700;
}

.ticker-change.up {
  color: var(--signal-success);
}
.ticker-change.down {
  color: var(--signal-error);
}
.ticker-change.stable {
  color: var(--accent-momentum);
}

/* ==========================================================================
   2. GLOBAL STICKY NAVIGATION (h: 70px, Overflow-Protected)
   ========================================================================== */
header-nav {
  display: block;
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.site-header {
  position: relative;
  width: 100%;
  height: var(--height-header, 70px);
  background-color: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background-color var(--duration-medium) var(--ease-cinematic),
              border-color var(--duration-medium) var(--ease-cinematic);
}

[data-theme="dark"] .site-header,
.theme-dark .site-header {
  background-color: rgba(11, 15, 23, 0.88);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.nav-container {
  max-width: 1440px;
  width: 100%;
  margin-inline: auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: clamp(12px, 1.8vw, 28px);
  gap: clamp(8px, 1vw, 16px);
}

/* Adaptive Brand Logo */
.brand-logo,
.brand-logo-lockup {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-shrink: 0;
  text-decoration: none;
}

.brand-logo img,
.brand-img {
  height: 32px !important;
  max-height: 32px !important;
  width: auto !important;
  object-fit: contain;
}

.brand-tagline-sub {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent-momentum);
  text-transform: lowercase;
  margin-top: 1px;
}

.logo-dark-theme {
  display: none;
}
.logo-light-theme {
  display: block;
}

[data-theme="dark"] .logo-dark-theme,
.theme-dark .logo-dark-theme {
  display: block;
}
[data-theme="dark"] .logo-light-theme,
.theme-dark .logo-light-theme {
  display: none;
}

/* Desktop Navigation Links — Nexalytica-Inspired Structured Mega-Nav */
.desktop-nav {
  display: flex;
  align-items: center;
  gap: clamp(6px, 0.8vw, 14px);
  flex-shrink: 0;
  min-width: 0;
  position: relative;
}

.direct-store-link {
  font-family: var(--font-mono);
  font-size: clamp(10.5px, 0.75vw, 11.8px);
  font-weight: 700;
  letter-spacing: 0.015em;
  color: var(--accent-momentum);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 9999px;
  background: rgba(255, 128, 0, 0.08);
  border: 1px solid rgba(255, 128, 0, 0.22);
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--duration-fast) var(--ease-sharp);
}

.direct-store-link:hover {
  background: var(--accent-momentum);
  color: #ffffff;
  border-color: var(--accent-momentum);
  box-shadow: 0 0 14px var(--accent-momentum-glow);
  transform: translateY(-1px);
}

.direct-store-link .nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-momentum);
  box-shadow: 0 0 6px var(--accent-momentum);
  animation: pulse-dot-nav 2s infinite ease-in-out;
}

.direct-store-link:hover .nav-dot {
  background-color: #ffffff;
  box-shadow: 0 0 8px #ffffff;
}

@keyframes pulse-dot-nav {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

/* Dropdown Container */
.nav-dropdown-item {
  position: relative;
}

.nav-dropdown-btn {
  font-family: var(--font-mono);
  font-size: clamp(10.5px, 0.75vw, 11.5px);
  font-weight: 600;
  letter-spacing: 0.015em;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px clamp(6px, 0.5vw, 10px);
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration-fast) var(--ease-sharp);
}

.nav-dropdown-btn:hover,
.nav-dropdown-item:hover .nav-dropdown-btn,
.nav-dropdown-item.is-open .nav-dropdown-btn {
  color: var(--text-primary);
  background: var(--surface);
  border-color: var(--border);
}

.nav-dropdown-btn.active {
  color: var(--accent-momentum);
  font-weight: 700;
}

.dropdown-chevron {
  transition: transform var(--duration-fast) var(--ease-sharp);
  opacity: 0.7;
}

.nav-dropdown-item:hover .dropdown-chevron,
.nav-dropdown-item.is-open .dropdown-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

/* Floating Mega Dropdown Menu Panel */
.mega-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: var(--canvas-surface, #ffffff);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.15rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12), 0 4px 14px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 10000;
  transition: opacity var(--duration-fast) var(--ease-sharp),
              transform var(--duration-fast) var(--ease-sharp),
              visibility var(--duration-fast);
}

/* Invisible bridge so mouse hover doesn't break between button and panel */
.mega-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}

.nav-dropdown-item:hover .mega-dropdown-menu,
.nav-dropdown-item:focus-within .mega-dropdown-menu,
.nav-dropdown-item.is-open .mega-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* Specific alignments and widths for dropdowns so they never shrink-wrap or collide */
.nav-dropdown-item[data-dropdown="platform"] .mega-dropdown-menu {
  width: 590px;
  left: 50%;
  transform: translateX(-35%) translateY(8px);
}
.nav-dropdown-item[data-dropdown="platform"]:hover .mega-dropdown-menu,
.nav-dropdown-item[data-dropdown="platform"]:focus-within .mega-dropdown-menu,
.nav-dropdown-item[data-dropdown="platform"].is-open .mega-dropdown-menu {
  transform: translateX(-35%) translateY(0);
}

.nav-dropdown-item[data-dropdown="company"] .mega-dropdown-menu {
  width: 590px;
  left: 50%;
  transform: translateX(-45%) translateY(8px);
}
.nav-dropdown-item[data-dropdown="company"]:hover .mega-dropdown-menu,
.nav-dropdown-item[data-dropdown="company"]:focus-within .mega-dropdown-menu,
.nav-dropdown-item[data-dropdown="company"].is-open .mega-dropdown-menu {
  transform: translateX(-45%) translateY(0);
}

.nav-dropdown-item[data-dropdown="resources"] .mega-dropdown-menu {
  width: 780px;
  max-width: calc(100vw - 32px);
  left: 50%;
  transform: translateX(-56%) translateY(8px);
}
.nav-dropdown-item[data-dropdown="resources"]:hover .mega-dropdown-menu,
.nav-dropdown-item[data-dropdown="resources"]:focus-within .mega-dropdown-menu,
.nav-dropdown-item[data-dropdown="resources"].is-open .mega-dropdown-menu {
  transform: translateX(-56%) translateY(0);
}

[data-theme="dark"] .mega-dropdown-menu,
.theme-dark .mega-dropdown-menu {
  background: rgba(18, 18, 22, 0.96);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* Internal Mega Grid */
.mega-menu-grid {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 1.25rem;
  align-items: stretch;
}

/* 2-Column Links Grid for Resources */
.mega-menu-grid.has-cols-2 {
  grid-template-columns: 460px 240px;
  gap: 1.5rem;
  position: relative;
}

.mega-menu-grid.has-cols-2::before {
  content: '';
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 471px;
  width: 1px;
  background: var(--border-light, #e4e4e7);
}

[data-theme="dark"] .mega-menu-grid.has-cols-2::before {
  background: rgba(255, 255, 255, 0.08);
}

.mega-menu-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mega-menu-items.cols-2 {
  display: grid;
  grid-template-columns: repeat(2, 220px);
  gap: 6px 14px;
  width: 100%;
}

.mega-menu-items.cols-2 .mega-item-link {
  width: 220px;
  box-sizing: border-box;
}

/* Single Mega Menu Item Link */
.mega-item-link {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  text-decoration: none;
  transition: background var(--duration-fast) var(--ease-sharp),
              transform var(--duration-fast) var(--ease-sharp);
}

.mega-item-link:hover {
  background: var(--surface-gray, #f4f4f5);
  transform: translateX(3px);
}

[data-theme="dark"] .mega-item-link:hover {
  background: rgba(255, 255, 255, 0.06);
}

.mega-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-gray, #f4f4f5);
  border: 1px solid var(--border-light, #e4e4e7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  flex-shrink: 0;
  transition: all var(--duration-fast) var(--ease-sharp);
}

[data-theme="dark"] .mega-icon-box {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.mega-item-link:hover .mega-icon-box {
  color: #ffffff;
  background: var(--accent-momentum);
  border-color: var(--accent-momentum);
  box-shadow: 0 0 12px var(--accent-momentum-glow);
}

.mega-text-box {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.mega-item-title {
  font-family: var(--font-primary, sans-serif);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mega-item-desc {
  font-family: var(--font-primary, sans-serif);
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

/* Featured Preview Card in Dropdown */
.mega-featured-card {
  background: linear-gradient(145deg, rgba(255, 128, 0, 0.07) 0%, rgba(0, 0, 0, 0.02) 100%);
  border: 1px solid rgba(255, 128, 0, 0.16);
  border-radius: 14px;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  min-width: 240px;
  box-sizing: border-box;
}

[data-theme="dark"] .mega-featured-card {
  background: linear-gradient(145deg, rgba(255, 128, 0, 0.12) 0%, rgba(255, 255, 255, 0.02) 100%);
  border-color: rgba(255, 128, 0, 0.25);
}

.mega-card-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--accent-momentum);
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mega-card-title {
  font-family: var(--font-primary, sans-serif);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
  margin: 0 0 0.5rem;
}

.mega-card-desc {
  font-family: var(--font-primary, sans-serif);
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0 0 1rem;
}

.mega-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-primary, sans-serif);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-momentum);
  text-decoration: none;
  transition: gap var(--duration-fast) var(--ease-sharp);
}

.mega-card-cta:hover {
  gap: 9px;
  text-decoration: underline;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: clamp(6px, 0.6vw, 10px);
  flex-shrink: 0;
}

/* Theme Switcher Button */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-sharp);
  box-shadow: var(--shadow-subtle);
  flex-shrink: 0;
}

.theme-toggle-btn:hover {
  border-color: var(--accent-momentum);
  box-shadow: 0 0 12px var(--accent-momentum-glow);
  transform: scale(1.08);
}

.theme-icon-sun,
.theme-icon-moon {
  display: inline-flex;
  font-size: 15px;
  line-height: 1;
}

/* Default (Light Mode): Show Moon (to switch to dark) */
.theme-icon-sun {
  display: none;
}
.theme-icon-moon {
  display: inline-flex;
}

/* Dark Mode: Show Sun (to switch to light) */
[data-theme="dark"] .theme-icon-sun {
  display: inline-flex;
  color: #FFA336;
}
[data-theme="dark"] .theme-icon-moon {
  display: none;
}

.drawer-theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: #94A3B8;
}

.theme-toggle-drawer-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.briefcase-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px clamp(8px, 0.7vw, 12px);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--surface);
  transition: all var(--duration-fast) var(--ease-sharp);
  white-space: nowrap;
  flex-shrink: 0;
}

.briefcase-btn:hover {
  border-color: var(--accent-momentum);
  color: var(--accent-momentum);
}

.briefcase-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background-color: var(--accent-momentum);
  color: #FFFFFF;
  font-size: 9.5px;
  font-weight: 700;
}

.nav-cta {
  font-size: 11.5px;
  padding: 7px clamp(12px, 0.9vw, 18px);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Explicit Auth Navigation CTAs */
.btn-nav-login {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--surface);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-sharp);
  white-space: nowrap;
}

.btn-nav-login:hover {
  border-color: var(--accent-momentum);
  color: var(--accent-momentum);
  background: rgba(255, 128, 0, 0.06);
}

.nav-signup-cta {
  font-size: 12px !important;
  padding: 8px 18px !important;
  text-decoration: none;
  white-space: nowrap;
}

.btn-nav-signout {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast);
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-nav-signout:hover {
  color: #EF4444;
  border-color: #EF4444;
  background: rgba(239, 68, 68, 0.08);
}

.admin-nav-pill {
  background: #0A0A0A !important;
  color: #FF8000 !important;
  border-color: rgba(255, 128, 0, 0.6) !important;
  font-weight: 700 !important;
  padding: 6px 10px;
  font-size: 11px;
  letter-spacing: 0.03em;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.admin-nav-pill:hover {
  border-color: #FF8000 !important;
  background: #151515 !important;
  box-shadow: 0 0 10px rgba(255, 128, 0, 0.25);
}

.portal-nav-btn {
  padding: 6px 10px;
  font-size: 11px;
}

.portal-signup-pill {
  border: 1px solid #FF8000 !important;
  color: #FF8000 !important;
  background: rgba(255, 128, 0, 0.15) !important;
}

/* ==========================================================================
   MOBILE NAVIGATION DRAWER & BACKDROP (INSTITUTIONAL GRADE)
   ========================================================================== */

/* 1. Backdrop Scrim */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.76);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2147483640;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* 2. Drawer Panel */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 420px;
  height: 100vh;
  height: 100dvh;
  background-color: #070B12;
  color: #F8FAFC;
  z-index: 2147483647 !important;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-shadow: -16px 0 50px rgba(0, 0, 0, 0.88);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  box-sizing: border-box;
}

.mobile-drawer.open {
  transform: translateX(0);
}

/* While mobile drawer is open, keep floating chat widgets hidden so drawer footer is clear */
body.drawer-open [class*="elfsight"],
body.drawer-open [class*="eapps"],
body.drawer-open multi-channel-chat,
body.drawer-open .renalytica-chat-widget,
body.drawer-open iframe[title*="chat" i],
body.drawer-open div[class*="chat-widget"],
body.drawer-open div[id*="chat" i] {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* 3. Pinned Drawer Header */
.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #0B0F17;
  flex-shrink: 0;
  gap: 16px;
}

.drawer-brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  gap: 3px;
}

.drawer-brand-logo {
  height: 26px !important;
  max-height: 26px !important;
  width: auto !important;
  max-width: 160px !important;
  object-fit: contain !important;
}

.drawer-brand-tagline {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent-momentum);
  text-transform: lowercase;
}

.drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94A3B8;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  padding: 0;
}

.drawer-close:hover {
  background: rgba(255, 128, 0, 0.15);
  border-color: var(--accent-momentum);
  color: var(--accent-momentum);
  transform: rotate(90deg);
}

/* 4. Scrollable Drawer Body */
.drawer-scroll-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 20px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.drawer-scroll-body::-webkit-scrollbar {
  width: 5px;
}
.drawer-scroll-body::-webkit-scrollbar-track {
  background: transparent;
}
.drawer-scroll-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

/* 5. Institutional Gateway Card */
.drawer-auth-box {
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

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

.drawer-auth-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #94A3B8;
}

.drawer-auth-desc {
  font-size: 12px;
  line-height: 1.45;
  color: #64748B;
  margin: 0 0 12px;
}

.drawer-user-name {
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 2px;
}

.drawer-user-org {
  font-size: 11px;
  color: #94A3B8;
  margin-bottom: 12px;
}

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

.btn-drawer-auth {
  flex: 1;
  text-align: center;
  padding: 9px 12px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-drawer-auth.ghost {
  background: rgba(255, 255, 255, 0.06);
  color: #F8FAFC;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.btn-drawer-auth.ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-drawer-auth.primary {
  background: var(--accent-momentum);
  color: #FFFFFF;
  border: 1px solid var(--accent-momentum);
  box-shadow: 0 2px 10px rgba(255, 128, 0, 0.3);
}

.btn-drawer-auth.primary:hover {
  background: var(--accent-momentum-hover);
  border-color: var(--accent-momentum-hover);
}

/* 6. Navigation Groups & Links */
.drawer-nav-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-group-title {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #586472;
  padding-inline: 10px;
  margin-bottom: 2px;
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawer-link {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: #CBD5E1;
  transition: all 0.18s ease;
  border: 1px solid transparent;
  gap: 12px;
}

.drawer-link:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  transform: translateX(4px);
}

.drawer-link.active {
  background: rgba(255, 128, 0, 0.1);
  border-color: rgba(255, 128, 0, 0.3);
  color: #FFFFFF;
}

.drawer-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-momentum);
  min-width: 20px;
  opacity: 0.9;
}

.drawer-label {
  flex: 1;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.drawer-chip {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  color: #94A3B8;
  border: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

.drawer-chip.live {
  background: rgba(22, 163, 74, 0.15);
  color: #4ADE80;
  border-color: rgba(22, 163, 74, 0.35);
}

.drawer-arrow {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #475569;
  transition: transform 0.18s ease, color 0.18s ease;
}

.drawer-link:hover .drawer-arrow {
  color: var(--accent-momentum);
  transform: translateX(3px);
}

/* 7. Pinned Drawer Footer */
.drawer-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #0B0F17;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

.drawer-quick-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.drawer-cart-pill {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  color: #F8FAFC;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}

.drawer-cart-pill:hover {
  background: rgba(255, 128, 0, 0.12);
  border-color: var(--accent-momentum);
  color: var(--accent-momentum);
}

.drawer-cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding-inline: 4px;
  border-radius: 9px;
  background-color: var(--accent-momentum);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 700;
}

.drawer-theme-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  color: #94A3B8;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.drawer-theme-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

.btn-drawer-signout {
  width: 100%;
  padding: 8px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-pill);
  color: #EF4444;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-drawer-signout:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: #EF4444;
}

.drawer-telemetry {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: #586472;
  text-transform: uppercase;
}

.telemetry-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-momentum);
  box-shadow: 0 0 6px var(--accent-momentum);
  animation: pulseDot 2s infinite ease-in-out;
}

/* 8. Mobile Menu Toggle Capsule Refinement */
.mobile-menu-toggle {
  display: none;
  cursor: pointer;
}

.mobile-menu-toggle:hover {
  border-color: var(--accent-momentum);
  color: var(--accent-momentum);
  background: rgba(255, 128, 0, 0.08);
}

.capsule-dots {
  color: var(--accent-momentum);
  letter-spacing: 0.1em;
  font-size: 14px;
}

/* 9. Responsive Navigation Breakpoints */
@media (max-width: 1380px) {
  .desktop-nav {
    display: none !important;
  }
  .mobile-menu-toggle {
    display: inline-flex !important;
  }
  .briefcase-label {
    display: none;
  }
  .brand-tagline-sub {
    display: none;
  }
}

@media (max-width: 960px) {
  .auth-btn-label {
    display: none;
  }
  .admin-nav-pill,
  .portal-nav-btn {
    padding: 6px 8px;
  }
}

@media (max-width: 768px) {
  .btn-nav-login,
  .nav-signup-cta,
  .admin-nav-pill,
  .portal-nav-btn,
  .btn-nav-signout {
    display: none !important;
  }
}

@media (max-width: 640px) {
  .nav-cta {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .mobile-drawer {
    max-width: 100%;
  }
  .drawer-header {
    padding: 16px 18px;
  }
  .drawer-scroll-body {
    padding: 16px 18px 24px;
  }
  .drawer-footer {
    padding: 14px 18px;
  }
}

/* ==========================================================================
   3. MEGA FOOTER V2 STYLES (UNIVERSAL SHELL COMPONENT)
   ========================================================================== */
.mega-footer-v2 {
  background-color: #FFFFFF;
  border-top: 1px solid var(--border-light);
  color: #0A0A0A;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.footer-content-wrap {
  padding-top: clamp(48px, 6vw, 80px);
}

.footer-grid-v2 {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: clamp(32px, 4vw, 56px);
  margin-bottom: clamp(40px, 5vw, 64px);
}

.footer-col-v2 {
  display: flex;
  flex-direction: column;
}

.footer-brand-lockup {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
  text-decoration: none;
}

.footer-brand-lockup .brand-img {
  width: auto;
  object-fit: contain;
}

/* Theme-adaptive logo switching in footer */
.mega-footer-v2 .logo-light-theme {
  display: block;
}
.mega-footer-v2 .logo-dark-theme {
  display: none;
}

[data-theme="dark"] .mega-footer-v2 .logo-light-theme {
  display: none;
}
[data-theme="dark"] .mega-footer-v2 .logo-dark-theme {
  display: block;
}

.footer-tagline-text {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent-momentum);
  text-transform: lowercase;
}

.footer-lead-p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-body);
  max-width: 380px;
  margin-bottom: 20px;
}

.footer-contact-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-line {
  font-size: 13px;
  color: #0A0A0A;
  text-decoration: none;
  transition: color var(--duration-fast);
}

.contact-line:hover {
  color: var(--accent-momentum);
}

.c-label {
  color: #71717A;
}

.contact-line strong {
  color: #0A0A0A;
}

.col-heading-v2 {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #0A0A0A;
  margin-bottom: 18px;
  text-transform: uppercase;
}

.footer-ul-v2 {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-ul-v2 li {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-ul-v2 a {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-sharp);
}

.footer-ul-v2 a:hover {
  color: var(--accent-momentum);
}

.footer-bottom-bar-v2 {
  border-top: 1px solid var(--border-light);
  padding-block: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #71717A;
}

.copy-notice {
  color: #71717A;
}

.trust-tags {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.trust-tag {
  color: #0A0A0A;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.04em;
}

/* Tail-end full-bleed ASCII Telemetry Data-Matrix Stage */
.footer-matrix-stage {
  position: relative;
  width: 100%;
  background: linear-gradient(180deg, #F8FAFC 0%, #EEF2F6 100%);
  border-top: 1px solid var(--border-light);
  overflow: hidden;
  margin-top: 40px;
  margin-bottom: 0;
  padding-bottom: 0;
  line-height: 0;
}

.matrix-hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 24px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
  gap: 12px;
}

.matrix-hud-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.matrix-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-momentum);
  box-shadow: 0 0 8px var(--accent-momentum);
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.matrix-hud-title {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent-momentum);
  text-transform: uppercase;
}

.matrix-coord-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #71717A;
  background: #F4F4F5;
  border: 1px solid var(--border-light);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.matrix-canvas-wrapper {
  position: relative;
  width: 100%;
  height: 320px;
  overflow: hidden;
  margin: 0;
  padding: 0;
  line-height: 0;
}

#footer-data-matrix-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  display: block;
}

/* Dark Mode Overrides for Mega Footer */
[data-theme="dark"] .mega-footer-v2 {
  background-color: #090D16;
  border-top-color: rgba(255, 255, 255, 0.10);
  color: #F8FAFC;
}

[data-theme="dark"] .col-heading-v2 {
  color: #F8FAFC;
}

[data-theme="dark"] .contact-line {
  color: #F8FAFC;
}

[data-theme="dark"] .contact-line strong {
  color: #F8FAFC;
}

[data-theme="dark"] .footer-lead-p {
  color: #94A3B8;
}

[data-theme="dark"] .footer-ul-v2 a {
  color: #94A3B8;
}

[data-theme="dark"] .footer-ul-v2 a:hover {
  color: var(--accent-momentum);
}

[data-theme="dark"] .footer-bottom-bar-v2 {
  border-top-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .copy-notice {
  color: #64748B;
}

[data-theme="dark"] .trust-tag {
  color: #94A3B8;
}

[data-theme="dark"] .footer-matrix-stage {
  background: linear-gradient(180deg, #090D16 0%, #04070D 100%);
  border-top-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .matrix-hud-header {
  background: rgba(9, 13, 22, 0.85);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .matrix-coord-chip {
  background: rgba(255, 255, 255, 0.06);
  color: #94A3B8;
  border-color: rgba(255, 255, 255, 0.1);
}

/* Footer Responsive Breakpoints */
@media (max-width: 1024px) {
  .footer-grid-v2 {
    grid-template-columns: 1fr 1fr;
    gap: 36px;
  }
}

@media (max-width: 640px) {
  .footer-grid-v2 {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .footer-bottom-bar-v2 {
    flex-direction: column;
    align-items: flex-start;
  }
  .trust-tags {
    flex-direction: column;
    gap: 8px;
  }
}

/* ==========================================================================
   4. UNIVERSAL SECTION FLOW DIVIDER
   ========================================================================== */
.section-flow-divider {
  position: relative;
  width: 100%;
  height: 36px;
  background: linear-gradient(180deg, transparent 0%, rgba(255, 128, 0, 0.025) 50%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.section-flow-divider::after {
  content: '';
  position: absolute;
  width: 120px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-momentum), transparent);
  opacity: 0.5;
}

[data-theme="dark"] .section-flow-divider {
  background: linear-gradient(180deg, transparent 0%, rgba(255, 128, 0, 0.04) 50%, transparent 100%);
}

/* ==========================================================================
   5. UNIVERSAL INTERACTIVE MODALS & TOAST NOTIFICATIONS
   ========================================================================== */
.renalytica-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 23, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3vw, 36px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
}

.renalytica-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.renalytica-modal-card {
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 780px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.45);
  position: relative;
  transform: scale(0.96) translateY(14px);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.renalytica-modal-backdrop.active .renalytica-modal-card {
  transform: scale(1) translateY(0);
}

.modal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 26px;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  background: var(--surface-card);
  z-index: 10;
}

.modal-header-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--accent-momentum);
  text-transform: uppercase;
}

.modal-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: var(--surface-gray);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.modal-close-btn:hover {
  background: var(--accent-momentum);
  color: #0B0F17;
  border-color: var(--accent-momentum);
  transform: rotate(90deg);
}

.modal-article-body {
  padding: clamp(20px, 3.5vw, 36px);
  overflow-y: auto;
}

.modal-article-body h2 {
  font-family: var(--font-primary);
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 900;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}

.modal-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
}

.modal-prose {
  font-size: 15px;
  line-height: 1.78;
  color: var(--text-secondary);
}

.modal-prose p {
  margin-bottom: 18px;
}

.modal-prose h3 {
  font-family: var(--font-primary);
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 24px;
  margin-bottom: 10px;
}

/* Modal Form Styles */
.modal-form-group {
  margin-bottom: 16px;
}

.modal-form-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  display: block;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.modal-form-input,
.modal-form-textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--surface-gray);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-sizing: border-box;
}

.modal-form-input:focus,
.modal-form-textarea:focus {
  border-color: var(--accent-momentum);
  background: var(--surface-card);
  box-shadow: 0 0 0 3px var(--accent-momentum-glow);
}

.modal-form-textarea {
  resize: vertical;
  min-height: 90px;
}

/* Universal Toast Alert */
.renalytica-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: #0B0F17;
  color: #FFFFFF;
  padding: 14px 24px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--accent-momentum);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
  transform: translateY(100px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100000;
  display: flex;
  align-items: center;
  gap: 10px;
}

.renalytica-toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   RENALYTICA TRANSITION REVEAL OVERLAY & KEYFRAMES
   ========================================================================== */
.transition-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--canvas-primary, #ffffff);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

[data-theme="dark"] .transition-overlay {
  background-color: var(--canvas-primary, #090D16);
}

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

.logo-container {
  width: 192px;
  height: 192px;
}

/* Keyframes for the small boxes coming together */
@keyframes popInBox {
  0% { transform: scale(0) translateY(10px); opacity: 0; }
  60% { transform: scale(1.1) translateY(-2px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes drawLine {
  0% { stroke-dashoffset: 300; }
  100% { stroke-dashoffset: 0; }
}

@keyframes popIn {
  0% { transform: scale(0); opacity: 0; }
  70% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes vortexExit {
  0% { 
    transform: scale(1) rotate(0deg); 
    opacity: 1; 
    filter: blur(0px);
  }
  100% { 
    transform: scale(0) rotate(720deg); 
    opacity: 0; 
    filter: blur(8px);
  }
}

/* Applying animations to SVG parts - tuned for snappy 1.8s transition */
.is-animating .animate-box {
  transform-origin: center;
  transform-box: fill-box;
  animation: popInBox 0.24s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  opacity: 0;
}

/* Staggered delays to create the snappy wave build effect */
.is-animating .delay-1 { animation-delay: 0.05s; }
.is-animating .delay-2 { animation-delay: 0.09s; }
.is-animating .delay-3 { animation-delay: 0.13s; }
.is-animating .delay-4 { animation-delay: 0.17s; }
.is-animating .delay-5 { animation-delay: 0.21s; }
.is-animating .delay-6 { animation-delay: 0.25s; }
.is-animating .delay-7 { animation-delay: 0.29s; }
.is-animating .delay-8 { animation-delay: 0.33s; }
.is-animating .delay-9 { animation-delay: 0.37s; }
.is-animating .delay-10 { animation-delay: 0.41s; }

/* Arrow and line animations - coordinated with block build */
.is-animating .animate-line {
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
  animation: drawLine 0.45s ease-in-out forwards;
  animation-delay: 0.45s;
}

.is-animating .animate-dot-1 {
  transform-origin: 35px 65px;
  animation: popIn 0.22s ease-out forwards;
  animation-delay: 0.65s;
  opacity: 0;
}

.is-animating .animate-dot-2 {
  transform-origin: 65px 45px;
  animation: popIn 0.22s ease-out forwards;
  animation-delay: 0.80s;
  opacity: 0;
}

.is-animating .animate-arrow {
  transform-origin: 90px 20px;
  animation: popIn 0.22s ease-out forwards;
  animation-delay: 0.95s;
  opacity: 0;
}

.vortex-active .logo-container {
  animation: vortexExit 0.55s cubic-bezier(0.55, 0.055, 0.675, 0.19) forwards;
}

@media (prefers-reduced-motion: reduce) {
  .is-animating .animate-box,
  .is-animating .animate-line,
  .is-animating .animate-dot-1,
  .is-animating .animate-dot-2,
  .is-animating .animate-arrow {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    opacity: 1 !important;
    stroke-dashoffset: 0 !important;
  }
  .vortex-active .logo-container {
    animation-duration: 0.15s !important;
  }
}

/* ==============================================================================
   NATIVE COOKIE CONSENT ALERT BANNER (Matching Brand & Sample Design)
   ============================================================================== */
.renalytica-cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: #FF6B00; /* Vibrant signature momentum orange */
  color: #FFFFFF;
  z-index: 2147483647; /* Maximum browser 32-bit integer: always in front of chat widgets */
  box-shadow: 0 -6px 25px rgba(0, 0, 0, 0.18);
  font-family: var(--font-sans, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
  will-change: transform, opacity;
}

.renalytica-cookie-banner.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.renalytica-cookie-banner.is-closing {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

.cookie-banner-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.cookie-banner-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1 1 640px;
  min-width: 280px;
}

.cookie-icon-wrap {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.cookie-icon-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
}

.cookie-banner-text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: #FFFFFF;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.cookie-learn-more-link {
  color: #FFFFFF;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  margin-left: 5px;
  transition: opacity 0.15s ease;
  display: inline-block;
}

.cookie-learn-more-link:hover {
  opacity: 0.85;
}

.cookie-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.cookie-btn-manage {
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  padding: 9px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.cookie-btn-manage:hover {
  background: rgba(255, 255, 255, 0.28);
  border-color: #FFFFFF;
  transform: translateY(-1px);
}

.cookie-btn-decline {
  background: transparent;
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 6px;
  padding: 9px 20px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
  white-space: nowrap;
}

.cookie-btn-decline:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #FFFFFF;
  transform: translateY(-1px);
}

.cookie-btn-allow {
  background: #FFFFFF;
  color: #0A0F1D;
  border: none;
  border-radius: 6px;
  padding: 10px 24px;
  font-size: 0.92rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  transition: background-color 0.18s ease, transform 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.cookie-btn-allow:hover {
  background: #F8FAFC;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.cookie-btn-allow:active,
.cookie-btn-decline:active,
.cookie-btn-manage:active {
  transform: translateY(0);
}

/* Accessibility focus visible rings */
.cookie-btn-allow:focus-visible,
.cookie-btn-decline:focus-visible,
.cookie-btn-manage:focus-visible,
.cookie-learn-more-link:focus-visible {
  outline: 2px solid #FFFFFF;
  outline-offset: 3px;
}

/* ==============================================================================
   INSTITUTIONAL COOKIE PREFERENCES MODAL
   ============================================================================== */
.cookie-pref-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.cookie-pref-modal-backdrop.is-active {
  opacity: 1;
  visibility: visible;
}

.cookie-pref-dialog {
  background: var(--canvas-surface, #FFFFFF);
  border: 1px solid var(--border-light, #E2E8F0);
  border-radius: 14px;
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
  color: var(--text-primary, #0F172A);
  animation: cookieModalScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

[data-theme="dark"] .cookie-pref-dialog {
  background: #0B0F19;
  border-color: rgba(255, 255, 255, 0.12);
  color: #F8FAFC;
}

.cookie-pref-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.cookie-pref-tag {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  font-weight: 700;
  color: #FF6B00;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.25rem;
}

.cookie-pref-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.02em;
}

.cookie-pref-close {
  background: transparent;
  border: none;
  font-size: 1.35rem;
  color: var(--text-muted, #94A3B8);
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  line-height: 1;
  transition: color 0.15s ease;
}

.cookie-pref-close:hover {
  color: var(--text-primary, #0F172A);
}

.cookie-pref-desc {
  font-size: 0.88rem;
  color: var(--text-secondary, #475569);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.cookie-pref-sections {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.cookie-pref-card {
  background: var(--surface-gray, #F8FAFC);
  border: 1px solid var(--border-light, #E2E8F0);
  border-radius: 8px;
  padding: 1rem 1.25rem;
}

[data-theme="dark"] .cookie-pref-card {
  background: #131A29;
  border-color: rgba(255, 255, 255, 0.08);
}

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

.cookie-pref-card-header strong {
  font-size: 0.95rem;
  color: var(--text-primary, #0F172A);
}

[data-theme="dark"] .cookie-pref-card-header strong {
  color: #F8FAFC;
}

.cookie-pref-status-pill {
  font-family: var(--font-mono, monospace);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  margin-left: 0.5rem;
  background: rgba(16, 185, 129, 0.12);
  color: #10B981;
}

.cookie-pref-status-pill.locked {
  background: rgba(255, 107, 0, 0.12);
  color: #FF6B00;
}

.cookie-pref-card p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-secondary, #64748B);
  line-height: 1.45;
}

/* iOS-style toggle switch */
.pref-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

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

.pref-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #CBD5E1;
  transition: .25s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 24px;
}

.pref-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .25s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .pref-slider {
  background-color: #FF6B00;
}

input:checked + .pref-slider:before {
  transform: translateX(20px);
}

.cookie-pref-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.cookie-pref-btn-secondary {
  padding: 10px 18px;
  border-radius: 6px;
  border: 1px solid var(--border-light, #CBD5E1);
  background: transparent;
  color: var(--text-primary, #0F172A);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

[data-theme="dark"] .cookie-pref-btn-secondary {
  border-color: rgba(255, 255, 255, 0.2);
  color: #F8FAFC;
}

.cookie-pref-btn-secondary:hover {
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .cookie-pref-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}

.cookie-pref-btn-primary {
  padding: 10px 22px;
  border-radius: 6px;
  border: none;
  background: #FF6B00;
  color: #FFFFFF;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.cookie-pref-btn-primary:hover {
  background: #E05E00;
}

/* Strict Isolation: Suppress all cookie banners and chat widgets while entrance gateway is active */
body.entrance-locked .renalytica-cookie-banner,
body.entrance-locked cookie-consent,
body.entrance-locked multi-channel-chat,
body.entrance-locked #renalytica-chat-root,
body.entrance-locked .chat-launcher-btn,
body.entrance-locked .chat-card-popup,
body.entrance-locked [class*="elfsight"],
body.entrance-locked [id*="elfsight"],
body.entrance-locked #elfsight-chat-container,
body.entrance-locked div[style*="z-index: 214748364"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Shield floating widgets from obscuring cookie buttons */
body:has(.renalytica-cookie-banner.is-visible) .elfsight-app-839fece5-17a4-4ca8-98e3-f09aa475eb37,
body:has(.renalytica-cookie-banner.is-visible) .elfsight-app-6a8cc53e-5e41-4e07-b6c5-e7abeffce97d,
body:has(.renalytica-cookie-banner.is-visible) multi-channel-chat,
body:has(.renalytica-cookie-banner.is-visible) #chat-widget-container {
  bottom: 80px !important;
  transition: bottom 0.35s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .cookie-banner-inner {
    padding: 14px 16px;
    gap: 14px;
  }
  .cookie-banner-left {
    gap: 12px;
  }
  .cookie-icon-wrap {
    width: 36px;
    height: 36px;
  }
  .cookie-banner-text {
    font-size: 0.86rem;
  }
  .cookie-banner-actions {
    width: 100%;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
  }
  .cookie-btn-allow,
  .cookie-btn-decline,
  .cookie-btn-manage {
    flex: 1 1 auto;
    text-align: center;
    padding: 8px 12px;
    font-size: 0.82rem;
  }
  .cookie-pref-dialog {
    padding: 1.25rem;
  }
}

