/* ============================================================================
   CATALYST v2 — Northwestern University Model of Models Redesign
   ============================================================================
   All rules scoped under .theme-v2 so they ONLY apply when the toggle is on.
   The existing momstyles.css remains untouched and serves as the v1 fallback.
   ============================================================================ */

/* --------------------------------------------------------------------------
   0. DESIGN TOKENS (NU Official Brand + Extended)
   -------------------------------------------------------------------------- */
.theme-v2 {
  /* NU Purple Family */
  --nu-purple:      #4E2A84;
  --nu-purple-120:  #401F68;
  --nu-purple-60:   #836EAA;
  --nu-purple-30:   #B6ACD1;
  --nu-purple-10:   #E4E0EE;

  /* NU Secondary Accents */
  --nu-gold:        #FFC520;
  --nu-teal:        #7FCECD;
  --nu-blue:        #5091CD;
  --nu-navy:        #0D2D6C;
  --nu-green:       #58B947;
  --nu-red:         #EF553F;

  /* NU Neutrals */
  --nu-black:       #342F2E;
  --nu-black-80:    #4D4845;
  --nu-black-50:    #716C6B;
  --nu-black-20:    #BBB8B8;
  --nu-black-10:    #D8D6D6;

  /* Semantic */
  --color-surface:       #FAFAFA;
  --color-surface-card:  #FFFFFF;
  --color-text:          var(--nu-black);
  --color-text-muted:    var(--nu-black-50);
  --color-accent:        var(--nu-purple);
  --color-accent-hover:  var(--nu-purple-120);
  --color-accent-light:  var(--nu-purple-10);
  --color-accent-gold:   var(--nu-gold);

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;

  /* Shapes */
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-pill: 100px;

  /* Shadows */
  --shadow-xs:    0 1px 3px rgba(78,42,132,0.06);
  --shadow-card:  0 3px 12px rgba(78,42,132,0.10);
  --shadow-hover: 0 18px 48px rgba(78,42,132,0.22);
  --shadow-nav:   0 4px 24px rgba(78,42,132,0.12);
  --shadow-glow:  0 6px 20px rgba(78,42,132,0.30);

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration: 250ms;
  --duration-slow: 400ms;
}


/* --------------------------------------------------------------------------
   1. GLOBAL RESET & TYPOGRAPHY
   -------------------------------------------------------------------------- */
.theme-v2 {
  font-family: 'Noto Serif', 'Georgia', serif;
  color: var(--color-text);
  background-color: var(--color-surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.theme-v2 h1, .theme-v2 h2, .theme-v2 h3,
.theme-v2 h4, .theme-v2 h5, .theme-v2 h6 {
  font-family: 'Poppins', 'Helvetica Neue', sans-serif;
  font-weight: 600;
  color: var(--nu-black);
  letter-spacing: -0.02em;
}

.theme-v2 h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); line-height: 1.1; }
.theme-v2 h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.2; }
.theme-v2 h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); line-height: 1.3; }
.theme-v2 h5 { font-family: 'Poppins', sans-serif; font-weight: 600; }

.theme-v2 p {
  line-height: 1.7;
  color: var(--nu-black-80);
  max-width: 65ch;
}

.theme-v2 a {
  color: var(--nu-purple);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}
.theme-v2 a:hover,
.theme-v2 a:focus {
  color: var(--nu-purple-120);
}


/* --------------------------------------------------------------------------
   2. NAVIGATION — Frosted Glass Sticky
   -------------------------------------------------------------------------- */
.theme-v2 #main-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.82) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: none !important;
  box-shadow: none;
  transition: box-shadow var(--duration-slow) var(--ease);
  padding-top: 0;
  padding-bottom: 0;
}

/* Purple accent stripe at top */
.theme-v2 #main-nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--nu-purple-120) 0%, var(--nu-purple) 40%, var(--nu-gold) 100%);
  box-shadow: 0 2px 8px rgba(78,42,132,0.25);
}

/* Scrolled state — added via JS */
.theme-v2 #main-nav.scrolled {
  box-shadow: var(--shadow-nav);
}

.theme-v2 .navbar-brand img {
  transition: transform var(--duration) var(--ease);
}
.theme-v2 .navbar-brand img:hover {
  transform: scale(1.03);
}

.theme-v2 .navbar-nav {
  background: transparent !important;
  padding: 0 !important;
  gap: 0.25rem;
}

.theme-v2 .navbar-light .navbar-nav .nav-link {
  color: var(--nu-black) !important;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.75rem 1rem !important;
  border-radius: var(--radius-sm);
  position: relative;
  transition: color var(--duration) var(--ease), background var(--duration) var(--ease);
}

.theme-v2 .navbar-light .navbar-nav .nav-link:hover {
  color: var(--nu-purple) !important;
  background: var(--nu-purple-10);
  transform: translateY(-1px);
}

/* Active nav indicator — animated underline */
.theme-v2 .navbar-light .navbar-nav .active > .nav-link {
  text-decoration: none !important;
  color: var(--nu-purple) !important;
}
.theme-v2 .navbar-light .navbar-nav .active > .nav-link::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 1rem;
  right: 1rem;
  height: 3px;
  background: var(--nu-purple);
  border-radius: 3px;
  animation: slideIn var(--duration-slow) var(--ease);
}
@keyframes slideIn {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* Mobile nav */
@media (max-width: 1199px) {
  .theme-v2 .navbar-collapse {
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-md);
    margin-top: 0.5rem;
    padding: var(--space-md);
    box-shadow: var(--shadow-hover);
  }
  .theme-v2 .navbar-nav {
    gap: 0 !important;
  }
}


/* --------------------------------------------------------------------------
   3. THEME TOGGLE BUTTON
   -------------------------------------------------------------------------- */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  border: 2px solid var(--nu-purple-30, #B6ACD1);
  border-radius: 100px;
  background: transparent;
  font-family: 'Poppins', 'Open Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--nu-purple, #4E2A84);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.theme-toggle-btn:hover {
  background: #E4E0EE;
  border-color: #4E2A84;
  transform: scale(1.03);
}
.theme-toggle-btn .toggle-icon {
  font-size: 1rem;
  line-height: 1;
}

/* When v2 is active, gold accent border */
.theme-v2 .theme-toggle-btn {
  border-color: var(--nu-gold);
  color: var(--nu-purple-120);
}
.theme-v2 .theme-toggle-btn:hover {
  background: var(--nu-purple-10);
  border-color: var(--nu-purple);
}


/* --------------------------------------------------------------------------
   4. BUTTONS
   -------------------------------------------------------------------------- */
.theme-v2 .btn {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.4rem;
  text-align: center;
  transition: all var(--duration) var(--ease);
  border: none;
  letter-spacing: 0.01em;
}

.theme-v2 .btn-secondary {
  background: var(--nu-purple) !important;
  border-color: var(--nu-purple) !important;
  color: #fff !important;
  box-shadow: var(--shadow-xs);
}
.theme-v2 .btn-secondary:hover {
  background: var(--nu-purple-120) !important;
  border-color: var(--nu-purple-120) !important;
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

/* Primary CTA — NU Purple, rectangular */
.theme-v2 .btn-cta {
  background: var(--nu-purple);
  color: #fff;
  padding: 0.8rem 2rem;
  font-size: 1rem;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(78,42,132,0.25);
  letter-spacing: 0.02em;
}
.theme-v2 .btn-cta:hover {
  background: var(--nu-purple-120);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
  color: #fff;
}

/* Ghost button — rectangular */
.theme-v2 .btn-ghost {
  background: transparent;
  border: 2px solid var(--nu-purple-30);
  color: var(--nu-purple);
  border-radius: 8px;
  padding: 0.7rem 1.8rem;
}
.theme-v2 .btn-ghost:hover {
  border-color: var(--nu-purple);
  background: var(--nu-purple-10);
  color: var(--nu-purple-120);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

/* Legacy button containers — override the old pipe bg */
.theme-v2 .orangepipebg,
.theme-v2 .buttoncontainer.orangepipebg {
  background: transparent !important;
  padding-left: 0 !important;
}
.theme-v2 .buttoncontainer .btn.btn-main {
  background: var(--nu-purple);
  color: #fff;
  border-radius: 8px;
  padding: 0.8rem 2rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--duration) var(--ease);
  box-shadow: 0 4px 14px rgba(78,42,132,0.2);
}
.theme-v2 .buttoncontainer .btn.btn-main:hover {
  background: var(--nu-purple-120);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}
.theme-v2 .graybg.btn {
  background: var(--nu-purple) !important;
  color: #fff !important;
}


/* --------------------------------------------------------------------------
   5. HOMEPAGE — Hero Section
   -------------------------------------------------------------------------- */
.theme-v2 .main-content.home {
  background-image: none !important;
  background: linear-gradient(135deg, #fff 0%, var(--nu-purple-10) 55%, rgba(182,172,209,0.35) 100%);
  position: relative;
  overflow: hidden;
  min-height: 75vh;
  display: flex;
  align-items: center;
  padding: var(--space-xl) 0;
}

/* Network canvas sits behind hero content */
.theme-v2 .main-content.home #network-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.35;
  pointer-events: none;
}

/* NU Slash decorative element — top right */
.theme-v2 .main-content.home::after {
  content: '';
  position: absolute;
  top: -20%;
  right: -5%;
  width: 40%;
  height: 140%;
  background: linear-gradient(135deg, transparent 40%, rgba(78,42,132,0.03) 40%, rgba(78,42,132,0.03) 60%, transparent 60%);
  transform: rotate(-12deg);
  pointer-events: none;
}

.theme-v2 .homecta {
  margin-top: 0 !important;
  position: relative;
  z-index: 2;
}

.theme-v2 .homecta h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  color: var(--nu-purple);
  margin-bottom: var(--space-md);
  line-height: 1.05;
}

