:root {
    --accent: #008080;
    --accent-hover: #006766;
    --bg-page: #fafafa;
    --bg-card: #ffffff;
    --text: #333333;
  }
  
  *, *::before, *::after {
    box-sizing: border-box;
  }
  
  body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background: var(--bg-page);
    color: var(--text);
    line-height: 1.6;
  }
  
  .site-wordmark {
    text-decoration: none;
    color: #1a1f26;
    font-family: 'Inter', 'Avenir Next', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    font-feature-settings: "kern" 1, "liga" 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }
  .site-wordmark:hover {
    color: #1e242c;
    background-color: transparent;
  }

  @keyframes disco-gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
  }


  
  nav {
    background: var(--bg-card);
    border-bottom: 1px solid #ececec;
  }
  nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  nav li {
    position: relative;
  }
  nav a {
    display: block;
    padding: 0.55rem 0.95rem;
    text-decoration: none;
    color: #6b7280;
    font-size: 0.9375rem;
    font-weight: 400;
    border-radius: 8px;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
  }
  nav a:hover {
    background-color: rgba(0, 0, 0, 0.04);
    color: #374151;
  }
  .dropdown:hover .dropdown-menu {
    display: block;
  }
  .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-card);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    margin: 0;
    padding: 0;
    z-index: 10;
    border-radius: 8px;
    overflow: hidden;
    min-width: 160px;
  }
  .dropdown-menu li a {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: #6b7280;
    border-radius: 0;
    white-space: nowrap;
    text-align: left;
  }
  .dropdown-menu li a:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #374151;
    border-radius: 0;
  }
  
  .container {
    max-width: 900px;
    margin: 20px auto;
    padding: 0 20px;
  }
  
  .section {
    background: var(--bg-card);
    padding: 24px;
    margin-bottom: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  }
  
  /* Hero on home page */
  #hero {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    align-items: center;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  #hero img {
    width: 100%;
    max-width: 400px;
    object-fit: contain;
    border-radius: 8px;
  }
  .hero-text p {
    font-size: 0.95rem;
  }
  
  /* Forms */
  .form-group {
    margin-bottom: 15px;
  }
  label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
  }
  input[type="email"],
  textarea,
  select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
  }
  textarea {
    resize: vertical;
    min-height: 120px;
  }
  button {
    background: var(--accent);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
  }
  button:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
  }

  button:disabled {
    background: #e0e0e0;
    color: #999;
    border-color: #ccc;
    cursor: not-allowed;
    transform: none;
  }

  button:disabled:hover {
    background: #e0e0e0;
    transform: none;
  }
  
  /* Annotate page extras */
  #how-it-works .how-it-works-heading {
    margin: 0;
  }
  #how-it-works .how-it-works-toggle {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font: inherit;
    padding: 0;
  }
  #how-it-works .how-it-works-toggle:hover {
    background: none;
    color: var(--accent);
    transform: none;
  }
  #how-it-works .how-it-works-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
  }
  #how-it-works .how-it-works-chevron {
    display: inline-block;
    transition: transform 0.2s ease;
  }
  #how-it-works .how-it-works-toggle[aria-expanded="true"] .how-it-works-chevron {
    transform: rotate(180deg);
  }
  #howItWorksSteps[hidden] {
    display: none !important;
  }
  .steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 24px;
    margin-top: 16px;
  }
  .step {
    text-align: center;
    padding: 16px;
    background: var(--bg-card);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  }
  
 /* file picker */
 /* hide the real file input */

 /* hide the real file input */
.file-group input[type="file"] {
    display: none !important;
  }
  
  /* container for the custom picker */
  .file-group {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
  }
  
  /* the always-visible "Browse" button */
  .file-btn {
    padding: 8px 12px;
    background: linear-gradient(135deg, #00b3b3, #008080);
    color: #fff;
    border: 1px solid #00b3b3;
    border-radius: 4px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    display: inline-block;
    white-space: nowrap;
    flex-shrink: 0;
  }
  
  /* dropdown menu (hidden by default) */
  .file-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-card);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    margin: 0;
    padding: 0;
    z-index: 10;
  }
  
  /* each menu item */
  .file-menu button {
    display: block;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    text-align: left;
    color: var(--accent);
    cursor: pointer;
  }
  
  /* hover state for both Browse and menu items */
  .file-btn:hover,
  .file-menu button:hover {
    background: linear-gradient(135deg, #009999, #006666);
    color: #fff;
    border-color: #009999;
  }
  
  /* keep the filename from wrapping and constrain its width */
  .file-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    display: inline-block;
    flex-shrink: 1;
  }

  /* Test data button styling */
  .test-data-btn {
  background: #eef2f7;
  color: #334155;
  border: 1px solid #cbd5e1;
  box-shadow: none;
  animation: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  }

  .test-data-btn:hover {
  background: #e2e8f0;
  color: #1f2937;
  border-color: #94a3b8;
  box-shadow: none;
    transform: translateY(-1px);
  }

  .test-data-btn.clicked {
    background: linear-gradient(135deg, #6b7280, #9ca3af);
    color: #fff;
    border: 1px solid #6b7280;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    animation: none;
  }

  .test-data-btn.clicked:hover {
    background: linear-gradient(135deg, #6b7280, #9ca3af);
    border-color: #6b7280;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: none;
  }

  @keyframes pulse-glow {
    0% {
      box-shadow: 0 0 10px rgba(79, 70, 229, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    100% {
      box-shadow: 0 0 15px rgba(79, 70, 229, 0.5), 0 2px 4px rgba(0, 0, 0, 0.1);
    }
  }
  
  /* Progress */
  #progress-container {
    margin-top: 10px;
    display: none;
    background: transparent;
    padding: 10px 2px 0;
    border-radius: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
  }
  #progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
  }
  #progress-header h3 {
    margin: 0;
  }
  #cancelUploadButton {
    font-size: 0.78rem;
    padding: 3px 10px;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    cursor: pointer;
    line-height: 1.4;
  }
  #cancelUploadButton:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #9ca3af;
  }
  #cancelUploadButton:disabled {
    opacity: 0.45;
    cursor: not-allowed;
  }
  #progress-bar {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
  }
  #progress-fill {
    width: 0%;
    height: 100%;
    background: var(--accent);
    transition: width 0.3s ease;
  }
  #progress-messages {
    max-height: 300px;
    overflow-y: auto;
  }
  .progress-message {
    padding: 8px;
    margin: 4px 0;
    border-radius: 4px;
    background: #fff;
    border-left: 4px solid var(--accent);
  }
  .progress-message.error {
    border-left-color: #dc3545;
  }
  .progress-message.success {
    border-left-color: #28a745;
  }
  .progress-message.info {
    border-left-color: #17a2b8;
  }
  .progress-message.warning {
    border-left-color: #fbbf24;
    background: #fef3c7;
  }
  
  /* Custom tooltip for cell warnings */
  .cell-warning-tooltip {
    position: relative;
    cursor: help;
    color: #d97706;
    font-weight: 500;
  }
  
  .cell-warning-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    padding: 8px 12px;
    background-color: #1f2937;
    color: #fff;
    font-size: 13px;
    font-weight: normal;
    line-height: 1.4;
    white-space: nowrap;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  }
  
  .cell-warning-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 2px;
    border: 6px solid transparent;
    border-top-color: #1f2937;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
  }
  
  .cell-warning-tooltip:hover::after,
  .cell-warning-tooltip:hover::before {
    opacity: 1;
  }
  
  @media (max-width: 600px) {
    .nav-menu {
      flex-direction: column;
      align-items: flex-start;
    }
    .container {
      padding: 0 10px;
    }
  }

  /* ============================================================================
     MODERN MODAL SYSTEM - Notion/Linear Style
     Unified, clean, compact design for all modals
     ============================================================================ */
  
  /* Modal Overlay - Dark backdrop with blur */
  .modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    padding: 16px;
    overflow-y: auto;
  }
  
  .modal[style*="display: flex"],
  .modal[style*="display: block"] {
    display: flex !important;
  }
  
  /* Modal Container - Compact, centered, clean */
  .modal-content {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 560px; /* Compact default: 520-680px range */
    max-height: calc(100vh - 32px);
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12), 
                0 8px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin: auto;
    animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }
  
  /* Size variants for different modal types */
  .modal-content.modal-sm {
    max-width: 480px;
  }
  
  .modal-content.modal-md {
    max-width: 600px;
  }
  
  .modal-content.modal-lg {
    max-width: 900px;
  }
  
  .modal-content.modal-xl {
    max-width: 1200px;
  }
  
  @keyframes modalFadeIn {
    from {
      opacity: 0;
      transform: scale(0.96) translateY(8px);
    }
    to {
      opacity: 1;
      transform: scale(1) translateY(0);
    }
  }
  
  /* Modal Header - Minimal, no heavy chrome */
  .modal-header {
    padding: 24px 24px 20px 24px;
    border-bottom: none; /* Remove thick dividers */
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
  }
  
  .modal-header h2,
  .modal-header h3 {
    margin: 0;
    font-size: 1.125rem; /* Smaller, calmer title */
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
    letter-spacing: -0.01em;
  }
  
  /* Small Icon Close Button */
  .modal-close,
  .modal-header .close {
    background: transparent;
    border: none;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #999;
    border-radius: 6px;
    transition: all 0.15s ease;
    padding: 0;
    font-size: 1.125rem;
    line-height: 1;
    flex-shrink: 0;
  }
  
  .modal-close:hover,
  .modal-header .close:hover {
    background: #f5f5f5;
    color: #1a1a1a;
  }
  
  .modal-close:active,
  .modal-header .close:active {
    background: #e8e8e8;
  }
  
  /* Modal Body - Compact padding, uses 8px scale */
  .modal form,
  .modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
  }
  
  /* Form Group Styles - Smaller, calmer inputs */
  .modal .form-group {
    margin-bottom: 16px; /* 8px scale spacing */
  }
  
  .modal .form-group:last-child {
    margin-bottom: 0;
  }
  
  .modal .form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #666; /* Muted label color */
    font-size: 0.8125rem; /* Smaller labels */
    line-height: 1.4;
  }
  
  .modal .form-group input,
  .modal .form-group textarea,
  .modal .form-group select {
    width: 100%;
    max-width: 100%; /* Constrain inside modal */
    padding: 10px 12px;
    height: 42px; /* 40-44px height range */
    border: 1.5px solid #e5e5e5;
    border-radius: 8px;
    font-size: 0.9375rem;
    transition: all 0.15s ease;
    box-sizing: border-box;
    color: #1a1a1a;
    background: #ffffff;
    font-family: inherit;
  }
  
  .modal .form-group textarea {
    height: auto;
    min-height: 80px;
    padding: 10px 12px;
  }
  
  .modal .form-group input:focus,
  .modal .form-group textarea:focus,
  .modal .form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 128, 128, 0.08);
  }
  
  .modal .form-group input::placeholder {
    color: #999;
  }

  .modal .form-group input:disabled,
  .modal .form-group input[readonly] {
    background: #f5f5f5;
    color: #888;
    cursor: not-allowed;
    border-color: #e5e5e5;
  }

  .modal .form-group small,
  .modal .form-text {
    display: block;
    margin-top: 6px;
    font-size: 0.8125rem;
    color: #888; /* Subtle helper text */
    line-height: 1.4;
  }
  
  /* Secondary Action Links - Minimal, subtle */
  .modal .secondary-action {
    text-align: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    font-size: 0.875rem;
    color: #888;
  }
  
  .modal .secondary-action a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
  }
  
  .modal .secondary-action a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
  }
  
  /* Modal Buttons - Full width, consistent 44px height */
  .btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0 24px;
    height: 44px;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
  }
  
  .btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 128, 128, 0.2);
  }
  
  .btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 128, 128, 0.2);
  }
  
  .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  
  .btn-secondary {
    background: #f5f5f5;
    color: #666;
    border: 1.5px solid #e0e0e0;
    padding: 0 24px;
    height: 44px;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
  }
  
  .btn-secondary:hover:not(:disabled) {
    background: #e8e8e8;
    border-color: #d0d0d0;
  }
  
  .btn-secondary:active:not(:disabled) {
    background: #e0e0e0;
  }
  
  .btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  
  /* Modal Footer - Minimal spacing, uses 8px scale */
  .modal-footer {
    padding: 16px 24px 24px 24px;
    border-top: none; /* Remove border, use whitespace */
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    align-items: center;
    flex-shrink: 0;
  }
  
  .modal-footer .btn,
  .modal-footer .btn-primary,
  .modal-footer .btn-secondary {
    min-width: 100px;
    width: auto;
  }
  
  /* Modal Error/Success Messages - Subtle, compact */
  .modal-error {
    color: #dc3545;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 16px;
    font-size: 0.875rem;
    display: none;
    line-height: 1.5;
  }
  
  .modal-success {
    color: #059669;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 16px;
    font-size: 0.875rem;
    line-height: 1.5;
    animation: fadeIn 0.2s ease-in;
  }
  
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  /* Responsive Modal Adjustments */
  @media (max-width: 768px) {
    .modal {
      padding: 0;
      align-items: flex-end;
    }

    .modal-content {
      max-width: 100%;
      max-height: 92vh;
      border-radius: 20px 20px 0 0;
      margin: 0;
    }

    .modal-header {
      padding: 22px 22px 16px 22px;
    }

    .modal-header h2,
    .modal-header h3 {
      font-size: 1.15rem;
    }

    .modal form,
    .modal-body {
      padding: 0 22px 22px 22px;
    }

    .modal .form-group {
      margin-bottom: 18px;
    }

    .modal .form-group label {
      font-size: 0.875rem;
      margin-bottom: 7px;
    }

    .modal .form-group input,
    .modal .form-group textarea,
    .modal .form-group select {
      font-size: 16px; /* prevents iOS auto-zoom */
      height: 48px;
      padding: 12px 14px;
      border-radius: 10px;
    }

    .modal .form-group textarea {
      height: auto;
      min-height: 90px;
    }

    .btn-primary {
      height: 50px;
      font-size: 1rem;
      border-radius: 10px;
    }

    .modal .secondary-action {
      font-size: 0.9375rem;
      padding-top: 18px;
      margin-top: 18px;
    }

    .modal-footer {
      padding: 14px 22px 24px 22px;
    }
  }

  @media (max-width: 480px) {
    .modal-header {
      padding: 20px 18px 14px 18px;
    }

    .modal form,
    .modal-body {
      padding: 0 18px 18px 18px;
    }

    .modal-footer {
      padding: 12px 18px 20px 18px;
    }

    .modal .form-group {
      margin-bottom: 16px;
    }
  }
  
  .spinner {
    display: none;
    margin-right: 8px;
  }
  
  /* ============================================================================
     PRICING PLANS STYLES (used in modals)
     ============================================================================ */
  .form-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
  }
  
  .form-section:last-of-type {
    margin-bottom: 1rem;
  }
  
  .form-section-title {
    margin: 0 0 1.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.5rem;
  }
  
  .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
  }
  
  .form-row .form-group:last-child {
    margin-bottom: 0;
  }
  
  .form-check-group {
    padding: 1.25rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  }
  
  .form-check-group .checkbox-label {
    display: flex;
    align-items: center;
    font-weight: 500;
    margin-bottom: 0.75rem;
    cursor: pointer;
    user-select: none;
  }
  
  .form-check-group input[type="checkbox"] {
    margin-right: 0.75rem;
    transform: scale(1);
  }
  
  .checkbox-with-text {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
  }
  
  .checkbox-with-text:hover {
    border-color: #007bff;
    box-shadow: 0 4px 16px rgba(0,123,255,0.15);
    transform: translateY(-1px);
  }
  
  .checkbox-with-text::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #28a745);
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  
  .checkbox-with-text:hover::before {
    opacity: 1;
  }
  
  .checkbox-with-text .checkbox-container {
    position: relative;
    flex-shrink: 0;
    margin-top: 0.125rem;
  }
  
  .checkbox-with-text input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
  }
  
  .checkbox-with-text .checkbox-custom {
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    transition: all 0.2s ease;
    position: relative;
    cursor: pointer;
  }
  
  .checkbox-with-text input[type="checkbox"]:checked + .checkbox-custom {
    background-color: #007bff;
    border-color: #007bff;
  }
  
  .checkbox-with-text input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
  }
  
  .checkbox-with-text .checkbox-custom:hover {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
  }
  
  .checkbox-with-text .description-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .checkbox-with-text .description-text {
    color: #495057;
    font-size: 1rem;
    line-height: 1.4;
    margin: 0;
    font-weight: 600;
    letter-spacing: 0.01em;
  }
  
  .checkbox-with-text .description-subtitle {
    color: #6c757d;
    font-size: 0.875rem;
    line-height: 1.4;
    margin: 0;
    font-weight: 400;
    opacity: 0.8;
  }
  
  .form-check-group .form-text {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-left: 1.75rem;
  }
  
  /* Enhanced Modal Footer */
  .modal-footer {
    padding: 1.5rem 0 0 0;
    border-top: 1px solid #e9ecef;
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    align-items: center;
  }
  
  .modal-footer .btn {
    padding: 0;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
    height: 44px;
    width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    font-size: 1rem;
    line-height: 1;
    border: none;
    cursor: pointer;
    margin: 0;
  }
  
  .modal-footer .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  }
  
  /* Modal input styles are now handled by .modal .form-group input */
  /* Placeholder and autofill styles are now handled by .modal .form-group input */
  
  /* Modal input styles are now handled by .modal .form-group input */
  /* Modal input styles are now handled by .modal .form-group input */

