  :root {
      --primary-50: #eff6ff;
      --primary-100: #dbeafe;
      --primary-500: #3b82f6;
      --primary-600: #2563eb;
      --primary-700: #1d4ed8;
      --primary-900: #1e3a8a;

      --accent-500: #10b981;
      --accent-600: #059669;

      --danger-500: #ef4444;
      --danger-600: #dc2626;

      --gray-50: #f9fafb;
      --gray-100: #f3f4f6;
      --gray-200: #e5e7eb;
      --gray-300: #d1d5db;
      --gray-400: #9ca3af;
      --gray-500: #6b7280;
      --gray-600: #4b5563;
      --gray-700: #374151;
      --gray-800: #1f2937;
      --gray-900: #111827;

      --white: #ffffff;
      --black: #000000;

      /* Semantic colors */
      --text-primary: var(--gray-900);
      --text-secondary: var(--gray-600);
      --text-tertiary: var(--gray-500);
      --text-muted: var(--gray-400);

      --bg-primary: var(--white);
      --bg-secondary: var(--gray-50);
      --bg-tertiary: var(--gray-100);

      --border-light: var(--gray-200);
      --border-medium: var(--gray-300);

      /* Glass morphism */
      --glass-bg: rgba(255, 255, 255, 0.85);
      --glass-border: rgba(255, 255, 255, 0.2);
      --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
      --glass-backdrop: blur(16px);

      /* Shadows */
      --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
      --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
      --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
      --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);

      /* Spacing scale */
      --space-1: 0.25rem;
      --space-2: 0.5rem;
      --space-3: 0.75rem;
      --space-4: 1rem;
      --space-5: 1.25rem;
      --space-6: 1.5rem;
      --space-8: 2rem;
      --space-10: 2.5rem;
      --space-12: 3rem;
      --space-16: 4rem;

      /* Border radius */
      --radius-sm: 0.375rem;
      --radius-md: 0.5rem;
      --radius-lg: 0.75rem;
      --radius-xl: 1rem;
      --radius-full: 9999px;

      /* Transitions */
      --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
      --transition-base: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
      --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      --transition-bounce: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);

      /* Typography */
      --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', 'Helvetica Neue', Arial, sans-serif;
      --font-weight-medium: 500;
      --font-weight-semibold: 600;
      --font-weight-bold: 700;

      --text-xs: 0.75rem;
      --text-sm: 0.875rem;
      --text-base: 1.125rem;
      --text-lg: 1.125rem;
      --text-xl: 1.25rem;
      --text-2xl: 1.5rem;

      --leading-tight: 1.25;
      --leading-normal: 1.5;
      --leading-relaxed: 1.625;
  }

  /* Reset and Base */
  *,
  *::before,
  *::after {
      box-sizing: border-box;
      /* margin: 0; */
  }

  .content {
      max-width: 1200px;
      margin: 0 auto;
      /* background: blueviolet; */
      padding: var(--space-2);
      /* border-radius: var(--radius-xl); */
      /* box-shadow: var(--shadow-sm); */
  }

  main {
      padding: var(--space-2);
      flex: 1;
  }

  body {
    display: flex;
    flex-direction: column;
      font-family: var(--font-sans);
      background: var(--bg-secondary);
      color: var(--text-primary);
      font-size: var(--text-base);
      /* line-height: var(--leading-normal); */
      min-height: 100vh;
      
      /* flex-direction: column; */
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
  }
  

  /* Header Styles */
  header {
      background: var(--glass-bg);
      backdrop-filter: var(--glass-backdrop);
      border-bottom: 1px solid var(--glass-border);
      box-shadow: var(--glass-shadow);
      position: sticky;
      top: 0;
      z-index: 1000;
  }

  .header-container {
      margin: 0 auto;
      padding: 0 var(--space-6);
      display: flex;
      align-items: center;
      justify-content: space-between;
      min-height: 72px;
      gap: var(--space-2);
  }

  .branding {
      display: flex;
      align-items: center;
      gap: var(--space-1);
      flex-shrink: 0;
  }

  .harvard-logo {
      height: 55px;
      width: auto;
      flex-shrink: 0;
      margin-right: -20px;
  }

  .brand-content {
      display: flex;
      flex-direction: column;
      gap: var(--space-1);
  }

  .brand-title {
      font-size: var(--text-xl);
      font-weight: var(--font-weight-bold);
      color: var(--text-primary);
      line-height: var(--leading-tight);
      margin: 0;
  }

  .brand-title a {
      text-decoration: none;
      color: inherit;
  }

  .brand-subtitle {
      font-size: var(--text-xs);
      color: var(--text-tertiary);
      font-weight: var(--font-weight-medium);
      letter-spacing: 0.05em;
      text-transform: uppercase;
      line-height: 1;
  }

  .nav-wrapper {
      display: flex;
      align-items: center;
      gap: var(--space-6);
  }

  .primary-nav {
      display: flex;
      align-items: center;
      gap: var(--space-1);
  }

  .nav-link {
      padding: var(--space-2) var(--space-4);
      border-radius: var(--radius-lg);
      font-weight: var(--font-weight-medium);
      font-size: var(--text-sm);
      color: var(--text-primary);
      text-decoration: none;
      transition: all var(--transition-fast);
  }

  .nav-link:hover {
      background: var(--primary-50);
      color: var(--primary-700);
  }
  
  .nav-link-active {
      background: var(--primary-100);
      /* color: var(--accent-500); */
  }

  /* Enhanced Mobile Menu Toggle with Accessibility */
  .menu-toggle {
      display: none;
      align-items: center;
      justify-content: center;
      width: 44px;
      height: 44px;
      background: var(--bg-primary);
      border: 1px solid var(--border-light);
      border-radius: var(--radius-lg);
      cursor: pointer;
      transition: all var(--transition-fast);
      box-shadow: var(--shadow-xs);
      outline: none;
  }

  .menu-toggle:hover {
      background: var(--bg-secondary);
      border-color: var(--border-medium);
      box-shadow: var(--shadow-sm);
  }

  .menu-toggle:focus {
      outline: 2px solid var(--primary-500);
      outline-offset: 2px;
      border-color: var(--primary-500);
  }

  .menu-toggle:active {
      transform: scale(0.95);
  }

  .sr-only {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
  }

  .hamburger {
      display: flex;
      flex-direction: column;
      width: 18px;
      height: 14px;
      justify-content: space-between;
  }

  .hamburger-line {
      height: 2px;
      width: 100%;
      background: var(--text-primary);
      border-radius: 1px;
      transition: all var(--transition-slow);
      transform-origin: center;
  }

  .menu-toggle.active .hamburger-line:nth-child(1) {
      transform: translateY(6px) rotate(45deg);
  }

  .menu-toggle.active .hamburger-line:nth-child(2) {
      opacity: 0;
      transform: scaleX(0);
  }

  .menu-toggle.active .hamburger-line:nth-child(3) {
      transform: translateY(-6px) rotate(-45deg);
  }

  .mobile-nav {
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      background: var(--bg-primary);
      backdrop-filter: var(--glass-backdrop);
      border-bottom: 1px solid var(--glass-border);
      box-shadow: var(--shadow-lg);
      padding: var(--space-6);
      transform: translateY(-100%);
      opacity: 0;
      visibility: hidden;
      transition: all var(--transition-slow);
      max-height: 0;
      overflow: hidden;
  }

  .mobile-nav.active {
      transform: translateY(0);
      opacity: 1;
      visibility: visible;
      max-height: 500px;
  }

  .mobile-nav-links {
      display: flex;
      flex-direction: column;
      gap: var(--space-2);
  }

  .mobile-nav .nav-link {
      padding: var(--space-3) var(--space-4);
      text-align: center;
      display: block;
  }

  /* Mobile responsive */
  @media (max-width: 768px) {
      .header-container {
          min-height: 56px;
          gap: var(--space-2);
          padding: 0 var(--space-3);
      }

      .harvard-logo {
          height: 42px;
      }

      /* .branding {
          flex-direction: row;
          gap: var(--space-2);
          flex-shrink: 0;
          min-width: 0;
      } */

      /* .brand-content {
          min-width: 0;
          flex-shrink: 0;
      } */

      /*
      .brand-title {
          line-height: 1.2;
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
      }
      */

      /* .brand-subtitle {
          display: none;
      } */

      .menu-toggle {
          display: flex;
          flex-shrink: 0;
          width: 40px;
          height: 40px;
      }

      .nav-wrapper {
          display: none;
      }
  }

  /* Breakpoint for very tight space - stack title below logo */
  @media (max-width: 560px) {
      .header-container {
          min-height: 64px;
      }

     
      .brand-title {
          /* font-size: var(--text-xs); */
          /* white-space: normal; */
          /* Allow wrapping when stacked */
          overflow: visible;
          text-overflow: initial;
          max-width: none;
          line-height: 1.1;
      }

      /* .harvard-logo {
          height: 28px;
      } */
  }

  @media (max-width: 480px) {
      .header-container {
          padding: 0 var(--space-2);
          min-height: 60px;
          /* Increased to accommodate stacked layout */
          gap: var(--space-1);
      }

      .harvard-logo {
          height: 30px;
      }

      /* .branding { */
          /* gap: var(--space-1); */
          /* max-width: calc(100vw - 60px); */
          /* Reserve space for hamburger */
      /* } */

      /* .brand-title {
          font-size: 0.7rem;
          max-width: none;
          /* Remove width constraint when stacked */
      

      .menu-toggle {
          width: 36px;
          height: 36px;
      }

      .hamburger {
          width: 16px;
          height: 12px;
      }

      .menu-toggle.active .hamburger-line:nth-child(1) {
          transform: translateY(5px) rotate(45deg);
      }

      .menu-toggle.active .hamburger-line:nth-child(3) {
          transform: translateY(-5px) rotate(-45deg);
      }
  }

  /* Smallest screens - ensure proper stacking */
  @media (max-width: 380px) {
      .header-container {
          min-height: 56px;
          padding: 0 var(--space-1);
      }

      .harvard-logo {
          margin-right: -15px;
          height: 38px;
      }

      .brand-title {
          font-size: 1.0rem;
          line-height: 1;
      }

      .menu-toggle {
          width: 32px;
          height: 32px;
      }

      .hamburger {
          width: 14px;
          height: 10px;
      }

      .menu-toggle.active .hamburger-line:nth-child(1) {
          transform: translateY(4px) rotate(45deg);
      }

      .menu-toggle.active .hamburger-line:nth-child(3) {
          transform: translateY(-4px) rotate(-45deg);
      }
  }



  .content-card {
      background: var(--bg-primary);
      border: 1px solid var(--border-light);
      border-radius: var(--radius-xl);
      box-shadow: var(--shadow-sm);
      padding: var(--space-5);
      margin-bottom: var(--space-6);
      max-width: 100%;
      width: 100%;
      overflow-x: auto;
      transition: all var(--transition-fast);

  }



  .card-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: var(--space-6);
      padding-bottom: var(--space-4);
      border-bottom: 1px solid var(--border-light);
  }

  .card-title {
      font-size: var(--text-2xl);
      font-weight: var(--font-weight-bold);
      color: var(--text-primary);
      margin: 0;
      display: flex;
      align-items: center;
      gap: var(--space-3);
  }

  .card-icon {
      width: 32px;
      height: 32px;

      border-radius: var(--radius-lg);
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      font-size: var(--text-lg);
  }

  .card-badge {
      background: var(--primary-50);
      color: var(--primary-700);
      padding: var(--space-1) var(--space-3);
      border-radius: var(--radius-full);
      font-size: var(--text-xs);
      font-weight: var(--font-weight-semibold);
      text-transform: uppercase;
      letter-spacing: 0.05em;
  }

  .card-content {
      display: grid;
      gap: var(--space-6);
  }

  .content-section {
      display: flex;
      flex-direction: column;
      gap: var(--space-4);
  }

  .section-title {
      font-size: var(--text-lg);
      font-weight: var(--font-weight-semibold);
      color: var(--text-primary);
      margin: 0;
      display: flex;
      align-items: center;
      gap: var(--space-2);
  }

  .section-title::before {
      content: '';
      width: 4px;
      height: 20px;
      background: linear-gradient(135deg, var(--accent-500), var(--accent-600));
      border-radius: var(--radius-sm);
  }

  .feature-grid {
      display: flexbox;
      grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
      gap: var(--space-4);
  }

  .feature-item {
      display: flex;
      align-items: flex-start;
      gap: var(--space-3);
      padding: var(--space-4);
      margin-bottom: 1rem;
      background: var(--bg-secondary);
      border-radius: var(--radius-lg);
      transition: all var(--transition-fast);
  }



  .feature-icon {
      width: 24px;
      height: 24px;
      /* background: var(--accent-500); */
      /* border-radius: var(--radius-md); */
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      /* font-size: var(--text-sm); */
      flex-shrink: 0;
      margin-top: 2px;
  }

  .feature-content {
      flex: 1;
  }

  .feature-title {
      font-weight: var(--font-weight-semibold);
      color: var(--text-primary);
      margin-bottom: var(--space-1);
      font-size: var(--text-sm);
  }

  .feature-description {
      /* color: var(--text-secondary); */
      /* font-size: var(--text-sm); */
      line-height: var(--leading-relaxed);
      margin: 0;
  }

  .stats-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
      gap: var(--space-4);
  }

  .stat-item {
      text-align: center;
      padding: var(--space-6) var(--space-4);
      background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
      border-radius: var(--radius-lg);
      border: 1px solid var(--border-light);
      transition: all var(--transition-fast);
  }

  .stat-item:hover {
      transform: translateY(-2px);
      box-shadow: var(--shadow-sm);
  }

  .stat-number {
      font-size: var(--text-2xl);
      font-weight: var(--font-weight-bold);
      color: var(--primary-600);
      margin-bottom: var(--space-2);
      display: block;
  }

  .stat-label {
      color: var(--text-secondary);
      font-size: var(--text-sm);
      font-weight: var(--font-weight-medium);
      margin: 0;
  }

  @media (max-width: 768px) {
      .card-header {
          flex-direction: column;
          align-items: flex-start;
          gap: var(--space-3);
      }

      .feature-grid {
          grid-template-columns: 1fr;
      }

      .stats-grid {
          grid-template-columns: repeat(2, 1fr);
      }
  }

  @media (max-width: 480px) {
      .content-card {
          padding: var(--space-4);
          border-radius: 0%;
          bord
      }

      .stats-grid {
          grid-template-columns: 1fr;
      }

      .card-title {
          font-size: var(--text-xl);
      }
  }


  footer {
      margin-top: auto;
      text-align: center;
      padding: var(--space-6);
      font-size: var(--text-sm);
      color: var(--text-muted);
      border-top: 1px solid var(--border-light);
      background: var(--bg-primary);
  }

  .footer-inner {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: var(--space-3);
      flex-wrap: wrap;
  }

  .footer-link {
      color: var(--text-muted);
      text-decoration: none;
      transition: color var(--transition-fast);
  }

  /* Action Buttons */
  .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: var(--space-2);
      padding: var(--space-2) var(--space-4);
      border-radius: var(--radius-lg);
      font-weight: var(--font-weight-semibold);
      font-size: var(--text-sm);
      line-height: 1;
      white-space: nowrap;
      transition: all var(--transition-fast);
      cursor: pointer;
      border: none;
      outline: none;
      position: relative;
      overflow: hidden;
      min-height: 36px;
      text-decoration: none;
      
  }
  
  .btn-primary {
      background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
      color: white;
      box-shadow: var(--shadow-sm);
      min-width: 8rem;
  }

  .btn-primary:hover {
      background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
      box-shadow: var(--shadow-md);
      transform: translateY(-1px);
      color: white;
  }



  .btn-danger {
      background: linear-gradient(135deg, var(--danger-500), var(--danger-600));
      color: white;
      box-shadow: var(--shadow-sm);
  }

  .btn-danger:hover {
      background: linear-gradient(135deg, var(--danger-600), #b91c1c);
      box-shadow: var(--shadow-md);
      transform: translateY(-1px);
      color: white;
  }

html {
  height: 100%;
}

  /* --- base hide/show controlled by htmx --- */
  #spinner {
      display: none;
  }

  #spinner.htmx-request {
      display: grid;
  }

  /* ========== FULL-SCREEN OVERLAY ========== */
  #spinner.loading {
      position: fixed;
      inset: 0;
      z-index: 1000;
      background: rgba(0, 0, 0, .5);
      /* static */
      place-items: center;
      /* kill inherited transitions that might fade bg */
      transition: none !important;
      animation: none !important;
  }

  /* ========== INNER CARD ========== */
  #spinner .loading-card {
      background: var(--bg-secondary);
      padding: 2rem 3rem;
      border-radius: .75rem;
      font-weight: 600;
      font-size: 1.05rem;
      text-align: center;
      /* animate TEXT ONLY */
      /* --pulse-min: .4; */
      /* animation: loadingTextPulse 1.2s ease-in-out infinite; */
  }

  #spinner .loading-card span,
  #spinner .loading-card {
      color: inherit;
  }

  /* Keyframes: fade text, not bg */
  @keyframes loadingTextPulse {

      0%,
      100% {
          opacity: 1;
      }

      50% {
          opacity: var(--pulse-min);
      }
  }


  .markdown-body table {
      border-collapse: collapse;
      /* no double borders      */
      /* width: 100%;                            optional full-width     */
      /* margin: 1rem; */
      max-width: 100%;
      margin: var(--space-4) 0;

  }

  .markdown-body th,
  .markdown-body td {
      border: 1px solid var(--border-light);
      /* or #ccc / #999 etc.     */
      padding: 0.5rem 0.75rem;
      /* nice breathing room     */
      text-align: left;
      /* tweak as you wish       */
  }

  .markdown-body thead th {
      background: var(--bg-tertiary);
      /* subtle header shading   */
      font-weight: 600;
  }