.theme-v2 .homecta .maxout p {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--nu-black-80);
}

.theme-v2 .btn-toolbar {
  gap: var(--space-md);
  margin-top: var(--space-lg) !important;
}

/* Featured project — glass card */
.theme-v2 .projectsnap img {
  border-radius: var(--radius-md) !important;
  border: none !important;
  box-shadow: var(--shadow-card);
  transition: transform var(--duration-slow) var(--ease), box-shadow var(--duration-slow) var(--ease);
}
.theme-v2 .projectsnap img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-hover);
}

.theme-v2 .projintro h3 {
  color: var(--nu-purple);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.theme-v2 .projintro a {
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--nu-purple-60);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.theme-v2 .grayrule {
  border-left: none !important;
  padding-left: 0 !important;
}
@media (min-width: 768px) {
  .theme-v2 .grayrule {
    border-left: 2px solid var(--nu-purple-10) !important;
    padding-left: var(--space-lg) !important;
  }
}


/* --------------------------------------------------------------------------
   6. PROJECT CARDS — Modern Design
   -------------------------------------------------------------------------- */
.theme-v2 .projlist h5 {
  font-size: clamp(2rem, 4vw, 3rem) !important;
  color: var(--nu-purple);
  margin-bottom: var(--space-lg);
}

.theme-v2 .db-button {
  background: var(--color-surface-card) !important;
  border-radius: var(--radius-md) !important;
  border: 1px solid rgba(78,42,132,0.08);
  box-shadow: var(--shadow-card);
  transition: all var(--duration-slow) var(--ease);
  padding: var(--space-lg) !important;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.theme-v2 .db-button:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
  border-color: var(--nu-purple-60);
  background: linear-gradient(180deg, #fff 0%, var(--nu-purple-10) 100%) !important;
}

.theme-v2 .db-button h5 {
  font-size: 1.25rem !important;
  margin-bottom: var(--space-sm);
}
.theme-v2 .db-button h5 a {
  color: var(--nu-purple);
}

.theme-v2 .db-button .setdesc {
  color: var(--nu-black-50);
  font-size: 0.9rem;
  line-height: 1.6;
  flex-grow: 1;
}

.theme-v2 .db-button img {
  border-radius: var(--radius-sm) !important;
  transition: transform var(--duration-slow) var(--ease);
}
.theme-v2 .db-button:hover img {
  transform: scale(1.03);
}

.theme-v2 .db-button .btn-secondary {
  border-radius: 6px !important;
  font-size: 0.82rem;
  padding: 0.45rem 1.2rem;
}


/* --------------------------------------------------------------------------
   7. FOOTER — Clean White with Purple Text
   -------------------------------------------------------------------------- */
.theme-v2 footer {
  background: #fff !important;
  border-top: 3px solid var(--nu-purple) !important;
  padding: 2.4rem 0 1.6rem 0 !important;
  color: var(--nu-black-80);
}

.theme-v2 footer h5 {
  color: var(--nu-purple) !important;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  margin-bottom: var(--space-md);
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
}

.theme-v2 footer p,
.theme-v2 footer .nav-link {
  color: var(--nu-black-50) !important;
}

.theme-v2 footer a,
.theme-v2 footer .nav-link {
  color: var(--nu-black-50) !important;
  transition: color var(--duration) var(--ease);
}
.theme-v2 footer a:hover,
.theme-v2 footer .nav-link:hover {
  color: var(--nu-purple) !important;
}

/* Logos — show at natural colors, no inversion */
.theme-v2 footer img {
  filter: none;
  opacity: 0.85;
  transition: opacity var(--duration) var(--ease);
}
.theme-v2 footer img:hover {
  opacity: 1;
}

/* Version info in footer */
.theme-v2 footer div[style*="color: #716C6B"] {
  color: var(--nu-black-20) !important;
}


/* --------------------------------------------------------------------------
   8. CONTENT PAGES
   -------------------------------------------------------------------------- */
.theme-v2 .main-content {
  background: var(--color-surface);
  padding: var(--space-xl) 0;
}

.theme-v2 .contentblock {
  max-width: 1400px;
}

/* Page headers */
.theme-v2 .page-header {
  background: linear-gradient(135deg, var(--nu-purple-10), rgba(255,255,255,0.5));
  border-bottom: 2px solid var(--nu-purple-30);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

/* Tables */
.theme-v2 thead {
  background: var(--nu-purple) !important;
  color: #fff;
}
.theme-v2 thead th {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

/* Side navigation */
.theme-v2 .side-nav-active {
  background: var(--nu-purple) !important;
  border-radius: var(--radius-sm);
}

/* Highlighted text */
.theme-v2 .highlighted {
  background: rgba(255,197,32,0.25);
  border-radius: 3px;
  padding: 0 3px;
}

/* Borders */
.theme-v2 .orange-border {
  border-left-color: var(--nu-purple) !important;
}
.theme-v2 .gray-border {
  border-left-color: var(--nu-purple-10) !important;
}
.theme-v2 .grayrule-bottom,
.theme-v2 .grayborder {
  border-color: var(--nu-black-10) !important;
}

/* Pipes */
.theme-v2 .bluepipebg {
  background: var(--nu-purple-60) !important;
  border-radius: 3px;
}
.theme-v2 .graypipebg {
  background: var(--nu-purple-10) !important;
}


/* --------------------------------------------------------------------------
   9. FORMS & INPUTS
   -------------------------------------------------------------------------- */
.theme-v2 .form-control {
  border-radius: var(--radius-sm);
  border-color: var(--nu-black-20);
  padding: 0.6rem 1rem;
  font-family: 'Noto Serif', serif;
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.theme-v2 .form-control:focus {
  border-color: var(--nu-purple-60);
  box-shadow: 0 0 0 3px rgba(78,42,132,0.12);
}

.theme-v2 .dropdown-menu {
  border-radius: var(--radius-md);
  border: 1px solid rgba(78,42,132,0.12);
  box-shadow: 0 8px 32px rgba(78,42,132,0.18), 0 2px 8px rgba(0,0,0,0.06);
  padding: 0.4rem 0;
  animation: dropIn 0.15s cubic-bezier(0.4,0,0.2,1);
  transform-origin: top center;
}
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
.theme-v2 .dropdown-item {
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  padding: 0.55rem 1.2rem 0.55rem 1.4rem;
  border-left: 3px solid transparent;
  transition: all var(--duration-fast) var(--ease);
  color: var(--nu-black-80);
  position: relative;
}
.theme-v2 .dropdown-item:hover,
.theme-v2 .dropdown-item:focus {
  background: var(--nu-purple-10);
  color: var(--nu-purple-120);
  border-left-color: var(--nu-purple);
  font-weight: 600;
  padding-left: 1.6rem;
}
.theme-v2 .dropdown-item:active {
  background: var(--nu-purple);
  color: #fff;
  border-left-color: var(--nu-purple-120);
}


/* --------------------------------------------------------------------------
  10. SCROLL REVEAL ANIMATIONS
   -------------------------------------------------------------------------- */
.theme-v2 .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--duration-slow) var(--ease), transform var(--duration-slow) var(--ease);
}
.theme-v2 .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}


/* --------------------------------------------------------------------------
  11. VISUALIZATION PAGES — Light Touch
   -------------------------------------------------------------------------- */
/* Don't fight the D3/Three.js renders — just clean up containers */
.theme-v2 .vistablediv {
  border-radius: var(--radius-sm);
  background: var(--color-surface-card);
  border: 1px solid var(--nu-black-10);
}

.theme-v2 .clustertable th {
  color: var(--nu-purple);
}

.theme-v2 .cytoscape-height {
  border-radius: var(--radius-md);
  background: var(--color-surface-card);
  box-shadow: var(--shadow-card);
}


/* --------------------------------------------------------------------------
  12. UTILITY CLASSES
   -------------------------------------------------------------------------- */
.theme-v2 .text-accent { color: var(--nu-purple); }
.theme-v2 .text-gold { color: var(--nu-gold); }
.theme-v2 .text-muted-v2 { color: var(--nu-black-50); }
.theme-v2 .bg-accent-light { background: var(--nu-purple-10); }
.theme-v2 .bg-surface { background: var(--color-surface); }
.theme-v2 .shadow-card { box-shadow: var(--shadow-card); }
.theme-v2 .rounded-v2 { border-radius: var(--radius-md); }

/* Badge/tag for project categories */
.theme-v2 .tag {
  display: inline-block;
  font-family: 'Poppins', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.7rem;
  border-radius: var(--radius-pill);
  background: var(--nu-purple-10);
  color: var(--nu-purple);
}
.theme-v2 .tag-teal { background: rgba(127,206,205,0.2); color: #006C6B; }
.theme-v2 .tag-gold { background: rgba(255,197,32,0.2); color: #8A5F00; }
.theme-v2 .tag-blue { background: rgba(80,145,205,0.2); color: #0D2D6C; }


/* --------------------------------------------------------------------------
  13. PRINT — Strip all theme chrome
   -------------------------------------------------------------------------- */
@media print {
  .theme-v2 #main-nav { position: static; backdrop-filter: none; }
  .theme-v2 footer { background: #fff !important; color: #000 !important; }
  .theme-v2 .theme-toggle-btn { display: none; }
}

/* --------------------------------------------------------------------------
  14. V2 REFRESH — 2026-04-11
   -------------------------------------------------------------------------- */
.theme-v2 {
  --nu-purple-140: #2f1651;
  --surface-base: #f5f1fa;
  --surface-shell: rgba(255, 255, 255, 0.76);
  --surface-panel: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --border-soft: rgba(78, 42, 132, 0.12);
  --border-strong: rgba(78, 42, 132, 0.2);
  --shadow-soft: 0 12px 40px rgba(38, 16, 73, 0.1);
  --shadow-panel: 0 20px 60px rgba(44, 19, 85, 0.14);
  --shadow-lift: 0 28px 80px rgba(34, 12, 68, 0.18);
  --shadow-press: 0 12px 28px rgba(34, 12, 68, 0.14);
  --focus-ring: 0 0 0 3px rgba(127, 206, 205, 0.3), 0 0 0 6px rgba(78, 42, 132, 0.12);
  --panel-blur: blur(22px);
  --page-max: min(1460px, calc(100vw - 1.5rem));
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  background:
    radial-gradient(circle at top left, rgba(255, 197, 32, 0.18), transparent 22%),
    radial-gradient(circle at top right, rgba(127, 206, 205, 0.16), transparent 24%),
    linear-gradient(180deg, #f8f4fc 0%, #f3eff8 44%, #f6f2fa 100%);
  min-height: 100vh;
  position: relative;
}

.theme-v2,
.theme-v2 * {
  scroll-margin-top: 7rem;
}

.theme-v2 h1,
.theme-v2 h2,
.theme-v2 h3,
.theme-v2 h4 {
  text-wrap: balance;
}

.theme-v2 p,
.theme-v2 li,
.theme-v2 label,
.theme-v2 input,
.theme-v2 textarea,
.theme-v2 select,
.theme-v2 table {
  font-family: 'Open Sans', 'Helvetica Neue', sans-serif;
}

.theme-v2 a,
.theme-v2 button,
.theme-v2 .btn,
.theme-v2 .nav-link,
.theme-v2 .dropdown-item,
.theme-v2 .form-control,
.theme-v2 select {
  transition:
    transform var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease),
    border-color var(--duration) var(--ease),
    background-color var(--duration) var(--ease),
    color var(--duration) var(--ease),
    opacity var(--duration-fast) var(--ease);
}

.theme-v2 a:focus-visible,
.theme-v2 button:focus-visible,
.theme-v2 .btn:focus-visible,
.theme-v2 .nav-link:focus-visible,
.theme-v2 .dropdown-item:focus-visible,
.theme-v2 .form-control:focus-visible,
.theme-v2 select:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.theme-v2 .main-content {
  position: relative;
  isolation: isolate;
  padding: clamp(1.4rem, 2vw, 2.4rem) 0 clamp(3rem, 5vw, 5rem);
  background: transparent;
}

.theme-v2 .contentblock,
.theme-v2 #main-nav .container-fluid.limit,
.theme-v2 footer .container-fluid.limit {
  width: var(--page-max);
  max-width: var(--page-max);
}

.theme-v2 #main-nav {
  background: transparent !important;
  padding: 0.6rem 0 0;
  box-shadow: none;
}

.theme-v2 #main-nav::before {
  display: none;
}

.theme-v2 #main-nav .container-fluid.limit {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding: 0.68rem 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow-soft);
  backdrop-filter: var(--panel-blur);
  -webkit-backdrop-filter: var(--panel-blur);
  transition:
    transform var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease),
    background-color var(--duration) var(--ease);
}

.theme-v2 #main-nav.scrolled .container-fluid.limit,
.theme-v2 #main-nav.nav-open .container-fluid.limit {
  transform: translateY(-2px);
  box-shadow: var(--shadow-panel);
  background: rgba(255, 255, 255, 0.88);
}

.theme-v2 .navbar-brand img {
  width: clamp(168px, 18vw, 220px);
  height: auto;
}

.theme-v2 .navbar-light .navbar-nav .nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 37px;
  border-radius: 8px;
  padding: 0.61rem 0.9rem !important;
}