/* FAQ Styles */
.faq-item {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.faq-item:last-child {
  margin-bottom: 0;
}

.faq-item h3 {
  color: var(--accent);
  margin-bottom: 1rem;
  font-size: 1.3em;
}

.faq-item h4 {
  color: var(--accent);
  margin-bottom: 1rem;
  font-size: 1.2em;
}

.faq-item p {
  line-height: 1.6;
  color: #555;
}

.faq-category {
  margin-bottom: 3rem;
}

.faq-category:last-child {
  margin-bottom: 0;
}

.faq-category h3 {
  color: var(--accent);
  font-size: 1.5em;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent);
}

/* ============================================================================
   LEGACY MODAL SUPPORT - Maps old classes to new unified system
   Keep for backward compatibility during transition
   ============================================================================ */

/* Inference Modal - now uses unified modal system */
.inference-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  justify-content: center;
  align-items: center;
  padding: 16px;
  overflow-y: auto;
}

.inference-modal[style*="display: block"] {
  display: flex !important;
}

.inference-modal-content {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 1200px; /* Wider for data table */
  max-height: calc(100vh - 32px);
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12), 
              0 8px 24px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin: auto;
  animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.inference-modal-header {
  padding: 24px 24px 20px 24px;
  border-bottom: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.inference-modal-header h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.inference-modal .close {
  background: transparent;
  border: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #999;
  border-radius: 6px;
  transition: all 0.15s ease;
  padding: 0;
  font-size: 1.125rem;
  line-height: 1;
  flex-shrink: 0;
}

.inference-modal .close:hover,
.inference-modal .close:focus {
  background: #f5f5f5;
  color: #1a1a1a;
}

.inference-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

#inferenceTableContainer {
  overflow-x: auto;
  width: 100%;
}

.history-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 4px 0 12px;
}

.history-control-select {
  height: 36px;
  width: auto !important;
  min-width: 150px;
  max-width: 220px;
  flex: 0 0 auto;
  border: 1px solid #d8e0ea;
  border-radius: 11px;
  padding: 0 28px 0 12px;
  background: #fff;
  color: #0f172a;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1;
}

@media (max-width: 900px) {
  .history-controls {
    gap: 8px;
  }

  .history-control-select {
    min-width: 132px;
  }
}

/* Inference Table Styles */
#inferenceTable {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
  min-width: 800px;
}

/* Column width adjustments */
#inferenceTable th:nth-child(1) { width: 32%; } /* Run */
#inferenceTable th:nth-child(2) { width: 11%; } /* Status */
#inferenceTable th:nth-child(3) { width: 8%; }  /* Cells */
#inferenceTable th:nth-child(4) { width: 17%; } /* Started At */
#inferenceTable th:nth-child(5) { width: 12%; } /* Time */
#inferenceTable th:nth-child(6) { width: 20%; } /* Results */

#inferenceTable th,
#inferenceTable td {
  border: 1px solid #e5eaf0;
  padding: 11px 10px;
  text-align: left;
  white-space: nowrap;
  font-size: 0.92rem;
  line-height: 1.35;
  color: #1f2937;
}

#inferenceTable th {
  background-color: #fafcff;
  font-weight: 600;
  color: #333;
}

#inferenceTable th.time-column,
#inferenceTable th.results-column {
  position: relative;
}

#inferenceTable .column-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-left: 4px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  color: #64748b;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  vertical-align: middle;
  cursor: help;
}

#inferenceTable th.time-column::before,
#inferenceTable th.time-column::after,
#inferenceTable th.results-column::before,
#inferenceTable th.results-column::after {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  position: absolute;
  left: 50%;
  z-index: 20;
}

#inferenceTable th.time-column::before,
#inferenceTable th.results-column::before {
  content: "";
  top: calc(100% + 2px);
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom-color: #334155;
}

#inferenceTable th.time-column::after {
  content: attr(data-tooltip);
  top: calc(100% + 10px);
  transform: translateX(-50%);
  background: #334155;
  color: #fff;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

#inferenceTable th.results-column::after {
  content: attr(data-tooltip);
  top: calc(100% + 10px);
  transform: translateX(-50%);
  background: #334155;
  color: #fff;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: pre-line;
  width: 300px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

#inferenceTable th.time-column:hover::before,
#inferenceTable th.time-column:hover::after,
#inferenceTable th.time-column:focus-within::before,
#inferenceTable th.time-column:focus-within::after,
#inferenceTable th.results-column:hover::before,
#inferenceTable th.results-column:hover::after,
#inferenceTable th.results-column:focus-within::before,
#inferenceTable th.results-column:focus-within::after {
  opacity: 1;
}

#inferenceTable tr:nth-child(even) {
  background-color: #fcfdff;
}

#inferenceTable tr:hover {
  background-color: #f7faff;
}

#inferenceTable td.run-cell {
  white-space: normal;
}

#inferenceTable .run-model {
  display: block;
  font-weight: 600;
  color: #111827;
}

#inferenceTable .run-filename {
  display: block;
  margin-top: 2px;
  color: #6b7280;
  font-size: 0.92em;
}

.showcased-datasets-section {
  margin-top: 22px;
  max-width: 780px;
}

.showcased-datasets-section h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
  font-weight: 650;
  color: #111827;
}

.showcased-dataset-list {
  display: grid;
  gap: 14px;
}

.showcased-dataset-card {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 22px;
  padding: 12px;
  border: 1px solid #e5eaf0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.showcased-dataset-card__image {
  width: 200px;
  height: 200px;
  border-radius: 10px;
  object-fit: cover;
  background: #f8fafc;
}

.showcased-dataset-card__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.showcased-dataset-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.showcased-dataset-card__title {
  margin: 5px 0 8px;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
}

.showcased-dataset-card__meta,
.showcased-dataset-card__stats,
.showcased-dataset-card__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.showcased-dataset-card__actions {
  justify-content: flex-end;
}

.showcased-dataset-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
}

.showcased-dataset-tag {
  color: #047857;
  background: #dff7ea;
}

.showcased-dataset-card__description {
  margin: 12px 0 10px;
  color: #334155;
  font-size: 0.92rem;
  line-height: 1.45;
}

.showcased-dataset-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
}

.showcased-dataset-stat strong {
  color: #0f172a;
  font-size: 1.12rem;
  line-height: 1;
}

@media (max-width: 700px) {
  .showcased-dataset-card {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 14px;
    padding: 12px;
  }

  .showcased-dataset-card__image {
    width: 88px;
    height: 88px;
  }

  .showcased-dataset-card__header {
    flex-direction: column;
    gap: 10px;
  }

  .showcased-dataset-card__actions {
    justify-content: flex-start;
  }

  .showcased-dataset-card__description {
    margin: 12px 0;
  }
}

#showcasedInferenceCards .result-link {
  border: 1px solid #e5eaf0;
  background: #f8fafc;
}

/* Status badges */
.status-pending {
  background-color: #ffd700;
  color: #000;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
}

.status-completed {
  background-color: #28a745;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
}

.status-error {
  background-color: #dc3545;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
}

/* Inference Slider Styles */
.inference-slider {
  position: fixed;
  right: -200px;
  top: 50%;
  transform: translateY(-50%);
  width: 200px;
  height: 60px;
  background: linear-gradient(135deg, #7c8798 0%, #667085 100%);
  color: white;
  cursor: pointer;
  transition: right 0.3s ease;
  border-radius: 8px 0 0 8px;
  box-shadow: -1px 0 6px rgba(15, 23, 42, 0.12);
  opacity: 0.92;
  z-index: 999;
}

.inference-slider:hover {
  right: -180px;
}

.inference-slider.show {
  right: 0;
}

.slider-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 10px;
  font-size: 14px;
  font-weight: bold;
}

.slider-content span:first-child {
  font-size: 20px;
  margin-bottom: 5px;
}


/* Responsive design for inference components */
@media (max-width: 768px) {
  .inference-modal-content {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
    margin: 0;
  }
  
  .inference-modal-header {
    padding: 20px 20px 16px 20px;
  }
  
  .inference-modal-body {
    padding: 20px;
  }
  
  .inference-slider {
    width: 150px;
    right: -150px;
  }
  
  .inference-slider:hover {
    right: -130px;
  }
}

@media (max-width: 480px) {
  .inference-modal-header {
    padding: 16px 16px 12px 16px;
  }
  
  .inference-modal-header h2 {
    font-size: 1rem;
  }
  
  .inference-modal-body {
    padding: 16px;
  }
}


/* Mobile-only direct tool links (replaces dropdown on small screens) */
.nav-tools-mobile {
  display: none;
}

/* Navigation Layout */
.nav-container {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0 24px;
  height: 64px;
  position: relative;
}

.site-wordmark {
  flex-shrink: 0;
  padding-left: 0;
  padding-right: 1.5rem;
  margin-right: 1.75rem;
  border: none;
  border-radius: 0;
}

.nav-admin-badge {
  flex-shrink: 0;
  margin-right: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 8px;
  background: #e6f3f8;
  border: 1.5px solid #b6d9eb;
  color: #1a5f7a !important;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s;
}

.nav-admin-badge:hover {
  background: #d4eaf5;
  border-color: #8fc5df;
  text-decoration: none;
}

.nav-admin-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: #1a5f7a;
}

.nav-menu {
  display: flex;
  align-items: center;
  flex-direction: row;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-account {
  display: flex;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}

.nav-account-menu {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-dropdown-right {
  right: 0;
  left: auto;
  min-width: 140px;
}

/* Account Page Styles */
.account-header {
  margin-top: 40px;
  text-align: center;
}

.avatar-circle {
  width: 100px;
  height: 100px;
  font-size: 3rem;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 128, 128, 0.3);
}

.account-title {
  font-size: 2.5em;
  color: var(--accent);
  margin-bottom: 10px;
  font-weight: bold;
}

.account-subtitle {
  font-size: 1.2em;
  color: #666;
  margin-bottom: 30px;
}

.edit-account-btn {
  background: var(--accent);
  color: white;
  padding: 15px 30px;
  border: none;
  border-radius: 8px;
  font-size: 1.1em;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 128, 128, 0.2);
}

.edit-account-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 128, 128, 0.3);
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.account-card {
  background: white;
  border: 2px solid var(--accent);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.account-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.account-card-title {
  font-size: 1.8em;
  margin-bottom: 25px;
  text-align: center;
  color: var(--accent);
  font-weight: bold;
}

.account-info-item {
  display: flex;
  align-items: flex-start;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid var(--accent);
  margin-bottom: 10px;
  transition: all 0.2s ease;
}

.account-info-item:hover {
  background: #e8f4f8;
  transform: translateX(4px);
}

.account-info-icon {
  font-size: 1.5em;
  margin-right: 15px;
  color: var(--accent);
  margin-top: 2px;
  flex-shrink: 0;
}

.account-info-label {
  font-size: 0.9em;
  color: #666;
  margin-bottom: 8px;
  display: block;
}

.account-info-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.account-info-value {
  font-weight: bold;
  font-size: 1.1em;
  color: var(--text);
  display: block;
}

.plan-item {
  margin-bottom: 0;
  padding: 6px 12px;
  background: #f8f9fa;
  border-radius: 6px;
}

.plan-item:last-child {
  margin-bottom: 0;
}

.plan-item small {
  color: #6c757d;
  font-size: 0.85em;
  margin-left: 8px;
}

/* Edit Account Modal Styles - DEPRECATED, use unified .modal system */
/* Legacy styles removed - now using unified modal system */

.edit-form-spinner {
  display: none;
}

/* Settings Page Styles */
.settings-container {
  margin-top: 1.5rem;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.settings-title {
  margin: 0;
}

.settings-back-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border: 1px solid #6c757d;
  background: transparent;
  color: #6c757d;
  text-decoration: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
}

.settings-card {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  margin-bottom: 1.5rem;
}

.settings-card-header {
  padding: 1rem 1.25rem;
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  border-radius: 0.375rem 0.375rem 0 0;
}

.settings-card-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 500;
}

.settings-card-body {
  padding: 1.25rem;
}

.settings-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.settings-form-group {
  margin-bottom: 1rem;
}

.settings-form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #212529;
}

.settings-form-control {
  display: block;
  width: 100%;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: #212529;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.settings-form-control:focus {
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.settings-form-control:read-only {
  background-color: #e9ecef;
}

.settings-form-text {
  color: #6c757d;
  font-size: 0.875rem;
}

.settings-form-check {
  display: flex;
  align-items: center;
  margin-top: 1rem;
}

.settings-form-check-input {
  margin-right: 0.5rem;
  transform: scale(1.2);
}

.settings-form-check-label {
  font-weight: 500;
  color: #212529;
  cursor: pointer;
}

.settings-alert {
  padding: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: 0.375rem;
}

.settings-alert-info {
  color: #055160;
  background-color: #cff4fc;
  border-color: #b6effb;
}

.settings-alert-success {
  color: #0f5132;
  background-color: #d1e7dd;
  border-color: #badbcc;
}

.settings-alert-dismissible {
  position: relative;
  padding-right: 4rem;
}

.settings-btn-close {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  padding: 0.75rem 1.25rem;
  background: transparent;
  border: 0;
  font-size: 1.25rem;
  line-height: 1;
  color: #000;
  opacity: 0.5;
  cursor: pointer;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.settings-btn {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  border-radius: 0.375rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.settings-btn-secondary {
  color: #6c757d;
  background-color: transparent;
  border-color: #6c757d;
  margin-right: 0.5rem;
}

.settings-btn-primary {
  color: #fff;
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.settings-spinner {
  display: none;
  width: 1rem;
  height: 1rem;
  margin-right: 0.25rem;
  border: 0.125em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
  to {
    transform: rotate(360deg);
  }
}

/* Benchmark Page Styles */
.test-set-item {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.test-set-item:hover {
  background: #e9ecef;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.test-set-item.selected {
  background: #e8f4f8;
  border-color: var(--accent);
  border-width: 2px;
  box-shadow: 0 4px 12px rgba(0, 128, 128, 0.2);
}

.test-set-name {
  font-weight: bold;
  color: var(--accent);
  margin-bottom: 8px;
  font-size: 1.1em;
}

.test-set-description {
  color: #666;
  font-size: 0.9em;
  line-height: 1.4;
}

.loading-message {
  color: #666;
  font-style: italic;
  text-align: center;
}

/* Benchmark Modal - uses unified modal system with custom size */
.benchmark-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  justify-content: center;
  align-items: center;
  padding: 16px;
  overflow-y: auto;
}

.benchmark-modal.show {
  display: flex;
}

.benchmark-modal-content {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 1400px;
  max-height: calc(100vh - 32px);
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12), 
              0 8px 24px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin: auto;
  animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.benchmark-modal-header {
  padding: 24px 24px 20px 24px;
  border-bottom: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.benchmark-modal-header h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.benchmark-close-button {
  background: transparent;
  border: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #999;
  border-radius: 6px;
  transition: all 0.15s ease;
  padding: 0;
  font-size: 1.125rem;
  line-height: 1;
  flex-shrink: 0;
}

.benchmark-close-button:hover {
  background: #f5f5f5;
  color: #1a1a1a;
}

.benchmark-close-button:active {
  background: #e8e8e8;
}

.benchmark-comparison-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  padding: 30px;
  flex: 1;
  overflow: hidden;
  align-items: stretch;
}

.benchmark-comparison-side {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.benchmark-model-header {
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #dee2e6;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.benchmark-model-header h3 {
  margin: 0;
  color: var(--accent);
  font-size: 1.25rem;
}

.header-with-select {
  display: flex;
  align-items: center;
  gap: 15px;
  justify-content: center;
  white-space: nowrap;
}

.header-with-select select {
  padding: 8px 12px;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: white;
  font-size: 0.9rem;
  min-width: 180px;
}

.benchmark-chart-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 8px;
  border: 1px solid #dee2e6;
  overflow: hidden;
  position: relative;
  height: 600px;
  min-height: 600px;
  max-height: 600px;
}

.benchmark-chart-container img {
  max-width: 90%;
  max-height: 90%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: auto;
}

.benchmark-chart-container img:not([src=""]) {
  display: block;
}

.benchmark-chart-container .loading-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 20px;
  border-radius: 6px;
  border: 1px solid #dee2e6;
  white-space: nowrap;
  z-index: 10;
}

/* Error and Status Messages */
.error-message {
  color: red;
  text-align: center;
  padding: 20px;
}

.no-data-message {
  text-align: center;
  padding: 20px;
}

.status-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
}

.download-link {
  color: #2563eb;
  text-decoration: underline;
}

#inferenceTable .results-links,
#showcasedInferenceCards .results-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

#inferenceTable .result-link,
#showcasedInferenceCards .result-link,
.run-card-links .result-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: transparent;
  color: #475569;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

#inferenceTable .result-link:hover,
#showcasedInferenceCards .result-link:hover,
.run-card-links .result-link:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #1e293b;
}

/* Account Info List */
.account-info-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Duplicate modal error/success styles removed - using unified system above */

/* Location Form Footer */
.location-form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Detected Location Time */
.detected-location-time {
  display: block;
  margin-top: 0.25rem;
}

/* Annotation Example Image */
.annotation-example-img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 20px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.annotate-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.annotate.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  background: #fff;
  box-shadow: none;
  border-radius: 0;
  max-width: 1040px;
  margin: 0 auto;
  padding: 2.25rem 2rem;
  align-items: start;
  position: relative;
}

.info h2 {
  border-bottom: 2px solid #008080;
  padding-bottom: 0.25rem;
  margin-bottom: 0;
}

/* Header row: title left, History button right */
.interpret-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.interpret-header h1 {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: #050816;
  font-size: clamp(2.1rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.model-page-subtitle {
  margin: 0.8rem 0 0;
  color: #475569;
  font-size: 1rem;
  line-height: 1.45;
}

/* Ghost history button — desktop hidden, mobile visible */
.history-inline-btn {
  display: none;
  flex-shrink: 0;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  background: transparent;
  border: 1px solid rgba(0, 128, 128, 0.35);
  border-radius: 8px;
  color: #6b7280;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.history-inline-btn:hover {
  background: rgba(0, 128, 128, 0.06);
  border-color: rgba(0, 128, 128, 0.55);
  color: #008080;
}

.preview {
  display: none;
}

.preview img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.preview:hover img {
  transform: scale(1.02);
}

/* Primary button styling */
#submitButton {
  padding: 0.85rem 2.2rem;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(0, 102, 102, 0.22);
  background: linear-gradient(135deg, #008080, #006666);
  color: #fff;
  border: 1px solid #008080;
  margin-top: 1.25rem;
  position: relative;
}

#submitButton:hover {
  background: linear-gradient(135deg, #006666, #004d4d);
  border-color: #006666;
  transform: translateY(-1px);
}

/* Disabled submit button styling */
#submitButton:disabled {
  background: #e0e0e0 !important;
  color: #999 !important;
  border-color: #ccc !important;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
  opacity: 0.7;
}

#submitButton:disabled:hover {
  background: #e0e0e0 !important;
  transform: none !important;
  opacity: 0.8;
}





/* Custom tooltip for disabled button */
#submitButton:disabled::after {
  content: "Wait until model is finished processing";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
  margin-bottom: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  font-weight: 500;
  min-width: 200px;
  text-align: center;
}

#submitButton:disabled::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #333;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
  margin-bottom: 2px;
}

#submitButton:disabled:hover::after,
#submitButton:disabled:hover::before {
  opacity: 1;
}

/* Annotate workspace spacing */
.annotate.grid #uploadForm .form-group {
  margin-bottom: 1.25rem;
}

.annotate.grid #uploadForm > .form-group:last-of-type {
  margin-top: 0.75rem;
}

.annotate.grid #filePicker.file-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.5rem;
  row-gap: 0.45rem;
}

.annotate.grid #filePicker .file-name {
  flex-basis: 100%;
  max-width: 100%;
  display: block;
  color: #6b7280;
  font-size: 0.92rem;
  line-height: 1.35;
}

/* Form spacing improvements */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 128, 128, 0.1);
}

.form-group select:disabled {
  background-color: #f5f5f5;
  color: #999;
  cursor: not-allowed;
}

.model-metadata-panel {
  display: grid;
  gap: 2rem;
  margin: 1.5rem 0 1.65rem;
}

.model-version-field {
  max-width: 320px;
}

.model-select-field {
  max-width: 480px;
}

.model-version-field label {
  color: #111827;
  font-size: 0.92rem;
  font-weight: 800;
}

.model-version-field select {
  height: 42px;
  border-color: #e5e7eb;
  border-radius: 6px;
  color: #111827;
  font-weight: 600;
}

.model-metadata-empty,
.model-summary-card,
.model-feature-card,
.model-ontology-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
}

.model-metadata-empty {
  padding: 1rem;
  color: #64748b;
  font-size: 0.95rem;
}

.model-summary-card {
  padding: 1.15rem 1.25rem;
  border-color: rgba(0, 128, 128, 0.22);
  background: linear-gradient(180deg, rgba(0, 128, 128, 0.055), #ffffff);
}

.model-summary-kicker {
  margin: 0 0 0.35rem;
  color: #008080;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.model-summary-card h3,
.model-metadata-section h3,
.model-feature-card h4,
.model-ontology-card h4 {
  margin: 0;
}

.model-summary-card h3 {
  color: #0f172a;
  font-size: 1.2rem;
}

.model-summary-card p:not(.model-summary-kicker) {
  margin: 0.45rem 0 0;
  color: #475569;
  line-height: 1.5;
}

.model-metadata-section {
  display: grid;
  gap: 0.75rem;
}

.model-metadata-section h3 {
  color: #111827;
  font-size: 0.95rem;
  font-weight: 800;
}

.model-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.model-feature-card {
  padding: 0.95rem;
}

.model-feature-card h4,
.model-ontology-card h4 {
  color: #0f172a;
  font-size: 0.95rem;
}

.model-feature-card p,
.model-ontology-card p,
.model-ontology-card span {
  margin: 0.35rem 0 0;
  color: #64748b;
  font-size: 0.87rem;
  line-height: 1.4;
}

.model-feature-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.model-feature-badges span {
  border-radius: 999px;
  background: rgba(0, 128, 128, 0.08);
  color: #007373;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.35rem 0.55rem;
}

.model-glance-card {
  border: 1px solid rgba(0, 128, 128, 0.18);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(0, 128, 128, 0.055), rgba(0, 128, 128, 0.02));
  padding: 1.75rem 1.65rem;
}

.model-glance-card h2 {
  margin: 0 0 1.25rem;
  color: #007373;
  font-size: 1.05rem;
  font-weight: 800;
}

.model-glance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.model-glance-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  padding: 0 1.45rem;
  border-right: 1px solid rgba(15, 23, 42, 0.08);
}

.model-glance-item:first-child {
  padding-left: 0;
}

.model-glance-item:last-child {
  border-right: 0;
  padding-right: 0;
}

.model-glance-icon,
.model-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: #008080;
}

.model-glance-icon {
  width: 2.1rem;
  height: 2.1rem;
}

.model-glance-icon svg,
.model-info-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.model-glance-item strong {
  display: block;
  color: #111827;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.25;
}

.model-glance-item span:not(.model-glance-icon) {
  display: block;
  margin-top: 0.25rem;
  color: #64748b;
  font-size: 0.82rem;
  line-height: 1.25;
}

.model-info-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.model-info-card {
  min-height: 180px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  padding: 1.25rem 1.35rem;
}

.model-info-card-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.95rem;
}

.model-info-icon {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 8px;
  background: rgba(0, 128, 128, 0.1);
  font-size: 1.35rem;
  font-weight: 800;
}

.model-info-icon svg {
  width: 1.65rem;
  height: 1.65rem;
}

.model-info-card h3 {
  margin: 0;
  color: #111827;
  font-size: 1.05rem;
  font-weight: 800;
}

.model-info-card ul {
  margin: 0;
  padding-left: 1.05rem;
  color: #374151;
  display: grid;
  gap: 0.7rem;
  font-size: 0.98rem;
  line-height: 1.4;
}

.model-run-section {
  margin-top: 1.5rem;
}

.model-run-section h3 {
  margin: 0;
  color: #111827;
  font-size: 1.05rem;
  font-weight: 800;
}

.model-run-section > p {
  margin: 0.45rem 0 1rem;
  color: #64748b;
  font-size: 0.94rem;
}