.theme-v2 .navbar-light .navbar-nav .nav-link:hover,
.theme-v2 .navbar-light .navbar-nav .nav-link:focus-visible {
  background: linear-gradient(135deg, rgba(255, 197, 32, 0.18), rgba(228, 224, 238, 0.92));
  box-shadow: 0 10px 24px rgba(78, 42, 132, 0.12);
}

.theme-v2 .navbar-light .navbar-nav .active > .nav-link {
  background: linear-gradient(135deg, rgba(78, 42, 132, 0.14), rgba(255, 197, 32, 0.14));
  box-shadow: 0 10px 24px rgba(78, 42, 132, 0.12);
}

.theme-v2 .navbar-light .navbar-nav .active > .nav-link::after {
  bottom: 7px;
  left: 1rem;
  right: 1rem;
}

/* Login button — visible in both classic and theme-v2 modes */
.nav-login-btn {
  padding-inline: 1.15rem !important;
  background: #4E2A84;
  color: #fff !important;
  border-radius: 8px;
  font-weight: 600;
}

.nav-login-btn:hover,
.nav-login-btn:focus-visible {
  background: #401F68;
  color: #fff !important;
}

.theme-v2 .nav-login-btn {
  background: transparent;
  color: var(--nu-purple) !important;
  border: 1.5px solid rgba(78, 42, 132, 0.35);
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.theme-v2 .nav-login-btn:hover,
.theme-v2 .nav-login-btn:focus-visible {
  background: var(--nu-purple);
  color: #fff !important;
  border-color: var(--nu-purple);
  box-shadow: 0 4px 12px rgba(78, 42, 132, 0.25);
  transform: translateY(-1px);
}

.theme-v2 .navbar-toggler {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow-xs);
}

.theme-v2 .theme-toggle-btn {
  border: 1px solid rgba(255, 197, 32, 0.7);
  background: linear-gradient(135deg, rgba(255, 197, 32, 0.14), rgba(255, 255, 255, 0.9));
  min-height: 48px;
  padding: 0.52rem 1rem;
  border-radius: 10px;
  box-shadow: 0 12px 24px rgba(78, 42, 132, 0.12);
}

.theme-v2 .theme-toggle-btn .toggle-icon {
  display: inline-grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 8px;
  background: rgba(78, 42, 132, 0.12);
}

.theme-v2 .theme-toggle-btn:hover,
.theme-v2 .theme-toggle-btn:focus-visible {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 18px 34px rgba(78, 42, 132, 0.16);
}

.theme-v2 .dropdown-menu {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: var(--panel-blur);
  -webkit-backdrop-filter: var(--panel-blur);
  box-shadow: var(--shadow-panel);
}

.theme-v2 .dropdown-item {
  border-radius: 8px;
  margin: 0 0.45rem;
  padding-left: 1rem;
}

.theme-v2 .dropdown-item:hover,
.theme-v2 .dropdown-item:focus {
  padding-left: 1.15rem;
}

.theme-v2 .btn,
.theme-v2 .buttoncontainer .btn.btn-main,
.theme-v2 .doc-button {
  border-radius: 8px !important;
  min-height: 52px;
  font-weight: 700;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
}

.theme-v2 .btn::before,
.theme-v2 .buttoncontainer .btn.btn-main::before,
.theme-v2 .doc-button::before,
.theme-v2 .theme-toggle-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0));
  opacity: 0;
  transition: opacity var(--duration) var(--ease);
  pointer-events: none;
}

.theme-v2 .btn:hover::before,
.theme-v2 .buttoncontainer .btn.btn-main:hover::before,
.theme-v2 .doc-button:hover::before,
.theme-v2 .theme-toggle-btn:hover::before {
  opacity: 1;
}

.theme-v2 .btn-secondary,
.theme-v2 .buttoncontainer .btn.btn-main,
.theme-v2 .graybg.btn {
  background: linear-gradient(135deg, var(--nu-purple), var(--nu-purple-120)) !important;
  box-shadow: 0 16px 30px rgba(78, 42, 132, 0.22);
}

.theme-v2 .btn-secondary:hover,
.theme-v2 .buttoncontainer .btn.btn-main:hover,
.theme-v2 .graybg.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 42px rgba(78, 42, 132, 0.24);
}

.theme-v2 .btn-cta,
.theme-v2 .btn-ghost {
  min-height: 56px;
  padding-inline: 1.4rem;
  font-size: 0.96rem;
}

.theme-v2 .btn-cta {
  background: linear-gradient(135deg, var(--nu-purple), var(--nu-purple-120));
  box-shadow: 0 18px 38px rgba(78, 42, 132, 0.24);
}

.theme-v2 .btn-ghost {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border-strong);
  box-shadow: 0 12px 28px rgba(78, 42, 132, 0.1);
}

.theme-v2 .btn-ghost:hover,
.theme-v2 .btn-ghost:focus-visible {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 34px rgba(78, 42, 132, 0.14);
}

.theme-v2 .main-content #network-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.48;
  pointer-events: none;
  z-index: 0;
}

.theme-v2 .main-content > *:not(#network-canvas) {
  position: relative;
  z-index: 1;
}

.theme-v2 .home-hero {
  position: relative;
  align-items: stretch;
  row-gap: 1.5rem;
}

.theme-v2 .home-copy-panel,
.theme-v2 .featured-project-card,
.theme-v2 .search-section,
.theme-v2 .table-div,
.theme-v2 .db-button,
.theme-v2 .hero-stat {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.66);
  background: var(--surface-shell);
  box-shadow: var(--shadow-panel);
  backdrop-filter: var(--panel-blur);
  -webkit-backdrop-filter: var(--panel-blur);
  transform-style: preserve-3d;
  will-change: transform, box-shadow;
}

.theme-v2 .home-copy-panel,
.theme-v2 .featured-project-card,
.theme-v2 .search-section,
.theme-v2 .table-div {
  border-radius: var(--radius-lg);
}

.theme-v2 .hero-stat,
.theme-v2 .db-button {
  border-radius: 12px;
}

.theme-v2 .interactive-surface::before,
.theme-v2 .home-copy-panel::before,
.theme-v2 .featured-project-card::before,
.theme-v2 .search-section::before,
.theme-v2 .table-div::before,
.theme-v2 .db-button::before,
.theme-v2 .hero-stat::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(420px circle at var(--spotlight-x, 50%) var(--spotlight-y, 50%), rgba(255, 255, 255, 0.72), transparent 56%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0));
  opacity: 0;
  transition: opacity var(--duration) var(--ease);
  pointer-events: none;
}

.theme-v2 .interactive-surface > *,
.theme-v2 .home-copy-panel > *,
.theme-v2 .featured-project-card > *,
.theme-v2 .search-section > *,
.theme-v2 .table-div > *,
.theme-v2 .db-button > *,
.theme-v2 .hero-stat > * {
  position: relative;
  z-index: 1;
}

@media (hover: hover) and (pointer: fine) {
  .theme-v2 .interactive-surface.is-hovering,
  .theme-v2 .db-button:hover,
  .theme-v2 .search-section:hover,
  .theme-v2 .table-div:hover,
  .theme-v2 .featured-project-card:hover,
  .theme-v2 .home-copy-panel:hover,
  .theme-v2 .hero-stat:hover {
    box-shadow: var(--shadow-lift);
  }

  .theme-v2 .interactive-surface.is-hovering::before,
  .theme-v2 .db-button:hover::before,
  .theme-v2 .search-section:hover::before,
  .theme-v2 .table-div:hover::before,
  .theme-v2 .featured-project-card:hover::before,
  .theme-v2 .home-copy-panel:hover::before,
  .theme-v2 .hero-stat:hover::before {
    opacity: 1;
  }

  .theme-v2 .interactive-surface.is-hovering,
  .theme-v2 .db-button:hover,
  .theme-v2 .search-section:hover,
  .theme-v2 .table-div:hover,
  .theme-v2 .featured-project-card:hover,
  .theme-v2 .home-copy-panel:hover,
  .theme-v2 .hero-stat:hover {
    transform:
      perspective(1200px)
      rotateX(var(--tilt-x, 0deg))
      rotateY(var(--tilt-y, 0deg))
      translateY(-6px);
  }
}

.theme-v2 .home-copy-panel {
  padding: clamp(1.5rem, 4vw, 3rem);
  min-height: 100%;
}

.theme-v2 .home-copy-panel::after {
  content: '';
  position: absolute;
  inset: auto -10% -18% auto;
  width: 18rem;
  height: 18rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 197, 32, 0.24), rgba(255, 197, 32, 0));
  pointer-events: none;
}

.theme-v2 .hero-kicker,
.theme-v2 .featured-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: 'Poppins', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--nu-purple);
}

.theme-v2 .hero-kicker::before,
.theme-v2 .featured-label::before {
  content: '';
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--nu-gold), var(--nu-purple));
  box-shadow: 0 0 0 6px rgba(255, 197, 32, 0.14);
}

.theme-v2 .hero-lead {
  font-size: clamp(1.06rem, 1.8vw, 1.22rem);
  line-height: 1.82;
  color: var(--nu-black);
}

.theme-v2 .hero-actions {
  gap: 0.75rem;
}

.theme-v2 .hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.theme-v2 .hero-stat {
  padding: 1rem 1.1rem;
  content-visibility: auto;
}

.theme-v2 .hero-stat-value {
  display: block;
  font-family: 'Poppins', sans-serif;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 700;
  color: var(--nu-purple-120);
}

.theme-v2 .hero-stat-label {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--nu-black-50);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.theme-v2 .featured-project-card {
  padding: clamp(1.3rem, 3vw, 2rem);
  min-height: 100%;
}

.theme-v2 .featured-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--border-soft);
  box-shadow: 0 10px 24px rgba(78, 42, 132, 0.08);
  font-family: 'Poppins', sans-serif;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.theme-v2 .featured-link:hover,
.theme-v2 .featured-link:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(78, 42, 132, 0.12);
}

.theme-v2 .projectsnap {
  position: relative;
}

.theme-v2 .projectsnap img,
.theme-v2 #projectimage {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 14px !important;
  box-shadow: 0 24px 50px rgba(41, 17, 77, 0.18);
}

.theme-v2 .projectdescription h3,
.theme-v2 .projectdescription p,
.theme-v2 .featured-project-card p,
.theme-v2 .db-button p {
  max-width: none;
}

.theme-v2 .projlist {
  margin-top: 1rem !important;
}

.theme-v2 .projlist .row > [class*="col-"] {
  display: flex;
}

.theme-v2 .db-button {
  padding: 1.35rem !important;
  border: 1px solid rgba(255, 255, 255, 0.72) !important;
  box-shadow: 0 16px 42px rgba(41, 17, 77, 0.14);
  content-visibility: auto;
  contain-intrinsic-size: 380px;
}

.theme-v2 #select-db > div,
.theme-v2 .projlist [class*="col-"] {
  content-visibility: auto;
}

.theme-v2 #select-db > div {
  display: flex;
}

.theme-v2 #select-db .buttoncontainer {
  width: 100%;
  display: block;
  padding: 0 !important;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(78, 42, 132, 0.12), rgba(127, 206, 205, 0.12)) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.theme-v2 #select-db .buttoncontainer.orangepipebg {
  background: linear-gradient(135deg, rgba(255, 197, 32, 0.24), rgba(78, 42, 132, 0.14)) !important;
}

.theme-v2 .db-button h5,
.theme-v2 .db-button h5 a {
  color: var(--nu-purple-140);
}

.theme-v2 .db-button .db_label > p:first-of-type {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--nu-black-50);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.theme-v2 .db-button .setdesc {
  margin-top: 0.6rem;
}

.theme-v2 .db_svg .line {
  stroke: var(--nu-purple);
  stroke-width: 3px;
  fill: none;
  opacity: 0.55;
}