.model-ontology-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
}

.model-ontology-info-card .model-ontology-card {
  border: 0;
  background: transparent;
  padding: 0;
}

.model-ontology-btn {
  flex-shrink: 0;
  border: 1px solid rgba(0, 128, 128, 0.35);
  border-radius: 999px;
  background: rgba(0, 128, 128, 0.06);
  color: #007373;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.55rem 0.9rem;
}

.model-ontology-btn:hover {
  background: rgba(0, 128, 128, 0.12);
  border-color: rgba(0, 128, 128, 0.55);
}

/* Ensure button container has proper positioning for tooltip */
.form-group {
  position: relative;
}

/* Consistent teal for file buttons */
.file-btn {
  padding: 8px 12px;
  background: linear-gradient(135deg, #008080, #006666);
  color: #fff;
  border: 1px solid #008080;
  border-radius: 4px;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  display: inline-block;
}

.file-btn:hover,
.file-menu button:hover {
  background: linear-gradient(135deg, #006666, #004d4d);
  color: #fff;
  border-color: #006666;
}

@media (max-width: 900px) {
  .history-inline-btn {
    display: inline-flex;
    min-height: 44px;
  }

  .interpret-header h1 {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}

@media (max-width: 768px) {
  .annotate.grid {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .model-glance-grid,
  .model-info-card-grid,
  .model-feature-grid {
    grid-template-columns: 1fr;
  }

  .model-glance-item {
    border-right: 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    padding: 1rem 0;
  }

  .model-glance-item:first-child {
    padding-top: 0;
  }

  .model-glance-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .model-ontology-card {
    align-items: flex-start;
    flex-direction: column;
  }
  
  .preview {
    margin: 1.5rem 0 0 0;
    max-width: 60%;
    justify-self: center;
  }
}

@media (max-width: 576px) {
  .preview {
    display: none;
  }
}

/* ============================================================================
   PRICING MODAL STYLES
   ============================================================================ */

/* Pricing Plans Container */
.pricing-plans-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 0;
}

/* Individual Pricing Card */
.pricing-plan-card {
  background: #ffffff;
  border: 1.5px solid #e8e8e8;
  border-radius: 12px;
  padding: 24px;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: visible;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.pricing-plan-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(0, 128, 128, 0.1);
  transform: translateY(-2px);
}

/* Highlighted Plan */
.pricing-plan-card.highlighted {
  border-color: var(--accent);
  border-width: 2px;
  padding: 23px; /* Maintain same visual size */
}

/* Plan Badge */
.pricing-plan-card .highlight-badge {
  position: absolute;
  top: -1px;
  right: -1px;
  background: var(--accent);
  color: white;
  padding: 6px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 0 11px 0 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Plan Name/Title */
.pricing-plan-card h3,
.pricing-plan-card h4 {
  color: #1a1a1a;
  font-size: 1.125rem;
  margin: 0 0 4px 0;
  font-weight: 600;
  line-height: 1.4;
}

/* Plan Price */
.pricing-plan-card .price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  margin: 12px 0 16px 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.pricing-plan-card .price .currency {
  font-size: 1.25rem;
  vertical-align: top;
  font-weight: 600;
}

.pricing-plan-card .price .period {
  font-size: 0.875rem;
  color: #666;
  font-weight: 500;
  margin-left: 4px;
}

/* Plan Description */
.pricing-plan-card .description {
  color: #666;
  margin-bottom: 24px;
  line-height: 1.6;
  font-size: 0.9375rem;
  flex: 1;
}

/* Plan Features List (optional) */
.pricing-plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
  flex: 1;
}

.pricing-plan-features li {
  padding: 8px 0;
  color: #666;
  font-size: 0.875rem;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
}



/* Plan Select Button */
.pricing-plan-card .select-plan-btn,
.pricing-plan-card button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0 20px;
  height: 44px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  box-sizing: border-box;
}

.pricing-plan-card .select-plan-btn:hover,
.pricing-plan-card button:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 128, 128, 0.2);
}

.pricing-plan-card .select-plan-btn:active,
.pricing-plan-card button:active {
  transform: translateY(0);
}

/* Responsive Pricing Grid */
@media (max-width: 768px) {
  .pricing-plans-container {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Upgrade Modal - uses unified modal system */
.upgrade-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  justify-content: center;
  align-items: center;
  padding: 16px;
  overflow-y: auto;
}

.upgrade-modal[style*="display: block"],
.upgrade-modal[style*="display: flex"] {
  display: flex !important;
}

.upgrade-modal-content {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 900px;
  max-height: calc(100vh - 32px);
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12), 
              0 8px 24px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin: auto;
  animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.upgrade-modal-header {
  padding: 24px 24px 20px 24px;
  border-bottom: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.upgrade-modal-header h2,
.upgrade-modal-header h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.upgrade-modal-header .close {
  background: transparent;
  border: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #999;
  border-radius: 6px;
  transition: all 0.15s ease;
  padding: 0;
  font-size: 1.125rem;
  line-height: 1;
  flex-shrink: 0;
}

.upgrade-modal-header .close:hover {
  background: #f5f5f5;
  color: #1a1a1a;
}

.upgrade-modal-header .close:active {
  background: #e8e8e8;
}

.upgrade-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.upgrade-modal .pricing-plans-container {
  margin-top: 20px;
}

@media (max-width: 768px) {
  .upgrade-modal {
    padding: 0;
    align-items: stretch;
  }
  
  .upgrade-modal-content {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
    margin: 0;
  }
  
  .upgrade-modal-header {
    padding: 20px 20px 16px 20px;
  }
  
  .upgrade-modal-body {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .upgrade-modal-header {
    padding: 16px 16px 12px 16px;
  }
  
  .upgrade-modal-header h2,
  .upgrade-modal-header h3 {
    font-size: 1rem;
  }
  
  .upgrade-modal-body {
    padding: 16px;
  }
}

.upgrade-message {
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 0.9375rem;
  color: #92400e;
  line-height: 1.6;
}

.current-plan-info,
.available-plans {
  margin-bottom: 32px;
}

.current-plan-info h3,
.available-plans h3 {
  color: #1a1a1a;
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 16px 0;
  padding-bottom: 12px;
  border-bottom: 1.5px solid #e8e8e8;
}

.plan-details {
  background: #fafafa;
  border-radius: 8px;
  padding: 16px 20px;
  border-left: 3px solid var(--accent);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #666;
}

/* Upgrade Actions */
.upgrade-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1.5px solid #e8e8e8;
}

.upgrade-actions .btn {
  min-width: 140px;
  width: auto;
}

@media (max-width: 480px) {
  .upgrade-actions {
    flex-direction: column;
  }
  
  .upgrade-actions .btn {
    width: 100%;
  }
}

/* Plan Limits Display - Discrete version */
.plan-limits-discrete {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  font-size: 12px;
  color: #888;
  line-height: 1.8;
  font-family: monospace;
  background: rgba(255, 255, 255, 0.95);
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  z-index: 10;
}

.plan-limits-discrete div {
  white-space: nowrap;
}

@media (max-width: 768px) {
  .plan-limits-discrete {
    font-size: 11px;
    bottom: 0.75rem;
    right: 0.75rem;
    padding: 6px 10px;
  }
}

/* Pagination Controls */
#paginationControls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding: 15px 10px;
  border-top: 1px solid #ddd;
  background: #f8f9fa;
}

#paginationControls button {
  padding: 8px 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
  min-width: 100px;
}

#paginationControls button:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 128, 128, 0.2);
}

#paginationControls button:disabled {
  background: #e0e0e0;
  color: #999;
  cursor: not-allowed;
  opacity: 0.5;
}

#pageInfo {
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

@media (max-width: 576px) {
  #paginationControls {
    flex-direction: column;
    gap: 10px;
  }
  
  #paginationControls button {
    width: 100%;
  }
}

/* ============================================================================
   MODERN ACCOUNT PAGE STYLES - Notion/Linear/Stripe Aesthetic
   ============================================================================ */

/* Container */
.modern-account-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 24px;
}

/* Header */
.modern-account-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-bottom: 32px;
  border-bottom: 1px solid #e8e8e8;
  margin-bottom: 40px;
}

.modern-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #008080 0%, #006666 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 600;
  flex-shrink: 0;
}

.modern-account-header-info {
  flex: 1;
  min-width: 0;
}

.modern-account-name {
  margin: 0 0 4px 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.3;
}

.modern-account-email {
  margin: 0;
  font-size: 0.9375rem;
  color: #666;
  line-height: 1.5;
}

.modern-btn-primary {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0 20px;
  height: 44px;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.modern-btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.modern-btn-primary:active {
  transform: translateY(0);
}

/* Sections */
.modern-account-section {
  margin-bottom: 48px;
}

.modern-section-title {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #666;
  margin: 0 0 16px 0;
}

/* Info Rows */
.modern-info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
  gap: 24px;
}

.modern-info-row:last-child {
  border-bottom: none;
}

.modern-info-label {
  font-size: 0.9375rem;
  color: #666;
  min-width: 140px;
  flex-shrink: 0;
}

.modern-info-value {
  font-size: 0.9375rem;
  color: #1a1a1a;
  font-weight: 500;
  text-align: right;
  word-break: break-word;
}

/* Upgrade Section */
.modern-upgrade-section {
  padding: 24px;
  background: #fafafa;
  border-radius: 12px;
  border: 1px solid #e8e8e8;
}

.modern-upgrade-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.modern-upgrade-text {
  margin: 0;
  font-size: 0.9375rem;
  color: #666;
  line-height: 1.5;
  flex: 1;
}

.modern-btn-secondary {
  background: white;
  color: var(--accent);
  border: 1.5px solid #e0e0e0;
  padding: 0 20px;
  height: 44px;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.modern-btn-secondary:hover {
  background: #fafafa;
  border-color: var(--accent);
  transform: translateY(-1px);
}

.modern-btn-secondary:active {
  transform: translateY(0);
}

/* Form Sections in Modal */
.modern-form-section {
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid #f0f0f0;
}

.modern-form-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.modern-form-section-title {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #666;
  margin: 0 0 20px 0;
}

/* Modern Checkbox */
.modern-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.modern-checkbox-row input[type="checkbox"] {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.modern-checkbox-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  flex: 1;
}

.modern-checkbox-text {
  font-size: 0.9375rem;
  color: #1a1a1a;
  font-weight: 400;
  line-height: 1.5;
}

.modern-checkbox-subtitle {
  font-size: 0.9375rem;
  font-weight: 400;
  color: #1a1a1a;
  line-height: 1.5;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .modern-account-container {
    padding: 32px 20px;
  }
  
  .modern-account-header {
    flex-wrap: wrap;
  }
  
  .modern-btn-primary {
    width: 100%;
    order: 3;
  }
  
  .modern-info-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .modern-info-label {
    min-width: auto;
  }
  
  .modern-info-value {
    text-align: left;
  }
  
  .modern-upgrade-content {
    flex-direction: column;
    align-items: stretch;
  }
  
  .modern-btn-secondary {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .modern-account-container {
    padding: 24px 16px;
  }
  
  .modern-avatar {
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
  }
  
  .modern-account-name {
    font-size: 1.25rem;
  }
}

/* ============================================================================
   TERMS OF SERVICE — checkbox + viewer modal
   ============================================================================ */

/* TOS checkbox row inside signup form */
.tos-checkbox-group {
  margin-top: 4px;
  margin-bottom: 16px;
}

.tos-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.875rem;
  color: #555;
  line-height: 1.5;
}

.tos-checkbox-label input[type="checkbox"] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
}

.tos-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tos-link:hover {
  color: var(--accent-hover);
}

/* TOS viewer modal — sits above the signup modal */
.tos-modal-layer {
  z-index: 1100;
}

/* Scrollable content area for the TOS text */
.tos-body {
  max-height: 60vh;
  overflow-y: auto;
  padding: 8px 24px 24px 24px;
  scroll-behavior: smooth;
}

.tos-loading {
  color: #888;
  font-style: italic;
  padding: 24px 0;
  text-align: center;
}

.tos-error {
  color: #dc3545;
  font-size: 0.875rem;
}

/* Rendered markdown content */
.tos-rendered {
  font-size: 0.875rem;
  line-height: 1.7;
  color: #333;
}

.tos-rendered h1,
.tos-rendered h2,
.tos-rendered h3 {
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a1a;
}

.tos-rendered h1:first-child,
.tos-rendered h2:first-child {
  margin-top: 0;
}

.tos-rendered p {
  margin: 0 0 0.85em 0;
}

.tos-rendered a {
  color: var(--accent);
}

.tos-rendered hr {
  border: none;
  border-top: 1px solid #e8e8e8;
  margin: 1.25em 0;
}

.tos-rendered blockquote {
  border-left: 3px solid #e0e0e0;
  margin: 0.75em 0;
  padding: 6px 12px;
  color: #666;
  font-style: italic;
}

/* Raw markdown fallback */
.tos-raw {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: #444;
}

/* Home + global mobile nav polish */
@media (max-width: 900px) {
  .nav-container {
    height: auto;
    min-height: 64px;
    padding: 10px 14px;
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .site-wordmark {
    margin-right: auto;
    padding-right: 0.75rem;
    font-size: 1.65rem;
  }

  .nav-menu {
    position: static;
    left: auto;
    transform: none;
    order: 3;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px;
  }

  .nav-tools-dropdown {
    display: none;
  }

  .nav-tools-mobile {
    display: list-item;
  }

  /* Hide desktop history slider on mobile */
  .inference-slider {
    display: none !important;
  }

  /* Suppress account dropdown on mobile — sheet takes over */
  .nav-account-menu .dropdown-menu {
    display: none !important;
  }

  .nav-account {
    margin-left: 0;
  }

  .nav-account-menu {
    margin-left: 0;
  }

  nav a {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
  }

  .dropdown-menu {
    min-width: 132px;
  }

  .container {
    margin: 18px auto;
    padding: 0 12px;
  }

  .section {
    padding: 22px;
    margin-bottom: 24px;
    border-radius: 12px;
  }

  #hero {
    gap: 1.1rem;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  #hero img {
    max-width: 100%;
    border-radius: 10px;
  }

  .hero-text h2 {
    margin: 0 0 0.9rem;
    font-size: 1.95rem;
    line-height: 1.15;
  }

  .section h2 {
    margin-bottom: 0.9rem;
  }

  .hero-text p {
    font-size: 1rem;
    line-height: 1.7;
    margin: 0;
  }

  .hero-text p + p {
    margin-top: 1rem;
  }
}