.theme-v2 .contentblock .row,
.theme-v2 .contentblock .container-fluid.limit {
  position: relative;
}

.theme-v2 #mainrow {
  align-items: flex-start;
  row-gap: 1.5rem;
}

.theme-v2 #side-nav {
  margin-top: 0 !important;
  position: sticky;
  top: 7.2rem;
  align-self: flex-start;
  z-index: 3;
}

.theme-v2 #side-nav .nav-pills {
  gap: 0.75rem;
}

.theme-v2 #side-nav .nav-item {
  margin-top: 0 !important;
}

.theme-v2 #side-nav .buttoncontainer {
  width: 100%;
  padding: 0 !important;
  border-radius: 12px;
  background: transparent !important;
}

.theme-v2 #side-nav .buttoncontainer .btn.btn-main {
  width: 100%;
  min-height: 58px;
  justify-content: flex-start;
  padding-inline: 1rem 1.2rem;
  background: linear-gradient(135deg, rgba(78, 42, 132, 0.08), rgba(255, 255, 255, 0.92)) !important;
  color: var(--nu-purple-120) !important;
  box-shadow: 0 14px 26px rgba(78, 42, 132, 0.08);
}

.theme-v2 #side-nav .side-nav-active .btn.btn-main,
.theme-v2 #side-nav .orangepipebg .btn.btn-main {
  background: linear-gradient(135deg, var(--nu-purple), var(--nu-purple-120)) !important;
  color: #fff !important;
  box-shadow: 0 20px 34px rgba(78, 42, 132, 0.22);
}

.theme-v2 .search-section {
  width: 100%;
  margin: 0 0 1.5rem !important;
  padding: clamp(1.25rem, 2vw, 2rem);
  box-shadow: var(--shadow-panel);
  border-color: rgba(255, 255, 255, 0.7);
  content-visibility: auto;
  contain-intrinsic-size: 540px;
}

.theme-v2 .search-section h3,
.theme-v2 .search-section h4,
.theme-v2 .search-section h5 {
  width: 100%;
  margin-bottom: 1rem;
}

.theme-v2 .search-section .col-12.mx-auto.d-flex.justify-content-center {
  margin-bottom: 0.65rem;
}

.theme-v2 #database-select-div,
.theme-v2 #search-text-div,
.theme-v2 #filter-docs-div,
.theme-v2 #select-vis-div,
.theme-v2 #vis-params-div,
.theme-v2 #review-docs-div {
  border-radius: var(--radius-lg);
}

.theme-v2 #select-db {
  width: 100%;
  max-height: min(58vh, 720px) !important;
  padding-right: 0.35rem;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(78, 42, 132, 0.35) transparent;
}

.theme-v2 .rounded-none,
.theme-v2 .form-control,
.theme-v2 .form-control-sm,
.theme-v2 select,
.theme-v2 textarea {
  border-radius: 18px !important;
}

.theme-v2 .form-control,
.theme-v2 .form-control-sm,
.theme-v2 select,
.theme-v2 textarea {
  min-height: 52px;
  border: 1px solid rgba(78, 42, 132, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 241, 250, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 10px 24px rgba(78, 42, 132, 0.06);
  padding-inline: 1rem;
}

.theme-v2 .form-control:focus,
.theme-v2 .form-control-sm:focus,
.theme-v2 select:focus,
.theme-v2 textarea:focus {
  border-color: rgba(78, 42, 132, 0.32);
  box-shadow: var(--focus-ring);
}

.theme-v2 label.form-label,
.theme-v2 .form-group label {
  font-family: 'Poppins', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--nu-purple-120);
  letter-spacing: 0.01em;
}

.theme-v2 .tinytext {
  color: var(--nu-black-50);
  font-size: 0.83rem;
}

.theme-v2 .doc-button {
  background: linear-gradient(135deg, rgba(78, 42, 132, 0.92), rgba(64, 31, 104, 0.96)) !important;
  box-shadow: 0 16px 30px rgba(78, 42, 132, 0.18);
}

.theme-v2 .doc-button:hover,
.theme-v2 .doc-button:focus-visible,
.theme-v2 .doc-button.selected {
  transform: translateY(-2px);
  box-shadow: 0 22px 36px rgba(78, 42, 132, 0.22);
}

/* GPU-only large-corpus row separator */
.theme-v2 .gpu-docs-row-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 2px;
  border-top: 1px solid rgba(78, 42, 132, 0.25);
  margin-top: 4px;
}

.theme-v2 .gpu-docs-row-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(78, 42, 132, 0.85);
}

.theme-v2 .gpu-docs-row-sub {
  font-size: 0.68rem;
  color: rgba(100, 100, 120, 0.75);
}

.theme-v2 .gpu-doc-btn {
  background: linear-gradient(135deg, rgba(40, 100, 160, 0.85), rgba(20, 70, 130, 0.92)) !important;
  box-shadow: 0 12px 24px rgba(20, 70, 130, 0.18);
  font-size: 0.85rem;
}

.theme-v2 .gpu-doc-btn:hover,
.theme-v2 .gpu-doc-btn:focus-visible,
.theme-v2 .gpu-doc-btn.selected {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px rgba(20, 70, 130, 0.28);
}

/* Side nav: completed steps (.bluepipebg) are clickable for back-navigation */
.theme-v2 .bluepipebg:not(.disabled),
.theme-v2 .bluepipebg:not(.disabled) .btn-main {
  cursor: pointer;
}

.theme-v2 .bluepipebg:not(.disabled) {
  transition: filter 0.15s ease;
}

.theme-v2 .bluepipebg:not(.disabled):hover {
  filter: brightness(1.12);
}

/* Side nav step-completion checkmark — shown once the user advances past a step.
   :not(.hidden) prevents the higher-specificity display:inline-block from
   overriding Bootstrap's .hidden {display:none} on un-reached steps. */
.theme-v2 .step-done-check:not(.hidden) {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 900;
  color: #4caf50;
  vertical-align: middle;
  margin-left: 5px;
  opacity: 0.95;
  line-height: 1;
}

/* Submit / Create Model button — bump font one notch above btn-lg default (1.25rem) */
.theme-v2 .submit-btn-bump {
  font-size: 1.4rem;
  padding: 0.55rem 1.6rem;
  letter-spacing: 0.02em;
}

/* Download Query JSON — secondary utility button below Create Model */
.theme-v2 .query-dl-btn {
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: rgba(78, 42, 132, 0.72);
  border-color: rgba(78, 42, 132, 0.3);
  padding: 4px 14px;
  transition: all 0.18s ease;
}
.theme-v2 .query-dl-btn:hover {
  color: rgba(78, 42, 132, 1);
  border-color: rgba(78, 42, 132, 0.65);
  background: rgba(78, 42, 132, 0.05);
}
.theme-v2 .query-dl-btn:active {
  background: rgba(78, 42, 132, 0.12);
}

.theme-v2 .table-div {
  padding: 0.5rem;
  overflow: auto;
  content-visibility: auto;
  contain-intrinsic-size: 520px;
}

.theme-v2 .table {
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
}

.theme-v2 .table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  border: 0;
  background: linear-gradient(135deg, var(--nu-purple), var(--nu-purple-120)) !important;
  color: #fff;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 1rem 0.9rem;
}

.theme-v2 .table thead th:first-child {
  border-top-left-radius: 18px;
}

.theme-v2 .table thead th:last-child {
  border-top-right-radius: 18px;
}

.theme-v2 .table td {
  padding: 0.95rem 0.9rem;
  border-top: 1px solid rgba(78, 42, 132, 0.08);
  color: var(--nu-black-80);
  background: rgba(255, 255, 255, 0.72);
}

.theme-v2 .table-striped tbody tr:nth-of-type(odd) td {
  background: rgba(248, 244, 252, 0.88);
}

.theme-v2 .table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.95);
}

.theme-v2 .table a.btn,
.theme-v2 .table .btn {
  min-height: 40px;
  padding-inline: 0.9rem;
  font-size: 0.78rem;
}

.theme-v2 .page-header,
.theme-v2 .table-div,
.theme-v2 .search-section,
.theme-v2 .featured-project-card,
.theme-v2 .home-copy-panel {
  container-type: inline-size;
}

.theme-v2 footer {
  margin-top: clamp(2rem, 4vw, 4rem);
  border-top: 0 !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0)),
    linear-gradient(180deg, rgba(78, 42, 132, 0.06), rgba(78, 42, 132, 0.02));
}

.theme-v2 footer .container-fluid.limit {
  padding: 2rem 1.5rem;
  border-radius: 18px 18px 0 0;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow-panel);
  backdrop-filter: var(--panel-blur);
  -webkit-backdrop-filter: var(--panel-blur);
}

.theme-v2 footer img {
  filter: none;
  opacity: 0.96;
}

.theme-v2 .reveal {
  opacity: 0;
  transform: translateY(18px);
}

.theme-v2 .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@container (max-width: 560px) {
  .theme-v2 .hero-metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1199px) {
  .theme-v2 #main-nav .container-fluid.limit {
    padding: 0.9rem 1rem;
    border-radius: 16px;
  }

  .theme-v2 .navbar-collapse {
    margin-top: 0.85rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(78, 42, 132, 0.08);
    box-shadow: var(--shadow-panel);
  }

  .theme-v2 .navbar-nav.ml-auto,
  .theme-v2 .navbar-nav.navbar-right {
    gap: 0.5rem;
  }
}

@media (max-width: 991px) {
  .theme-v2 .contentblock,
  .theme-v2 #main-nav .container-fluid.limit,
  .theme-v2 footer .container-fluid.limit {
    width: min(100vw - 1rem, 100%);
    max-width: min(100vw - 1rem, 100%);
  }

  .theme-v2 .home-copy-panel,
  .theme-v2 .featured-project-card,
  .theme-v2 .search-section,
  .theme-v2 .table-div {
    border-radius: 16px;
  }

  .theme-v2 #side-nav {
    position: static;
    top: auto;
    margin-bottom: 0.75rem;
  }

  .theme-v2 #side-nav .nav-pills {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    scroll-snap-type: x proximity;
  }

  .theme-v2 #side-nav .nav-item {
    flex: 0 0 min(260px, 82vw);
    scroll-snap-align: start;
  }

  .theme-v2 #mainrow > .col-lg-8 {
    margin: 0 !important;
  }

  .theme-v2 #search-text-div .col-md-6.align-items-center.mx-auto,
  .theme-v2 #filter-docs-div .col-12,
  .theme-v2 .search-section > .col-12 {
    padding-left: 0;
    padding-right: 0;
  }
}

@media (max-width: 767px) {
  .theme-v2 .main-content {
    padding-top: 1rem;
  }

  .theme-v2 #main-nav {
    padding-top: 0.45rem;
  }

  .theme-v2 #main-nav .container-fluid.limit {
    padding: 0.85rem 0.85rem 1rem;
    border-radius: 14px;
  }

  .theme-v2 .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .theme-v2 .hero-actions .btn-group {
    margin-right: 0 !important;
    width: 100%;
  }

  .theme-v2 .hero-actions .btn {
    width: 100%;
  }

  .theme-v2 .hero-metrics {
    grid-template-columns: 1fr;
  }

  .theme-v2 .projintro {
    align-items: flex-start !important;
    gap: 0.75rem;
    flex-direction: column;
  }

  .theme-v2 .search-section {
    padding: 1rem;
  }

  .theme-v2 .table thead th,
  .theme-v2 .table td {
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-v2 .interactive-surface,
  .theme-v2 .db-button,
  .theme-v2 .search-section,
  .theme-v2 .table-div,
  .theme-v2 .featured-project-card,
  .theme-v2 .home-copy-panel,
  .theme-v2 .hero-stat,
  .theme-v2 .btn,
  .theme-v2 .theme-toggle-btn,
  .theme-v2 .reveal {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}

/* --------------------------------------------------------------------------
  15. MY MODELS PAGE
   -------------------------------------------------------------------------- */
.theme-v2 .models-page {
  display: grid;
  gap: 1rem;
}

.theme-v2 .models-page-head,
.theme-v2 .models-section {
  position: relative;
  border-radius: 16px;
}

.theme-v2 .models-page-head {
  padding: clamp(1rem, 2vw, 1.5rem);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(250, 246, 252, 0.76)),
    radial-gradient(circle at top right, rgba(255, 197, 32, 0.16), transparent 28%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-panel);
  backdrop-filter: var(--panel-blur);
  -webkit-backdrop-filter: var(--panel-blur);
}

.theme-v2 .models-page-kicker {
  font-family: 'Poppins', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--nu-purple);
}

.theme-v2 .models-page-subtitle,
.theme-v2 .models-section-copy {
  max-width: 72ch;
  color: var(--nu-black-50);
}

.theme-v2 .models-section {
  padding: 0.75rem 1.1rem;
  background: rgba(255, 255, 255, 0.2);
}

.theme-v2 .models-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
  padding-inline: 0.2rem;
}

.theme-v2 .models-count {
  min-width: auto;
  min-height: auto;
  font-size: 0.78rem;
  border-radius: 5px;
  padding: 0.15rem 0.55rem;
  box-shadow: none;
}
/* Hide zero-count badges for Running and Favorites — only meaningful counts shown */
.theme-v2 .models-count.is-zero {
  display: none;
}

.theme-v2 .models-table-shell {
  padding: 0.75rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow-panel);
  backdrop-filter: var(--panel-blur);
  -webkit-backdrop-filter: var(--panel-blur);
  overflow: auto;
}

.theme-v2 .models-table-shell.is-empty {
  padding: 1rem;
}

.theme-v2 .models-empty {
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(248, 244, 252, 0.96), rgba(255, 255, 255, 0.94)),
    radial-gradient(circle at top right, rgba(255, 197, 32, 0.12), transparent 28%);
  border: 1px dashed rgba(78, 42, 132, 0.2);
  text-align: center;
}

.theme-v2 .models-empty-title {
  margin: 0;
  color: var(--nu-purple-120);
}

.theme-v2 .models-empty-copy {
  margin: 0;
  max-width: none;
}

.theme-v2 .models-table {
  width: 100%;
  min-width: 1160px;
  table-layout: auto;
  border-collapse: separate;
  border-spacing: 0;
}

.theme-v2 .models-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 1rem 1rem;
}

.theme-v2 .models-table tbody tr:first-child td:first-child {
  border-top-left-radius: 20px;
}

.theme-v2 .models-table tbody tr:first-child td:last-child {
  border-top-right-radius: 20px;
}

.theme-v2 .models-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 20px;
}

.theme-v2 .models-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 20px;
}

.theme-v2 .models-table td {
  vertical-align: middle;
  padding: 1.1rem 1rem;
}

.theme-v2 .models-row.status-running td {
  background: linear-gradient(180deg, rgba(249, 246, 252, 0.98), rgba(243, 238, 249, 0.96));
}

.theme-v2 .models-row.status-finished td {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 244, 252, 0.94));
}

.theme-v2 .models-row.status-cancelled td {
  background: linear-gradient(180deg, rgba(255, 248, 245, 0.94), rgba(252, 242, 240, 0.9));
}

.theme-v2 .models-row.status-failed td {
  background: linear-gradient(180deg, rgba(255, 244, 244, 0.96), rgba(255, 236, 236, 0.92));
}

.theme-v2 .model-meta-stack,
.theme-v2 .model-status-stack {
  display: grid;
  gap: 0.3rem;
}

.theme-v2 .model-meta-primary {
  font-weight: 600;
  color: var(--nu-black);
}

.theme-v2 .model-meta-secondary {
  font-size: 0.82rem;
  color: var(--nu-black-50);
}

.theme-v2 .models-col-query {
  min-width: 10rem;
  max-width: 18rem;
}

.theme-v2 .models-col-parameters {
  min-width: 12rem;
}

.theme-v2 .models-col-visualization {
  min-width: 11rem;
}

.theme-v2 .models-col-status {
  min-width: 14rem;
}

.theme-v2 .models-col-actions {
  min-width: 14rem;
}

.theme-v2 .status-pill,
.theme-v2 .runtime-pill,
.theme-v2 .running-doc-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 8px;
  white-space: nowrap;
}

.theme-v2 .status-pill {
  padding: 0.45rem 0.85rem;
  font-family: 'Poppins', sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.theme-v2 .status-pill.status-finished {
  background: rgba(88, 185, 71, 0.16);
  color: #23691c;
}

.theme-v2 .status-pill.status-running {
  background: rgba(78, 42, 132, 0.14);
  color: var(--nu-purple-120);
}

.theme-v2 .status-pill.status-cancelled {
  background: rgba(239, 85, 63, 0.14);
  color: #9b2f21;
}

.theme-v2 .status-pill.status-failed {
  background: rgba(239, 85, 63, 0.16);
  color: #a23224;
}

.theme-v2 .status-pill.status-neutral {
  background: rgba(13, 45, 108, 0.12);
  color: var(--nu-navy);
}

.theme-v2 .runtime-pill {
  padding: 0.38rem 0.78rem;
  background: rgba(78, 42, 132, 0.08);
  color: var(--nu-purple-120);
  font-family: 'Poppins', sans-serif;
  font-size: 0.76rem;
  font-weight: 600;
}

.theme-v2 .models-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
}