@media (max-width: 560px) {
  .site-wordmark {
    font-size: 1.45rem;
  }

  .nav-account .nav-admin-badge {
    padding: 4px 9px;
    font-size: 0.78rem;
  }

  .nav-account-menu a {
    padding-left: 0.6rem;
    padding-right: 0.6rem;
  }

  .nav-menu {
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: thin;
    padding-bottom: 2px;
  }

  #hero {
    grid-template-columns: 1fr;
  }

  .hero-text h2 {
    font-size: 1.75rem;
  }
}

/* ============================================================================
   BENCHMARK PAGE — MOBILE DISABLED
   ============================================================================ */

.benchmark-mobile-unavailable {
  display: none;
  text-align: center;
  padding: 48px 24px;
  color: #6b7280;
  font-size: 1rem;
  line-height: 1.6;
}

@media (max-width: 900px) {
  .benchmark-mobile-unavailable {
    display: block;
  }

  .benchmark-desktop-content {
    display: none;
  }
}

/* ============================================================================
   MOBILE HISTORY SHEET + RUN CARDS
   ============================================================================ */

/* Floating trigger button — hidden on desktop */
.mobile-history-btn {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 24px;
  padding: 0 28px;
  height: 48px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  z-index: 900;
  box-shadow: 0 4px 18px rgba(0, 128, 128, 0.38);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .mobile-history-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }

  .mobile-history-btn.show {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-history-btn:hover {
    background: var(--accent-hover);
    transform: translateX(-50%) translateY(-1px);
  }
}

/* Backdrop */
.mobile-history-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 1000;
}

@media (max-width: 900px) {
  .mobile-history-backdrop.open {
    display: block;
  }
}

/* Sheet — off-screen on mobile until .open */
.mobile-history-sheet {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 92vh;
  background: #fff;
  border-radius: 20px 20px 0 0;
  z-index: 1001;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

@media (max-width: 900px) {
  .mobile-history-sheet {
    display: flex;
  }

  .mobile-history-sheet.open {
    transform: translateY(0);
  }
}

/* Sheet header */
.mobile-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px 20px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.mobile-history-header h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: #1a1a1a;
}

.mobile-history-close {
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #999;
  cursor: pointer;
  border-radius: 6px;
  padding: 0;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}

.mobile-history-close:hover {
  background: #f5f5f5;
  color: #333;
}

/* Sheet body */
.mobile-history-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.mobile-history-cards {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 8px;
}

/* Empty / error state */
.run-card-empty {
  text-align: center;
  color: #9ca3af;
  padding: 48px 0;
  font-size: 0.95rem;
}

/* Run Card */
.run-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  padding: 16px;
  position: relative;
  transition: background 0.12s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.run-card--expandable {
  cursor: pointer;
  padding-right: 38px;
}

.run-card--expandable:active {
  background: #fafafa;
}

.run-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}

.run-card-model {
  font-weight: 600;
  font-size: 0.9375rem;
  color: #1a1a1a;
  line-height: 1.4;
  flex: 1;
  min-width: 0;
}

.run-card-filename {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.run-card-meta {
  font-size: 0.8125rem;
  color: #9ca3af;
  line-height: 1.4;
}

/* Chevron indicator */
.run-card-chevron {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: #d1d5db;
  line-height: 1;
  transition: transform 0.2s ease;
}

.run-card--open .run-card-chevron {
  transform: translateY(-50%) rotate(90deg);
}

/* Expanded content */
.run-card-expanded {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}

.run-card-duration {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 10px;
}

.run-card-links {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
}

/* Mobile pagination */
.mobile-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0 4px 0;
  margin-top: 4px;
  border-top: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.mobile-pagination button {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0 16px;
  height: 40px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  min-width: 84px;
  transition: background 0.15s ease;
}

.mobile-pagination button:hover:not(:disabled) {
  background: var(--accent-hover);
}

.mobile-pagination button:disabled {
  background: #e0e0e0;
  color: #999;
  cursor: not-allowed;
}

#mobilePageInfo {
  font-size: 0.875rem;
  color: #666;
}

/* ============================================================================
   ACCOUNT PAGE — SIGN OUT ROW (replaces inline styles)
   ============================================================================ */

.sign-out-section {
  border-top: 2px solid #e5e7eb;
  margin-top: 2rem;
}

.sign-out-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  gap: 24px;
}

.sign-out-heading {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #1f2937;
}

.sign-out-desc {
  margin: 0;
  color: #6b7280;
  font-size: 0.95rem;
}

.sign-out-btn {
  background-color: #dc3545;
  color: white;
  border: 1.5px solid #dc3545;
  text-decoration: none;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.sign-out-btn:hover {
  background-color: #c82333;
  border-color: #c82333;
  color: white;
  text-decoration: none;
}

@media (max-width: 900px) {
  .modern-account-container {
    padding: 24px 16px 40px 16px;
  }

  .modern-account-header {
    gap: 14px;
    padding-bottom: 24px;
    margin-bottom: 28px;
  }

  .modern-avatar {
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
  }

  .modern-account-name {
    font-size: 1.2rem;
  }

  .modern-account-email {
    font-size: 0.875rem;
  }

  .modern-btn-primary {
    height: 48px;
    font-size: 0.9375rem;
    border-radius: 10px;
  }

  .modern-section-title {
    font-size: 0.75rem;
    margin-bottom: 12px;
  }

  .modern-account-section {
    margin-bottom: 32px;
  }

  .modern-info-row {
    padding: 13px 0;
  }

  .modern-info-label {
    font-size: 0.875rem;
    color: #9ca3af;
  }

  .modern-info-value {
    font-size: 0.9375rem;
    font-weight: 500;
  }

  /* Sign Out — stack vertically on mobile */
  .sign-out-row {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 1.25rem 0;
  }

  .sign-out-heading {
    font-size: 1rem;
  }

  .sign-out-desc {
    font-size: 0.875rem;
  }

  .sign-out-btn {
    width: 100%;
    height: 50px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
  }
}

/* ============================================================================
   MOBILE ACCOUNT SHEET
   ============================================================================ */

.mobile-account-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 1000;
}

@media (max-width: 900px) {
  .mobile-account-backdrop.open {
    display: block;
  }
}

.mobile-account-sheet {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 20px 20px 0 0;
  z-index: 1001;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding-bottom: env(safe-area-inset-bottom, 16px);
  box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.12);
}

@media (max-width: 900px) {
  .mobile-account-sheet {
    display: flex;
  }

  .mobile-account-sheet.open {
    transform: translateY(0);
  }
}

.mobile-account-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 14px 20px;
  border-bottom: 1px solid #f0f0f0;
}

.mobile-account-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a1a1a;
}

.mobile-account-close {
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #999;
  cursor: pointer;
  border-radius: 6px;
  padding: 0;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}

.mobile-account-close:hover {
  background: #f5f5f5;
  color: #333;
}

.mobile-account-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
}

.mobile-account-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.mobile-account-btn--primary {
  background: var(--accent);
  color: #fff;
}

.mobile-account-btn--primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  color: #fff;
  text-decoration: none;
}

.mobile-account-btn--secondary {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid #d1d5db;
}

.mobile-account-btn--secondary:hover {
  background: #f9fafb;
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* Model helper text */
.model-helper-text {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: #9ca3af;
  line-height: 1.4;
}

/* Ontology hint */
.ontology-hint {
  font-size: 0.78rem;
  color: #999;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  line-height: 1;
  cursor: help;
  transition: color 0.15s ease;
  user-select: none;
}

.ontology-hint--context {
  display: flex;
  margin-top: 0;
  margin-bottom: 1.25rem;
}

.ontology-hint:hover {
  color: #555;
}

.ontology-info-icon {
  font-size: 0.85rem;
  line-height: 1;
}

/* Ontology modal content */
.upgrade-modal-content.modal-sm {
  max-width: 480px;
}

@media (min-width: 769px) {
  #ontologyModal .upgrade-modal-content.modal-sm {
    max-width: 600px;
  }
}

/* ── Ontology / small modals → bottom sheet on mobile ───────────────────── */
@media (max-width: 768px) {
  .upgrade-modal:has(.modal-sm) {
    align-items: flex-end;
    padding: 0;
  }

  .upgrade-modal-content.modal-sm {
    max-width: 100%;
    width: 100%;
    max-height: 82vh;
    border-radius: 20px 20px 0 0;
    margin: 0;
    animation: sheetSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }

  /* Drag-handle pill */
  .upgrade-modal-content.modal-sm::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
    margin: 12px auto 0;
    flex-shrink: 0;
  }

  /* Larger close-button tap target */
  .upgrade-modal-content.modal-sm .upgrade-modal-header .close {
    width: 36px;
    height: 36px;
    font-size: 1.25rem;
  }

  /* Slightly larger chips for touch */
  .upgrade-modal-content.modal-sm .ontology-chip,
  .upgrade-modal-content.modal-sm .ontology-tree-chip {
    font-size: 0.82rem;
    padding: 5px 10px;
  }

  /* Larger tap targets on tree rows */
  .upgrade-modal-content.modal-sm .ontology-tree-row {
    padding-top: 8px;
    padding-bottom: 8px;
  }
}

@keyframes sheetSlideUp {
  from { transform: translateY(100%); opacity: 0.6; }
  to   { transform: translateY(0);    opacity: 1;   }
}

.ontology-flat-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ontology-flat-list li {
  font-size: 0.875rem;
  color: #333;
  padding: 6px 0;
  border-bottom: 1px solid #f0f0f0;
}

.ontology-flat-list li:last-child {
  border-bottom: none;
}

.ontology-group {
  margin-bottom: 20px;
}

.ontology-group:last-child {
  margin-bottom: 0;
}

.ontology-group-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  margin: 0 0 10px 0;
}

.ontology-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ontology-chip {
  font-size: 0.78rem;
  color: #444;
  background: #f4f4f5;
  border-radius: 4px;
  padding: 3px 8px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}

/* ── Ontology collapsible tree ──────────────────────────────────────────── */
.ontology-tree {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ontology-tree-node {
  display: flex;
  flex-direction: column;
}

.ontology-tree-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px 5px 0;
  border-radius: 7px;
  transition: background 0.12s ease;
  outline: none;
}

.ontology-tree-row--parent {
  cursor: pointer;
}

.ontology-tree-row--parent:hover {
  background: rgba(0, 0, 0, 0.04);
}

.ontology-tree-row--parent:focus-visible {
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.12);
}

/* SVG chevron — rotates smoothly on collapse */
.ontology-tree-chevron {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  stroke: #c0c0c0;
  fill: none;
  stroke-width: 1.8;
  transform: rotate(0deg);
  transform-origin: center;
  transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1),
              stroke 0.12s ease;
}

.ontology-tree-row--parent:hover .ontology-tree-chevron {
  stroke: #888;
}

.ontology-tree-row[aria-expanded="false"] .ontology-tree-chevron {
  transform: rotate(-90deg);
}

/* ── Typography hierarchy by depth ────────────────────────────── */
.ontology-tree-label {
  line-height: 1.4;
  font-weight: 400;
  color: #444;
  font-size: 0.875rem;
}

.ontology-tree-row[data-depth="0"] .ontology-tree-label {
  font-size: 0.9375rem;
  font-weight: 650;
  color: #111;
  letter-spacing: -0.01em;
}

.ontology-tree-row[data-depth="1"] .ontology-tree-label {
  font-size: 0.875rem;
  font-weight: 540;
  color: #1f1f1f;
}

.ontology-tree-row[data-depth="2"] .ontology-tree-label {
  font-size: 0.855rem;
  font-weight: 450;
  color: #333;
}

.ontology-tree-row[data-depth="3"] .ontology-tree-label,
.ontology-tree-row[data-depth="4"] .ontology-tree-label {
  font-size: 0.84rem;
  font-weight: 400;
  color: #555;
}

/* ── Leaf chip ──────────────────────────────────────────────────── */
.ontology-tree-chip {
  display: inline-block;
  font-size: 0.775rem;
  font-weight: 400;
  color: #666;
  background: #f1f1f2;
  border-radius: 5px;
  padding: 2px 9px;
  line-height: 1.6;
  letter-spacing: 0.01em;
  transition: background 0.1s ease, color 0.1s ease;
}

.ontology-tree-row:hover .ontology-tree-chip {
  background: #e9e9eb;
  color: #444;
}

/* ── Children container ─────────────────────────────────────────── */
.ontology-tree-children {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 1px;
}

.ontology-tree-children[hidden] {
  display: none;
}

/* Slightly more vertical breathing room at the top level */
.ontology-tree > .ontology-tree-node {
  margin-bottom: 3px;
}

.ontology-tree > .ontology-tree-node:last-child {
  margin-bottom: 0;
}

.ontology-modal-body--cd8 {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0 -24px -24px;
}

.ontology-axis-row {
  display: grid;
  grid-template-columns: minmax(120px, 140px) minmax(0, 1fr);
  gap: 22px;
  padding: 26px 24px;
  border-bottom: 1px solid #eef3f7;
}

.ontology-axis-row:last-child {
  border-bottom: none;
}