.theme-v2 .models-actions .btn {
  min-height: 42px;
  padding: 0.55rem 0.95rem;
  font-size: 0.76rem;
}

.theme-v2 .models-btn-open {
  background: linear-gradient(135deg, var(--nu-purple), var(--nu-purple-120)) !important;
}

.theme-v2 .models-btn-favorite {
  background: linear-gradient(135deg, #7652b5, #4e2a84) !important;
}

.theme-v2 .models-btn-delete {
  background: linear-gradient(135deg, #5a367f, #47256d) !important;
}

.theme-v2 .models-btn-cancel {
  background: linear-gradient(135deg, #8a2d24, #6f221d) !important;
}

.theme-v2 .models-btn-ok {
  background: linear-gradient(135deg, #2e7d32, #1b5e20) !important;
}

.theme-v2 .running-status-card {
  display: grid;
  gap: 0.6rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(243, 238, 249, 0.92)),
    radial-gradient(circle at top right, rgba(255, 197, 32, 0.16), transparent 30%);
  border: 1px solid rgba(78, 42, 132, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 10px 20px rgba(78, 42, 132, 0.08);
}

.theme-v2 .running-status-top,
.theme-v2 .running-status-bottom {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.theme-v2 .running-status-top {
  margin-bottom: -0.1rem;
}

.theme-v2 .running-status-bottom {
  justify-content: space-between;
  flex-wrap: wrap;
}

.theme-v2 .running-status-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--nu-purple), var(--nu-gold));
  box-shadow: 0 0 0 6px rgba(78, 42, 132, 0.08);
  animation: v2Pulse 1.8s ease-in-out infinite;
}

@keyframes v2Pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.24); opacity: 0.56; }
}

.theme-v2 .lm-status-label {
  color: var(--nu-purple-120);
  font-family: 'Poppins', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
}

.theme-v2 .running-status-track {
  height: 0.42rem;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(78, 42, 132, 0.12);
}

.theme-v2 .lm-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--nu-purple), var(--nu-gold));
  transition: width 0.4s ease;
}

/* Indeterminate shimmer for pre-pipeline phase (SFN routing / Batch boot) */
.theme-v2 .lm-progress-fill.lm-progress-indeterminate {
  background: linear-gradient(
    90deg,
    var(--nu-purple) 0%,
    var(--nu-gold) 50%,
    var(--nu-purple) 100%
  );
  background-size: 200% 100%;
  animation: lm-shimmer 1.8s ease-in-out infinite;
}

@keyframes lm-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.theme-v2 .lm-step-fraction,
.theme-v2 .running-elapsed {
  font-family: 'Poppins', sans-serif;
  font-size: 0.74rem;
  font-weight: 600;
}

.theme-v2 .lm-step-fraction {
  color: var(--nu-purple-60);
}

.theme-v2 .running-elapsed {
  color: var(--nu-purple-120);
}

.theme-v2 .running-doc-chip {
  padding: 0.24rem 0.65rem;
  background: rgba(78, 42, 132, 0.1);
  color: var(--nu-purple-120);
  font-family: 'Poppins', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
}

@media (max-width: 1199px) {
  .theme-v2 .models-section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .theme-v2 .models-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  .theme-v2 .models-table-shell {
    overflow: visible;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .theme-v2 .models-table {
    min-width: 0;
  }

  .theme-v2 .models-table thead {
    display: none;
  }

  .theme-v2 .models-table,
  .theme-v2 .models-table tbody,
  .theme-v2 .models-table tr,
  .theme-v2 .models-table td {
    display: block;
    width: 100%;
  }

  .theme-v2 .models-table tbody {
    display: grid;
    gap: 1rem;
  }

  .theme-v2 .models-table tr {
    padding: 0.35rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow: var(--shadow-panel);
  }

  .theme-v2 .models-table td {
    display: grid;
    grid-template-columns: minmax(6.5rem, 8.5rem) minmax(0, 1fr);
    gap: 0.7rem;
    padding: 0.85rem 0.95rem;
    border-top: 1px solid rgba(78, 42, 132, 0.08);
    border-radius: 0 !important;
    background: transparent !important;
  }

  .theme-v2 .models-table td:first-child {
    border-top: 0;
  }

  .theme-v2 .models-table td::before {
    content: attr(data-label);
    font-family: 'Poppins', sans-serif;
    font-size: 0.73rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--nu-purple-60);
  }

  .theme-v2 .models-col-actions {
    grid-template-columns: 1fr;
  }

  .theme-v2 .models-col-actions::before {
    margin-bottom: 0.4rem;
  }

  .theme-v2 .models-actions {
    justify-content: flex-start;
  }

  .theme-v2 .running-status-bottom {
    justify-content: flex-start;
  }
}

/* --------------------------------------------------------------------------
  15B. MY MODELS CARD REFRESH
   -------------------------------------------------------------------------- */
.theme-v2 .models-list-shell {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.theme-v2 .models-list {
  display: grid;
  gap: 0.75rem;
}

.theme-v2 .models-empty {
  padding: 1.4rem;
  border-radius: 12px;
  box-shadow: 0 12px 26px rgba(78, 42, 132, 0.08);
}

.theme-v2 .model-card {
  display: grid;
  gap: 1.1rem;
  padding: 1.2rem;
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(248, 244, 252, 0.9)),
    radial-gradient(circle at top right, rgba(255, 197, 32, 0.12), transparent 28%);
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 36px rgba(78, 42, 132, 0.1);
  backdrop-filter: var(--panel-blur);
  -webkit-backdrop-filter: var(--panel-blur);
}

.theme-v2 .model-card.status-running {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(243, 238, 249, 0.94)),
    radial-gradient(circle at top right, rgba(127, 206, 205, 0.16), transparent 32%);
}

.theme-v2 .model-card.status-finished {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(247, 251, 246, 0.94)),
    radial-gradient(circle at top right, rgba(88, 185, 71, 0.12), transparent 28%);
}

.theme-v2 .model-card.status-failed,
.theme-v2 .model-card.status-cancelled {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(253, 244, 244, 0.94)),
    radial-gradient(circle at top right, rgba(239, 85, 63, 0.12), transparent 28%);
}

.theme-v2 .model-card-head,
.theme-v2 .model-card-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.theme-v2 .model-card-title-block {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.theme-v2 .model-card-id {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.32rem 0.7rem;
  border-radius: 8px;
  background: rgba(78, 42, 132, 0.08);
  color: var(--nu-purple-120);
  font-family: 'Poppins', sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.theme-v2 .model-card-query {
  margin: 0;
  color: var(--nu-black);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  word-break: break-word;
}

.theme-v2 .model-card-meta {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.85rem;
}

.theme-v2 .model-card-meta-item {
  display: grid;
  gap: 0.32rem;
  padding: 0.85rem 0.95rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(78, 42, 132, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.theme-v2 .model-card-meta-label {
  font-family: 'Poppins', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--nu-purple-60);
}

.theme-v2 .model-card-meta-value {
  color: var(--nu-black);
  font-size: 0.98rem;
  line-height: 1.5;
  word-break: break-word;
}

.theme-v2 .model-card-footer-copy {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(78, 42, 132, 0.08);
  color: var(--nu-black-50);
  font-size: 0.9rem;
}

.theme-v2 .model-status-stack {
  align-content: start;
}

.theme-v2 .models-actions {
  flex-shrink: 0;
}

.theme-v2 .running-status-card {
  min-width: min(26rem, 100%);
  padding: 0.95rem 1rem;
  border-radius: 12px;
  box-shadow: 0 10px 20px rgba(78, 42, 132, 0.08);
}

.theme-v2 .models-page .status-pill,
.theme-v2 .models-page .runtime-pill,
.theme-v2 .models-page .running-doc-chip {
  box-shadow: none;
}

@media (max-width: 1200px) {
  .theme-v2 .model-card-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .theme-v2 .models-page-head,
  .theme-v2 .models-section {
    border-radius: 14px;
  }

  .theme-v2 .model-card {
    padding: 1rem;
    border-radius: 14px;
  }

  .theme-v2 .model-card-head,
  .theme-v2 .model-card-footer {
    flex-direction: column;
  }

  .theme-v2 .model-card-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .theme-v2 .running-status-card {
    width: 100%;
    min-width: 0;
  }

  .theme-v2 .models-actions {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .theme-v2 .model-card-meta {
    grid-template-columns: 1fr;
  }

  .theme-v2 .models-actions {
    display: grid;
    width: 100%;
  }

  .theme-v2 .models-actions .btn {
    width: 100%;
  }

  .theme-v2 .running-status-bottom {
    justify-content: flex-start;
  }
}


/* --------------------------------------------------------------------------
   TECH REFRESH PAGE
   -------------------------------------------------------------------------- */
.theme-v2 .tech-refresh-header {
  text-align: center;
  max-width: 48rem;
  margin: 0 auto var(--space-xl);
}

.theme-v2 .tech-refresh-kicker {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--nu-purple-60);
  margin-bottom: var(--space-sm);
}

.theme-v2 .tech-refresh-lead {
  font-size: 1.15rem;
  color: var(--nu-black-80);
  max-width: 52ch;
  margin: 0 auto;
}

.theme-v2 .tech-refresh-section {
  margin-bottom: var(--space-xl);
}

.theme-v2 .tech-refresh-section h2 {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--nu-purple-10);
}

.theme-v2 .tech-refresh-list {
  list-style: none;
  padding-left: 0;
}

.theme-v2 .tech-refresh-list li {
  position: relative;
  padding: 0.6rem 0 0.6rem 1.6rem;
  line-height: 1.7;
  color: var(--nu-black-80);
}

.theme-v2 .tech-refresh-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--nu-purple);
}