.ontology-axis-row--identity {
  background: linear-gradient(90deg, #f7fffd 0%, #ffffff 64%);
}

.ontology-axis-title {
  margin: 0 0 10px;
  font-size: 1rem;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #007f78;
  text-transform: none;
}

.ontology-axis-row:nth-child(2) .ontology-axis-title {
  color: #0057b8;
}

.ontology-axis-row:nth-child(3) .ontology-axis-title {
  color: #4b2bbf;
}

.ontology-axis-helper {
  margin: 0;
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.45;
}

.ontology-axis-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ontology-pill-row {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.ontology-pill-row-title {
  color: #0f172a;
  font-size: 0.86rem;
  font-weight: 750;
  white-space: nowrap;
}

.ontology-pill-row-title::after {
  content: ":";
}

.ontology-modal-body--cd8 .ontology-chips {
  gap: 8px;
  flex-wrap: nowrap;
}

.ontology-modal-body--cd8 .ontology-chip {
  border-radius: 999px;
  padding: 6px 13px;
  border: 1px solid #dbeafe;
  background: #eff6ff;
  color: #1d4ed8;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
}

.ontology-modal-body--cd8 .ontology-axis-row:nth-child(3) .ontology-chip {
  border-color: #e9d5ff;
  background: #f3e8ff;
  color: #6d28d9;
}

.ontology-continuous-scale {
  display: inline-flex;
  align-items: center;
  color: #1e3a8a;
  font-size: 0.78rem;
  font-weight: 700;
}

.ontology-continuous-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: linear-gradient(180deg, #eff6ff, #ffffff);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.68);
  padding: 6px 11px;
  white-space: nowrap;
}

.ontology-continuous-badge-label {
  color: #1d4ed8;
}

.ontology-continuous-badge-bar {
  width: 42px;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, #dbeafe 0%, #60a5fa 52%, #1d4ed8 100%);
}

.ontology-continuous-badge-range {
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.ontology-continuous-scale-bounds {
  display: flex;
  justify-content: space-between;
  padding: 0 8px;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 650;
}

.ontology-static-tree {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding-left: 8px;
}

.ontology-static-tree-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 22px;
}

.ontology-static-tree-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #009688;
  box-shadow: 0 0 0 3px #e0f7f4;
  flex: 0 0 auto;
}

.ontology-static-tree-label {
  color: #111827;
  font-size: 0.86rem;
  font-weight: 700;
}

.ontology-static-tree-children {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-left: 3px;
  padding-left: 25px;
  border-left: 1px solid #cbd5e1;
}

.ontology-static-tree-children .ontology-static-tree-item::before {
  content: "";
  position: absolute;
  left: -25px;
  top: 50%;
  width: 18px;
  border-top: 1px solid #cbd5e1;
}

.ontology-static-tree-item--depth-1 .ontology-static-tree-label {
  font-weight: 500;
  color: #334155;
}

.ontology-static-tree-item--depth-1 .ontology-static-tree-dot {
  width: 6px;
  height: 6px;
}

@media (max-width: 640px) {
  .ontology-axis-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .ontology-pill-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .ontology-modal-body--cd8 .ontology-chips {
    flex-wrap: wrap;
  }
}

/* ── Metadata detected row (read-only, inside file-group) ───── */
.metadata-hint-row {
  flex-basis: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  margin-top: 4px;
}

.metadata-groupby-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.metadata-groupby-label {
  font-size: 0.75rem;
  color: #6b7280;
  white-space: nowrap;
  font-weight: 400;
  cursor: default;
}

.metadata-chips-area {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.metadata-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  background: #e8f4f3;
  border: 1px solid #b2ddd7;
  border-radius: 10px;
  font-size: 0.72rem;
  color: #1a6b64;
  line-height: 18px;
  white-space: nowrap;
  font-family: "SF Mono", "Fira Mono", "Courier New", monospace;
}

.metadata-helper-text {
  font-size: 0.71rem;
  color: #c4c9d4;
  margin: 0;
  line-height: 1.4;
}

/* ============================================================================
   INSIGHTS DRAWER
   ============================================================================ */

.insights-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1100;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.insights-drawer-backdrop.open {
  display: block;
  animation: insightsBackdropIn 0.2s ease;
}
@keyframes insightsBackdropIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.insights-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 75vw;
  min-width: 380px;
  max-width: none;
  background: #ffffff;
  z-index: 1101;
  display: flex;
  flex-direction: column;
  box-shadow: -6px 0 32px rgba(0, 0, 0, 0.1);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.insights-drawer.open {
  transform: translateX(0);
}

/* Header */
.insights-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #f3f4f6;
  flex-shrink: 0;
  gap: 12px;
}
.insights-drawer-title-group h2 {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 3px;
  line-height: 1.3;
}
.insights-drawer-subtitle {
  font-size: 15px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.35;
  margin: 0;
}
.insights-drawer-close {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: #9ca3af;
  padding: 2px 4px;
  flex-shrink: 0;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.insights-drawer-close:hover {
  color: #374151;
  background: #f3f4f6;
}

/* Body */
.insights-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.insights-loading-banner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  padding: 9px 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  color: #1d4ed8;
  font-size: 12.5px;
  font-weight: 500;
}
.insights-loading-banner[hidden] { display: none; }
.insights-loading-banner.is-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}
.insights-loading-banner-dots {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.insights-loading-banner-dots[hidden] {
  display: none;
}
.insights-loading-banner-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3b82f6;
  animation: insightsBannerPulse 1.2s ease-in-out infinite;
}
.insights-loading-banner-dots span:nth-child(2) { animation-delay: 0.2s; }
.insights-loading-banner-dots span:nth-child(3) { animation-delay: 0.4s; }
.insights-loading-banner-button {
  margin-left: auto;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  padding: 6px 12px;
}
.insights-loading-banner-button[hidden] {
  display: none;
}
@keyframes insightsBannerPulse {
  0%, 80%, 100% { transform: scale(1);   opacity: 0.4; }
  40%           { transform: scale(1.4); opacity: 1;   }
}

.insights-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 14px;
  margin-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}

.insights-tab {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  padding: 8px 12px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.insights-tab:hover {
  background: #eef2f7;
  border-color: #cbd5e1;
  color: #334155;
  transform: none;
}

.insights-tab.active {
  background: #e0f2fe;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.insight-panel[hidden] {
  display: none !important;
}

.cell-embedding-space-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.cell-embedding-space-copy {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: #6b7280;
}

.cell-embedding-space-subtitle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
}

.cell-embedding-space-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #64748b;
  cursor: help;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.cell-embedding-space-info::before,
.cell-embedding-space-info::after {
  position: absolute;
  left: 50%;
  z-index: 8;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.cell-embedding-space-info::before {
  content: "";
  top: calc(100% + 4px);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: #334155;
}

.cell-embedding-space-info::after {
  content: attr(data-tooltip);
  top: calc(100% + 15px);
  width: min(360px, 72vw);
  transform: translateX(-50%);
  border-radius: 8px;
  background: #334155;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.22);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  padding: 8px 10px;
}

.cell-embedding-space-info:hover::before,
.cell-embedding-space-info:hover::after,
.cell-embedding-space-info:focus-visible::before,
.cell-embedding-space-info:focus-visible::after {
  opacity: 1;
}

.cell-embedding-space-generate-btn {
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 600;
  padding: 10px 14px;
  cursor: pointer;
}

.cell-embedding-space-control {
  display: grid;
  grid-template-rows: 16px 44px;
  gap: 6px;
  min-width: 0;
  position: relative;
}

.cell-embedding-space-control > span {
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  color: #475569;
}

.cell-embedding-space-control select,
.cell-embedding-space-selector-toggle,
.cell-embedding-space-highlight-toggle {
  width: 100%;
  min-width: 0;
  height: 44px;
  border: 1px solid #dbe3ee;
  border-radius: 9px;
  background: #fff;
  color: #1f2937;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 0 12px;
}

.cell-embedding-space-native-select {
  display: none !important;
}

.cell-embedding-space-selector-toggle {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  line-height: 1.15;
  text-align: left;
}

.cell-embedding-space-selector-toggle:hover {
  background: #f8fafc;
  transform: none;
}

.cell-embedding-space-biology-control,
.cell-embedding-space-metadata-control {
  position: relative;
}

.cell-embedding-space-control[hidden],
.cell-embedding-space-biology-control[hidden],
.cell-embedding-space-metadata-control[hidden],
#cellEmbeddingSpaceOverlayControl[hidden] {
  display: none !important;
}

.cell-embedding-space-selector-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 6;
  width: min(280px, 82vw);
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.16);
  padding: 8px;
}

.cell-embedding-space-selector-menu--compact {
  width: min(220px, 82vw);
}

#cellEmbeddingSpaceBiologyMenu {
  width: 100%;
}

.cell-embedding-space-selector-menu[hidden] {
  display: none !important;
}

.cell-embedding-space-selector-section + .cell-embedding-space-selector-section {
  border-top: 1px solid #eef2f7;
  margin-top: 6px;
  padding-top: 6px;
}

.cell-embedding-space-selector-heading {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 6px 8px 4px;
  text-transform: uppercase;
}

.cell-embedding-space-selector-subheading {
  color: #1f2937;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 8px 3px;
}

.cell-embedding-space-selector-row {
  width: 100%;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #1f2937;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 8px;
  text-align: left;
}

.cell-embedding-space-selector-row--child {
  padding-left: 18px;
}

.cell-embedding-space-selector-row:hover,
.cell-embedding-space-selector-row[aria-current="true"] {
  background: #eff6ff;
  color: #1d4ed8;
  transform: none;
}

.cell-embedding-space-selector-row:disabled {
  color: #94a3b8;
  cursor: not-allowed;
}

.cell-embedding-space-selector-row:disabled:hover {
  background: transparent;
}

.cell-embedding-space-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  column-gap: 8px;
  row-gap: 6px;
  justify-content: flex-end;
  width: min(680px, 100%);
  min-width: 0;
}

.cell-embedding-space-controls--biology {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(680px, 100%);
}

.cell-embedding-space-controls--single {
  grid-template-columns: repeat(2, minmax(220px, 320px));
  justify-content: end;
  width: min(650px, 100%);
}

.cell-embedding-space-highlight-control {
  grid-column: 2;
  grid-row: auto;
  position: relative;
  display: grid;
  grid-template-rows: 16px 44px;
  gap: 6px;
  min-width: 0;
}

.cell-embedding-space-highlight-control::before {
  content: "Values";
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  color: #475569;
}

.cell-embedding-space-highlight-control[hidden] {
  display: none !important;
}

.cell-embedding-space-highlight-toggle {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  white-space: nowrap;
}

.cell-embedding-space-highlight-toggle:hover {
  background: #f8fafc;
  transform: none;
}

.cell-embedding-space-highlight-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 5;
  width: min(360px, 82vw);
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.16);
  padding: 10px;
}

.cell-embedding-space-highlight-menu[hidden] {
  display: none !important;
}

.cell-embedding-space-highlight-menu-header {
  display: flex;
  gap: 8px;
  align-items: center;
}

.cell-embedding-space-highlight-search {
  flex: 1;
  min-width: 0;
  border: 1px solid #dbe3ee;
  border-radius: 9px;
  color: #1f2937;
  font-size: 13px;
  padding: 8px 10px;
}

.cell-embedding-space-highlight-clear {
  border: 1px solid #e5e7eb;
  border-radius: 9px;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 10px;
  white-space: nowrap;
}

.cell-embedding-space-highlight-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  border: 1px solid #e5e7eb;
  border-radius: 9px;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  padding: 0;
}

.cell-embedding-space-highlight-clear:hover {
  background: #eef2f7;
  transform: none;
}

.cell-embedding-space-highlight-close:hover {
  background: #f8fafc;
  transform: none;
}

.cell-embedding-space-highlight-clear:disabled {
  opacity: 0.55;
}

.cell-embedding-space-highlight-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.cell-embedding-space-highlight-chip {
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  max-width: 150px;
  overflow: hidden;
  padding: 5px 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-embedding-space-highlight-chip:hover {
  background: #dbeafe;
  transform: none;
}

.cell-embedding-space-highlight-limit {
  margin-top: 8px;
  border-radius: 8px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 9px;
}

.cell-embedding-space-highlight-list {
  display: grid;
  gap: 3px;
  margin-top: 10px;
  max-height: 280px;
  overflow: auto;
}

.cell-embedding-space-highlight-row {
  display: grid;
  grid-template-columns: 18px 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #1f2937;
  cursor: pointer;
  font-size: 12px;
  padding: 7px 8px;
  text-align: left;
}

.cell-embedding-space-highlight-row:hover {
  background: #f1f5f9;
  transform: none;
}

.cell-embedding-space-highlight-row:disabled {
  background: transparent;
  color: #94a3b8;
  cursor: not-allowed;
}

.cell-embedding-space-highlight-row:disabled:hover {
  background: transparent;
}

.cell-embedding-space-highlight-checkbox {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  color: #2563eb;
  font-size: 11px;
  font-weight: 900;
}

.cell-embedding-space-highlight-swatch {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.cell-embedding-space-highlight-value {
  color: #64748b;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-embedding-space-highlight-count {
  color: #1f2937;
  font-weight: 500;
  white-space: nowrap;
}

.cell-embedding-space-highlight-empty {
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 2px;
}

.cell-embedding-space-plot-shell {
  position: relative;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  margin-bottom: 0;
}

.cell-embedding-space-plot {
  position: relative;
  height: clamp(420px, calc(100vh - 310px), 700px);
}

.cell-embedding-space-plot > div {
  width: 100%;
  height: 100%;
}

.cell-embedding-space-reset-view {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 3;
  border: 1px solid rgba(203, 213, 225, 0.8);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  color: #64748b;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 8px 11px;
}

.cell-embedding-space-reset-view:hover {
  border-color: #94a3b8;
  background: #fff;
  color: #0f172a;
}

.cell-embedding-space-reset-view[hidden] {
  display: none;
}

.cell-embedding-space-minimap {
  position: absolute;
  right: 20px;
  bottom: 72px;
  z-index: 3;
  width: min(190px, 34%);
  height: 138px;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
  overflow: hidden;
  padding: 8px;
  cursor: default;
  pointer-events: auto;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.cell-embedding-space-minimap.is-collapsed {
  width: auto;
  height: auto;
  min-width: 0;
  padding: 0;
  border-radius: 999px;
  cursor: default;
}

.cell-embedding-space-minimap-title {
  position: absolute;
  top: 8px;
  left: 10px;
  z-index: 1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #475569;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  padding: 5px 7px;
  text-transform: uppercase;
}

.cell-embedding-space-minimap-toggle {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #64748b;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  padding: 0 7px;
}

.cell-embedding-space-minimap-toggle:hover {
  border-color: #94a3b8;
  background: #fff;
  color: #0f172a;
  transform: none;
}

.cell-embedding-space-minimap.is-collapsed .cell-embedding-space-minimap-title,
.cell-embedding-space-minimap.is-collapsed > div:last-child {
  display: none;
}

.cell-embedding-space-minimap.is-collapsed .cell-embedding-space-minimap-toggle {
  position: static;
  min-width: 0;
  height: 34px;
  border: 0;
  box-shadow: none;
  color: #475569;
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 0 12px;
  text-transform: uppercase;
}

.cell-embedding-space-minimap > div:last-child {
  width: 100%;
  height: 100%;
}

.cell-embedding-space-focus-breadcrumb {
  position: absolute;
  top: 62px;
  left: 20px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: min(520px, calc(100% - 40px));
}

.cell-embedding-space-focus-chip,
.cell-embedding-space-focus-exit {
  border: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
  color: #334155;
  cursor: pointer;
  font-family: inherit;
}

.cell-embedding-space-focus-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  overflow: hidden;
  padding: 8px 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-embedding-space-focus-chip:hover,
.cell-embedding-space-focus-chip:focus-visible {
  border-color: #93c5fd;
  background: rgba(239, 246, 255, 0.96);
  color: #0f172a;
  outline: none;
}

.cell-embedding-space-focus-chip.is-new-focus {
  animation: cellEmbeddingFocusPulse 900ms ease-out;
}

@keyframes cellEmbeddingFocusPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.32), 0 8px 24px rgba(15, 23, 42, 0.1);
  }
  100% {
    box-shadow: 0 0 0 12px rgba(59, 130, 246, 0), 0 8px 24px rgba(15, 23, 42, 0.1);
  }
}

.cell-embedding-space-focus-breadcrumb-divider {
  color: #94a3b8;
}

.cell-embedding-space-focus-breadcrumb[hidden] {
  display: none;
}

.cell-embedding-space-focus-exit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  flex-shrink: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  padding: 0;
}

.cell-embedding-space-focus-exit:hover,
.cell-embedding-space-focus-exit:focus-visible {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #991b1b;
  outline: none;
}

.cell-embedding-space-focus-breadcrumb-signal {
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 4px 7px;
  text-transform: uppercase;
}

.cell-embedding-space-focus-breadcrumb-signal--review,
.cell-embedding-space-focus-breadcrumb-signal--low,
.cell-embedding-space-focus-breadcrumb-signal--mixed {
  background: #fef3c7;
  color: #92400e;
}

.cell-embedding-space-focus-breadcrumb-signal--rare {
  background: #dcfce7;
  color: #166534;
}

.cell-embedding-space-legend {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 14px;
}

.cell-embedding-space-legend-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.cell-embedding-space-legend-section-title {
  color: #374151;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cell-embedding-space-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: #475569;
  transition: opacity 140ms ease, color 140ms ease, font-weight 140ms ease;
}

.cell-embedding-space-legend-item--numeric {
  align-items: flex-start;
  flex-direction: column;
  gap: 6px;
}

.cell-embedding-space-legend-item--confidence {
  flex-basis: 100%;
  margin-top: 2px;
}

.cell-embedding-space-legend-item--muted {
  color: #64748b;
}

.cell-embedding-space-legend-label {
  line-height: 1.2;
}

.cell-embedding-space-legend-item.is-active {
  color: #0f172a;
  font-weight: 800;
}

.cell-embedding-space-legend-item.is-active .cell-embedding-space-legend-swatch {
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.12);
}

.cell-embedding-space-legend-item.is-dimmed {
  opacity: 0.38;
}

.cell-embedding-space-legend-swatch {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  flex-shrink: 0;
}

.cell-embedding-space-legend-swatch--outline {
  background: #fff;
  border: 2px solid #0ea5e9;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(148, 163, 184, 0.28);
}

.cell-embedding-space-ring-key {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cell-embedding-space-ring-key i {
  display: block;
  border-radius: 999px;
  background: transparent;
}

.cell-embedding-space-ring-key i:nth-child(1) {
  width: 6px;
  height: 6px;
  border: 1px solid #bae6fd;
}

.cell-embedding-space-ring-key i:nth-child(2) {
  width: 10px;
  height: 10px;
  border: 2px solid #38bdf8;
}

.cell-embedding-space-ring-key i:nth-child(3) {
  width: 14px;
  height: 14px;
  border: 3px solid #0369a1;
}

.cell-embedding-space-hover-tooltip {
  position: absolute;
  z-index: 3;
  max-width: 300px;
  pointer-events: none;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.14);
  color: #111827;
  padding: 9px 11px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.cell-embedding-space-hover-tooltip[hidden] {
  display: none;
}

.cell-embedding-space-hover-tooltip-compact {
  display: grid;
  gap: 3px;
  min-width: 92px;
}

.cell-embedding-space-hover-tooltip-compact strong {
  color: #0f172a;
  font-size: 12px;
  font-weight: 800;
}

.cell-embedding-space-hover-tooltip-compact span {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.cell-embedding-space-hover-title {
  display: grid;
  gap: 3px;
  margin-bottom: 5px;
  font-size: 13px;
  font-weight: 700;
}

.cell-embedding-space-hover-subtitle {
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
}

.cell-embedding-space-hover-section {
  display: grid;
  gap: 6px;
  padding: 7px 0;
}

.cell-embedding-space-hover-section + .cell-embedding-space-hover-section {
  border-top: 1px solid #e2e8f0;
}

.cell-embedding-space-hover-section-label {
  color: #64748b;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cell-embedding-space-hover-grid {
  display: grid;
  gap: 5px;
}

.cell-embedding-space-hover-grid div {
  display: grid;
  grid-template-columns: minmax(86px, auto) minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
}

.cell-embedding-space-hover-grid span {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.cell-embedding-space-hover-grid strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #111827;
  font-size: 12px;
  font-weight: 700;
}

.cell-embedding-space-hover-signal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: fit-content;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 6px 10px;
}

.cell-embedding-space-hover-nuance {
  margin: -1px 0 0;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.cell-embedding-space-hover-signal--review,
.cell-embedding-space-hover-signal--low,
.cell-embedding-space-hover-signal--mixed {
  background: #fef3c7;
  color: #92400e;
}

.cell-embedding-space-hover-signal--rare {
  background: #dcfce7;
  color: #166534;
}

.cell-embedding-space-hover-signal-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.56);
}

.cell-embedding-space-clusters {
  display: grid;
  gap: 10px;
}

.cell-embedding-space-clusters[hidden] {
  display: none;
}

.cell-embedding-space-clusters--all {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
}

.cell-embedding-space-cluster-card {
  margin-top: 14px;
}

.cell-embedding-space-cluster-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.cell-embedding-space-cluster-toggle {
  flex-shrink: 0;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 11px;
  cursor: pointer;
}

.cell-embedding-space-cluster-toggle:hover {
  background: #f8fafc;
  color: #111827;
}

.cell-embedding-space-cluster-empty {
  margin: 0;
  color: #6b7280;
  font-size: 13px;
}

.cell-embedding-space-cluster {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #eef2f7;
  cursor: pointer;
}

.cell-embedding-space-cluster:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.cell-embedding-space-cluster.is-active {
  background: #eff6ff;
  box-shadow: inset 3px 0 0 #3b82f6;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 -12px;
}

.cell-embedding-space-cluster-title {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: #111827;
}

.cell-embedding-space-cluster-copy {
  margin: 0;
  font-size: 12px;
  color: #6b7280;
}

.cell-embedding-space-cluster-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cell-embedding-space-cluster-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
}

.cell-embedding-space-cluster-status--rare {
  background: #dcfce7;
  color: #166534;
}

.cell-embedding-space-cluster-status--low,
.cell-embedding-space-cluster-status--mixed {
  background: #fef3c7;
  color: #92400e;
}

.cell-embedding-space-cluster-status--consistent {
  background: #dbeafe;
  color: #1d4ed8;
}

.cell-embedding-space-confidence-bar {
  width: 80px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #d73027 0%, #f46d43 25%, #fee08b 50%, #66c2a5 75%, #02818a 100%);
}

.cell-embedding-space-confidence-bar--opacity {
  width: 160px;
  height: 8px;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.18), rgba(15, 23, 42, 1));
}

.insight-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 56px 20px;
  border: 1px dashed #dbeafe;
  border-radius: 14px;
  background: #f8fbff;
}

.insight-placeholder[hidden] {
  display: none;
}

.insight-placeholder-icon {
  font-size: 28px;
  color: #93c5fd;
}

.insight-placeholder-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}

.insight-placeholder-copy {
  margin: 0;
  max-width: 320px;
  font-size: 13px;
  line-height: 1.6;
  color: #6b7280;
}

.transitional-card {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fbfdff;
  padding: 18px 18px 16px;
}

.transitional-card-kicker {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  color: #0f766e;
  letter-spacing: 0.02em;
}

.transitional-card-summary {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: #1f2937;
}

.transitional-top-states {
  margin-top: 16px;
}

.transitional-top-states-label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.transitional-top-states-list {
  margin: 0;
  padding-left: 18px;
  color: #374151;
  font-size: 14px;
  line-height: 1.7;
}

.transitional-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.transitional-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid #cbd5e1;
  background: #e8edf5;
  color: #1e3a58;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.transitional-action-btn:hover {
  background: #dae3f0;
  border-color: #93aec8;
  color: #1e3a58;
}

.transitional-action-btn--secondary {
  background: #fff;
  color: #374151;
}

.transitional-action-btn--secondary:hover {
  background: #f8fafc;
  color: #111827;
}

/* ── Low-confidence filter control ── */
.lc-filter {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 16px;
}

.lc-filter-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  line-height: 1.3;
}

.lc-filter-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: #6b7280;
}

.lc-filter-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Reuse the app's insights-tab pill style */
.lc-cutoff-preset {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.lc-cutoff-preset:hover {
  background: #eef2f7;
  border-color: #cbd5e1;
  color: #334155;
}
.lc-cutoff-preset--active {
  background: #e0f2fe;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.lc-filter-threshold-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lc-filter-threshold-label {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
}

.lc-filter-threshold-input {
  width: 52px;
  padding: 4px 8px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  background: #fff;
  text-align: center;
  -moz-appearance: textfield;
  transition: border-color 0.15s;
}
.lc-filter-threshold-input:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.25);
}
.lc-filter-threshold-input::-webkit-outer-spin-button,
.lc-filter-threshold-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.lc-filter-threshold-pct {
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
}

.lc-filter-result {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  color: #111827;
  min-height: 20px;
}

.lc-filter-result-title {
  font-size: 15px;
  font-weight: 700;
}

.lc-filter-result-count {
  font-size: 14px;
  font-weight: 600;
}

.lc-filter-result-threshold,
.lc-filter-result-help {
  color: #6b7280;
}

.lc-cutoff-slider {
  width: 100%;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 3px;
  background: linear-gradient(to right, #1d4ed8 var(--lc-fill, 5%), #e5e7eb var(--lc-fill, 5%));
  outline: none;
  margin: 4px 0 0;
}
.lc-cutoff-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #1d4ed8;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(29, 78, 216, 0.3);
  cursor: pointer;
  transition: background 0.12s;
}
.lc-cutoff-slider::-webkit-slider-thumb:hover {
  background: #1e40af;
}
.lc-cutoff-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #1d4ed8;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(29, 78, 216, 0.3);
  cursor: pointer;
}
.lc-cutoff-slider::-moz-range-track {
  height: 4px;
  border-radius: 3px;
  background: #e5e7eb;
}

/* ── Loading ── */
.cell_compositon-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 24px 0;
}
.cell_compositon-loading[hidden],
.cell_compositon-empty-state[hidden] {
  display: none;
}
.cell_compositon-loading-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d1d5db;
  animation: cellCompositonPulse 1.2s ease-in-out infinite;
}
.cell_compositon-loading-dot:nth-child(2) { animation-delay: 0.2s; }
.cell_compositon-loading-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes cellCompositonPulse {
  0%, 80%, 100% { transform: scale(1);   opacity: 0.5; }
  40%           { transform: scale(1.4); opacity: 1;   }
}

/* ── Empty / error state ── */
.cell_compositon-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 48px 24px;
  text-align: center;
}
.cell_compositon-empty-icon {
  font-size: 32px;
  opacity: 0.35;
}
.cell_compositon-empty-msg {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.6;
  max-width: 260px;
  margin: 0;
}

/* ── Controls row ── */
.cell_compositon-controls {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
  margin-bottom: 10px;
}
.cell_compositon-group-by {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 100%;
  min-width: 0;
  flex-wrap: wrap;
  order: 1;
}
.cell_compositon-group-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  flex-wrap: wrap;
  min-width: 0;
}
.cell_compositon-group-list {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}
.cell_compositon-group-add {
  position: relative;
  flex-shrink: 0;
}
.cell_compositon-group-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}
.cell_compositon-group-chip-remove {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}
.cell_compositon-group-chip-remove:focus {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
  border-radius: 999px;
}
.cell_compositon-group-label {
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  white-space: nowrap;
}
.cell_compositon-primary-label {
  letter-spacing: 0.01em;
}
.cell_compositon-group-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 11px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  color: #374151;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.cell_compositon-group-add-btn::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #6b7280;
  margin-left: 2px;
}
.cell_compositon-group-add-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.cell_compositon-group-add-btn:focus {
  outline: 2px solid #6366f1;
  outline-offset: 1px;
  border-color: transparent;
}
.cell_compositon-group-add-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.cell_compositon-group-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 180px;
  max-width: 240px;
  padding: 6px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
  z-index: 20;
}
.cell_compositon-group-menu[hidden] {
  display: none;
}
.cell_compositon-group-menu-item {
  width: 100%;
  border: none;
  background: transparent;
  border-radius: 8px;
  color: #1f2937;
  cursor: pointer;
  display: block;
  font-size: 12px;
  padding: 8px 10px;
  text-align: left;
}
.cell_compositon-group-menu-item:hover {
  background: #f8fafc;
}
.cell_compositon-group-menu-item:focus {
  outline: 2px solid #6366f1;
  outline-offset: 1px;
}
.cell_compositon-group-menu-empty {
  color: #9ca3af;
  font-size: 12px;
  padding: 8px 10px;
}