/* GPU / Viz card grid */
.theme-v2 .tech-refresh-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.theme-v2 .tech-refresh-card {
  background: var(--color-surface-card);
  border: 1px solid var(--nu-purple-10);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--duration) var(--ease),
              transform var(--duration) var(--ease);
}

.theme-v2 .tech-refresh-card:hover {
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

.theme-v2 .tech-refresh-card h4 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.theme-v2 .tech-refresh-card p {
  font-size: 0.92rem;
  margin-bottom: 0;
}

/* Badges inside tech-refresh cards */
.theme-v2 .tr-badge {
  display: inline-block;
  font-family: 'Poppins', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-pill);
  vertical-align: middle;
  line-height: 1.5;
}

.theme-v2 .tr-badge-gpu {
  background: linear-gradient(135deg, var(--nu-green) 0%, #3d9e2e 100%);
  color: #fff;
}

.theme-v2 .tr-badge-new {
  background: linear-gradient(135deg, var(--nu-gold) 0%, #e6a800 100%);
  color: var(--nu-black);
}

/* Infrastructure stats row */
.theme-v2 .tech-refresh-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.theme-v2 .tr-stat {
  text-align: center;
  padding: 1.4rem 1rem;
  background: var(--color-surface-card);
  border: 1px solid var(--nu-purple-10);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.theme-v2 .tr-stat-value {
  display: block;
  font-family: 'Poppins', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--nu-purple);
  line-height: 1.2;
}

.theme-v2 .tr-stat-label {
  display: block;
  font-size: 0.85rem;
  color: var(--nu-black-50);
  margin-top: 0.3rem;
}

/* CTA section */
.theme-v2 .tech-refresh-cta {
  text-align: center;
  padding: var(--space-lg);
  background: var(--nu-purple-10);
  border-radius: var(--radius-lg);
}


/* --------------------------------------------------------------------------
   FEEDBACK FORM
   -------------------------------------------------------------------------- */
.theme-v2 .feedback-header {
  text-align: center;
}

.theme-v2 .feedback-lead {
  font-size: 1.05rem;
  color: var(--nu-black-80);
  max-width: 52ch;
  margin: 0 auto;
}

.theme-v2 .feedback-thanks {
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
  background: var(--color-surface-card);
  border: 1px solid var(--nu-purple-10);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.theme-v2 .feedback-thanks h2 {
  color: var(--nu-green);
}

.theme-v2 .feedback-form .form-group {
  margin-bottom: 1.4rem;
}

.theme-v2 .feedback-form label {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
  display: block;
  color: var(--nu-black);
}

.theme-v2 .feedback-form .form-control {
  border: 1px solid var(--nu-black-20);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  font-size: 0.95rem;
  transition: border-color var(--duration) var(--ease),
              box-shadow var(--duration) var(--ease);
}

.theme-v2 .feedback-form .form-control:focus {
  border-color: var(--nu-purple);
  box-shadow: 0 0 0 3px rgba(78, 42, 132, 0.12);
  outline: none;
}

.theme-v2 .feedback-form textarea.form-control {
  resize: vertical;
  min-height: 8rem;
}

.theme-v2 .feedback-submit {
  margin-top: var(--space-sm);
}

/* Drag-and-drop zone */
.theme-v2 .drop-zone {
  position: relative;
  border: 2px dashed var(--nu-black-20);
  border-radius: var(--radius-md);
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--duration) var(--ease),
              background var(--duration) var(--ease);
}

.theme-v2 .drop-zone:hover,
.theme-v2 .drop-zone.drag-over {
  border-color: var(--nu-purple);
  background: var(--nu-purple-10);
}

.theme-v2 .drop-zone-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  pointer-events: none;
}

.theme-v2 .drop-zone-prompt {
  color: var(--nu-black-50);
}

.theme-v2 .drop-zone-prompt svg {
  color: var(--nu-purple-60);
  margin-bottom: 0.5rem;
}

.theme-v2 .drop-zone-hint {
  font-size: 0.8rem;
  color: var(--nu-black-20);
}

.theme-v2 .drop-zone-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.theme-v2 .drop-zone-filename {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--nu-purple);
}

.theme-v2 .drop-zone-remove {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--nu-red);
  cursor: pointer;
  padding: 0 0.3rem;
  transition: opacity var(--duration-fast);
}

.theme-v2 .drop-zone-remove:hover {
  opacity: 0.7;
}


/* --------------------------------------------------------------------------
   NEW BADGE (model cards -- multilevel LDA parallel speedup)
   -------------------------------------------------------------------------- */
.theme-v2 .vis-badge-new {
  display: inline-block;
  font-family: 'Poppins', sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--nu-gold) 0%, #e6a800 100%);
  color: var(--nu-black);
  margin-left: 0.4rem;
  vertical-align: middle;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   16. MOBILE TOUCH OVERRIDES (PIPELINE WIZARD)
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {
  /* iOS Safari Auto-Zoom Fix: inputs must be at least 16px */
  .theme-v2 form input,
  .theme-v2 form select,
  .theme-v2 form textarea {
    font-size: 16px !important; 
  }

  /* Transform stacked navigation column into a horizontal row step counter */
  .theme-v2 #side-nav {
    margin-top: 1rem !important;
    margin-bottom: 2rem !important;
  }

  .theme-v2 #side-nav ul {
    flex-direction: row !important;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
    gap: 0.5rem;
  }

  .theme-v2 #side-nav .nav-item {
    flex: 0 0 auto;
    width: auto;
    margin-top: 0 !important;
  }

  .theme-v2 #side-nav .buttoncontainer {
    padding-left: 4px;
  }

  /* Initialize the wizard steps more compact on mobile */
  .theme-v2 #side-nav button {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    white-space: nowrap;
    width: auto !important;
  }

  /* Completely hide the data review step on mobile to prevent empty rendering */
  .theme-v2 #review-data-sources-nav {
    display: none !important;
  }


  /* Nested Scrolling Fixes: change hardcoded px heights to vh */
  .theme-v2 #select-db,
  .theme-v2 #doc-table-wrapper,
  .theme-v2 #article-panel {
    height: auto !important;
    max-height: 60vh !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Data Table / Charts Wrapping for Mobile */
  .theme-v2 .dc-doc-table,
  .theme-v2 #database-select-div > .row {
    overflow-x: auto !important;
  }
}

/* --------------------------------------------------------------------------
   Document-preview modal ergonomics (global)
   Defensive layering on top of Bootstrap 5 defaults. The 2026-04-22
   regression ("modal opens, body won't scroll, X/Close unreachable")
   kept resurfacing because the scrollable dialog's height computation
   depends on .modal having viewport height — and any theme that shifts
   .modal's containing block breaks that. Pin the dialog to viewport
   height and force pointer events on the chrome so nothing intercepts
   clicks on the close buttons.
   -------------------------------------------------------------------------- */
.modal-content {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, .25);
    pointer-events: auto;
}
.modal.show .modal-dialog-scrollable {
    height: calc(100vh - 3.5rem);
    max-height: calc(100vh - 3.5rem);
}
.modal-dialog-scrollable .modal-content {
    max-height: 100%;
    overflow: hidden;
}
.modal-dialog-scrollable .modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.modal-header,
.modal-footer {
    pointer-events: auto;
    flex-shrink: 0;
}
.modal-header .btn-close,
.modal-footer .btn {
    position: relative;
    z-index: 2;
    pointer-events: auto;
}
.modal-header .btn-close {
    width: 1.75rem;
    height: 1.75rem;
    padding: .5rem;
    background-color: #fff;
    border: 2px solid #4e2a84;
    border-radius: 50%;
    opacity: 1;
}
.modal-header .btn-close:hover,
.modal-header .btn-close:focus {
    background-color: #f0e9fa;
    box-shadow: 0 0 0 .2rem rgba(78, 42, 132, .25);
}