.cell_compositon-sort-by {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.cell_compositon-sort-by[hidden] {
  display: none;
}
.cell_compositon-stats-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1 1 100%;
  flex-wrap: wrap;
  min-width: 0;
  order: 2;
}
.cell_compositon-stats-row[hidden] {
  display: none !important;
}
.cell_compositon-stats-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.cell_compositon-sample-column {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}
.cell_compositon-sample-column[hidden] {
  display: none;
}
.cell_compositon-sample-column .cell_compositon-sort-select {
  width: auto;
  min-width: 220px;
  max-width: 320px;
}
.cell_compositon-switch {
  display: inline-flex;
  align-items: center;
  margin: 0;
  cursor: pointer;
}
.cell_compositon-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.cell_compositon-switch-track {
  position: relative;
  display: block;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #a3a3a3;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.22);
  transition: background 0.16s ease, box-shadow 0.16s ease;
}
.cell_compositon-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.35);
  transition: transform 0.16s ease;
}
.cell_compositon-switch input:checked + .cell_compositon-switch-track {
  background: #1f2937;
}
.cell_compositon-switch input:checked + .cell_compositon-switch-track .cell_compositon-switch-thumb {
  transform: translateX(18px);
}
.cell_compositon-switch input:focus-visible + .cell_compositon-switch-track {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}
.cell_compositon-sort-select {
  appearance: none;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  color: #374151;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 28px 6px 11px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  background-image:
    linear-gradient(45deg, transparent 50%, #6b7280 50%),
    linear-gradient(135deg, #6b7280 50%, transparent 50%);
  background-position:
    calc(100% - 14px) 50%,
    calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.cell_compositon-sort-select:focus {
  outline: 2px solid #6366f1;
  outline-offset: 1px;
  border-color: transparent;
}

/* No metadata hint */
.cell_compositon-no-meta-hint {
  font-size: 12px;
  color: #9ca3af;
  background: #f9fafb;
  border: 1px dashed #e5e7eb;
  border-radius: 7px;
  padding: 10px 13px;
  line-height: 1.5;
  margin: 12px 0;
}
.cell_compositon-no-meta-hint code {
  font-family: "SF Mono", "Fira Mono", monospace;
  font-size: 11px;
  background: #e5e7eb;
  padding: 1px 4px;
  border-radius: 3px;
}

/* ── Row order ── */
.cell_compositon-row-order {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  min-width: 0;
  flex: 1 1 100%;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px 14px;
}
.cell_compositon-row-order[hidden] {
  display: none;
}
.cell_compositon-row-order-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.cell_compositon-row-order-title {
  color: #374151;
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 3px;
}
.cell_compositon-row-order-help {
  color: #6b7280;
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
}
.cell_compositon-row-order-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.cell_compositon-row-order-controls {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.cell_compositon-row-order-list {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  min-width: 0;
  width: 100%;
}
.cell_compositon-row-order-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 9px;
  background: #fff;
  color: #374151;
  cursor: grab;
  font-size: 12px;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.cell_compositon-row-order-chip:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.cell_compositon-row-order-chip:focus {
  outline: 2px solid #6366f1;
  outline-offset: 1px;
  border-color: transparent;
}
.cell_compositon-row-order-chip.is-dragging {
  opacity: 0.55;
  cursor: grabbing;
  border-color: #6366f1;
  box-shadow: 0 8px 18px rgba(99, 102, 241, 0.16);
}
.cell_compositon-row-order-chip.is-drop-target {
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.14);
}
.cell_compositon-row-order-handle {
  color: #9ca3af;
  font-family: "SF Mono", "Fira Mono", monospace;
  font-size: 11px;
  letter-spacing: -1px;
}
.cell_compositon-row-order-text {
  white-space: nowrap;
}
.cell_compositon-row-order-reset {
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  color: #6b7280;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.cell_compositon-row-order-done {
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  color: #6b7280;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.cell_compositon-row-order-reset:hover,
.cell_compositon-row-order-done:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #374151;
}
.cell_compositon-row-order-reset:focus,
.cell_compositon-row-order-done:focus {
  outline: 2px solid #6366f1;
  outline-offset: 1px;
  border-color: transparent;
}

/* ── View toggle ── */
.cell_compositon-view-toggle {
  display: flex;
  background: #f3f4f6;
  border-radius: 6px;
  padding: 2px;
  flex-shrink: 0;
  margin-left: auto;
  order: 1;
}
.cell_compositon-toggle-btn {
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.cell_compositon-toggle-btn.active {
  background: #fff;
  color: #111827;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ── Key insights (drivers of variation) ── */
.cell_compositon-insights {
  background: #f8faff;
  border: 1px solid #e0e7ff;
  border-radius: 10px;
  padding: 13px 15px;
  margin: 12px 0;
  transition: opacity 0.15s ease;
}
.cell_compositon-insights.is-custom-order {
  opacity: 0.66;
}
.cell_compositon-insights-label {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6366f1;
  margin: 0 0 5px;
}
.cell_compositon-insights-meta {
  color: #6b7280;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
}
.cell_compositon-insights-meta:empty {
  display: none;
}
.cell_compositon-insights-note {
  color: #6b7280;
  font-size: 12px;
  line-height: 1.45;
  margin: 0 0 9px;
}
.cell_compositon-insights-note[hidden] {
  display: none;
}
.cell_compositon-drivers-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cell_compositon-driver-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.45;
}
.cell_compositon-driver-icon {
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 1px;
}
.cell_compositon-driver-item--enriched .cell_compositon-driver-icon { color: #4f46e5; }
.cell_compositon-driver-item--depleted .cell_compositon-driver-icon { color: #b45309; }
.cell_compositon-driver-item--stable   .cell_compositon-driver-icon { color: #9ca3af; }
.cell_compositon-driver-item--enriched .cell_compositon-driver-text { color: #1e293b; }
.cell_compositon-driver-item--depleted .cell_compositon-driver-text { color: #1e293b; }
.cell_compositon-driver-item--stable   .cell_compositon-driver-text { color: #6b7280; }
.cell_compositon-driver-accent { color: #4f46e5; font-weight: 500; }
.cell_compositon-driver-support {
  display: block;
  color: #6b7280;
  font-size: 11px;
  margin-top: 1px;
}
.cell_compositon-driver-qvalue {
  color: #6b7280;
  font-weight: 500;
}
.cell_compositon-driver-support--strong { color: #047857; font-weight: 600; }
.cell_compositon-driver-support--moderate { color: #0f766e; font-weight: 600; }
.cell_compositon-driver-support--weak { color: #a16207; }
.cell_compositon-driver-support--none { color: #6b7280; }
.cell_compositon-stats-error {
  color: #b91c1c;
  font-size: 12px;
  margin: 4px 0 0;
}

/* ── Chart ── */
.cell_compositon-chart-container {
  position: relative;
  width: 100%;
}
.cell_compositon-chart-row-labels {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 2;
  pointer-events: none;
}
.cell_compositon-chart-row-label {
  position: absolute;
  left: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  width: 100%;
  max-width: 100%;
  min-height: 24px;
  padding: 3px 7px 3px 4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #374151;
  cursor: grab;
  font: inherit;
  font-size: 11px;
  line-height: 1.2;
  pointer-events: auto;
  touch-action: none;
  transform: translateY(-50%);
  user-select: none;
}
.cell_compositon-chart-row-label:hover,
.cell_compositon-chart-row-label:focus-visible {
  background: rgba(248, 250, 252, 0.92);
}
.cell_compositon-chart-row-label:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 1px;
}
.cell_compositon-chart-row-label.is-dragging {
  cursor: grabbing;
  opacity: 0.62;
}
.cell_compositon-chart-row-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.62;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}
.cell_compositon-chart-row-remove svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}
.cell_compositon-chart-row-label:hover .cell_compositon-chart-row-remove,
.cell_compositon-chart-row-remove:focus-visible {
  opacity: 1;
}
.cell_compositon-chart-row-remove:hover,
.cell_compositon-chart-row-remove:focus-visible {
  background: #fee2e2;
  color: #dc2626;
}
.cell_compositon-chart-row-remove:focus-visible {
  outline: 2px solid #f87171;
  outline-offset: 1px;
}
.cell_compositon-chart-container.is-dragging-row-label,
.cell_compositon-chart-container.is-dragging-row-label * {
  cursor: grabbing !important;
}
.cell_compositon-chart-row-label.is-drop-target::before {
  position: absolute;
  right: 0;
  left: 0;
  top: -4px;
  height: 2px;
  border-radius: 999px;
  background: #6366f1;
  content: "";
}
.cell_compositon-chart-row-label.is-drop-target.is-drop-after::before {
  top: auto;
  bottom: -4px;
}
.cell_compositon-chart-row-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cell_compositon-chart-note {
  font-size: 11px;
  color: #9ca3af;
  margin: 6px 0 0;
  text-align: right;
}
.cell_compositon-chart-reset-hidden {
  border: 0;
  background: transparent;
  color: #4f46e5;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0;
}
.cell_compositon-chart-reset-hidden:hover,
.cell_compositon-chart-reset-hidden:focus-visible {
  text-decoration: underline;
}
.cell_compositon-chart-reset-hidden:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
  border-radius: 3px;
}

/* ── Table ── */
.cell_compositon-table-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}
.cell_compositon-csv-btn {
  font-size: 12px;
  padding: 5px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  color: #374151;
  cursor: pointer;
  transition: background 0.15s;
}
.cell_compositon-csv-btn:hover { background: #f9fafb; }
.cell_compositon-table-container { overflow-x: auto; }
.cell_compositon-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.cell_compositon-table th {
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  padding: 7px 10px;
  text-align: left;
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
}
.cell_compositon-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
}
.cell_compositon-table tr:last-child td { border-bottom: none; }

/* ── Cell Compositon pill bar (legend) ── */
.cell_compositon-pill-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  gap: 1px;
  margin-top: 2px;
}
.cell_compositon-pill-segment {
  height: 100%;
  border-radius: 2px;
}

/* Button styling for result-link button variant (primary action — muted) */
.result-link--btn,
#inferenceTable .result-link--btn,
#showcasedInferenceCards .result-link--btn {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 14px;
  line-height: 1.4;
  background: #e8edf5;
  border-color: #b8c9e0;
  color: #2d4a6e !important;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
}

.result-link--btn:hover,
#inferenceTable .result-link--btn:hover,
#showcasedInferenceCards .result-link--btn:hover {
  background: #dae3f0;
  border-color: #93aec8;
  color: #1e3a58 !important;
}

/* Primary action (e.g. Retry on failed runs) */
.result-link--primary,
#inferenceTable .result-link--primary,
#showcasedInferenceCards .result-link--primary {
  background: #1e293b;
  border-color: #1e293b;
  color: #fff !important;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.result-link--primary:hover,
#inferenceTable .result-link--primary:hover,
#showcasedInferenceCards .result-link--primary:hover {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff !important;
}

/* Cancel button (outlined secondary) */
.result-link--cancel,
#inferenceTable .result-link--cancel,
#showcasedInferenceCards .result-link--cancel {
  border-color: #fca5a5;
  color: #b91c1c !important;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
}

.result-link--cancel:hover,
#inferenceTable .result-link--cancel:hover,
#showcasedInferenceCards .result-link--cancel:hover {
  background: #fef2f2;
  border-color: #f87171;
  color: #991b1b !important;
}

.result-link--cancel:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Muted text (e.g. "Stopping…") */
.result-link--muted,
#inferenceTable .result-link--muted,
#showcasedInferenceCards .result-link--muted {
  border-color: #e2e8f0;
  color: #94a3b8 !important;
  font-style: italic;
  cursor: default;
}

/* Overflow (⋯) menu */
.action-overflow {
  position: relative;
  display: inline-flex;
}

.action-overflow__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-width: 42px;
  height: 36px;
  padding: 0;
  border: 1px solid #b8c9e0;
  border-radius: 9px;
  background: #e8edf5;
  color: #2d4a6e;
  font-size: 17px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.action-overflow__trigger:hover {
  background: #dae3f0;
  border-color: #93aec8;
  color: #1e3a58;
}

.action-overflow__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  min-width: 120px;
  z-index: 100;
  padding: 4px 0;
}

.action-overflow__item {
  display: block;
  width: 100%;
  padding: 7px 14px;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 12px;
  color: #374151;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.12s;
}

.action-overflow__item:hover {
  background: #f8fafc;
  color: #1e293b;
}

/* Mobile */
@media (max-width: 768px) {
  .insights-drawer {
    width: 100%;
    min-width: unset;
    max-width: unset;
  }

  .cell-embedding-space-plot {
    height: clamp(340px, calc(100vh - 370px), 560px);
  }

  .cell-embedding-space-minimap {
    right: 14px;
    bottom: 60px;
    width: 138px;
    height: 104px;
  }

  .cell-embedding-space-minimap.is-collapsed {
    width: auto;
    height: auto;
  }

  .cell-embedding-space-cluster-card-header,
  .cell-embedding-space-toolbar {
    flex-direction: column;
  }

  .cell-embedding-space-controls {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    width: 100%;
  }

  .cell-embedding-space-highlight-control {
    grid-column: auto;
    grid-row: auto;
  }

  .cell-embedding-space-highlight-menu {
    width: min(360px, 100%);
  }

  .cell-embedding-space-detail-stats {
    grid-template-columns: 1fr;
  }
}
