﻿/* ===== HIV-1 Tropism Predictor — Professional Academic Style ===== */

/* ── Reset & Variables ───────────────────────────── */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --c-bg:           #ffffff;
  --c-bg-alt:       #f8fafc;
  --c-bg-card:      #ffffff;
  --c-border:       #e2e8f0;
  --c-border-light: #f1f5f9;
  --c-text:         #1e293b;
  --c-text-secondary: #475569;
  --c-text-muted:   #94a3b8;
  --c-primary:      #2563eb;
  --c-primary-dark: #1d4ed8;
  --c-primary-hover:#1e40af;
  --c-primary-light:#dbeafe;
  --c-accent:       #0891b2;
  --c-accent-light: #cffafe;
  --c-success:      #059669;
  --c-success-light:#d1fae5;
  --c-warning:      #d97706;
  --c-warning-light:#fef3c7;
  --c-danger:       #dc2626;
  --c-danger-light: #fee2e2;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:      0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:      0 12px 40px rgba(0,0,0,.12);
  --radius:         12px;
  --radius-sm:      8px;
  --radius-xs:      6px;
  --font:           'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:      'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --nav-h:          64px;
  --max-w:          1120px;
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
}

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); scrollbar-gutter: stable; }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--c-text);
  background: linear-gradient(180deg, #f0f5ff 0%, #ffffff 100%);
  background-attachment: fixed;
  /* Safety net: never allow a stray wide element (hero copy, tables) to
     create a horizontal scrollbar on mobile. */
  overflow-x: hidden;
  /* Sticky footer: column flex + footer margin-top:auto pushes the footer
     to the bottom of the viewport even on short pages. */
  min-height: 100vh;
  min-height: 100dvh; /* dynamic viewport height: footer stays pinned on mobile */
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ───────────────────────────────────── */
h1 { font-size: 2.6rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
h2 { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.02em; }
h3 { font-size: 1.25rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; color: var(--c-text); }
h5 { font-size: 0.875rem; font-weight: 600; color: var(--c-text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }

a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-dark); }

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--c-bg-alt);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--c-border);
}

pre {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.55;
  background: #0f172a;
  color: #e2e8f0;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ── Buttons ──────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font); font-size: 0.9rem; font-weight: 600;
  padding: 10px 22px; border-radius: var(--radius-sm); border: 1.5px solid transparent;
  cursor: pointer; transition: all .18s ease; white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn-lg { padding: 14px 30px; font-size: 1rem; border-radius: var(--radius); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-full { width: 100%; }

.btn-primary { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.btn-primary:hover:not(:disabled) { background: var(--c-primary-dark); border-color: var(--c-primary-dark); box-shadow: var(--shadow-md); }

.btn-outline { background: transparent; color: var(--c-primary); border-color: var(--c-border); }
.btn-outline:hover { background: var(--c-primary-light); border-color: var(--c-primary); }

.btn-ghost { background: transparent; color: var(--c-text-secondary); border-color: transparent; }
.btn-ghost:hover { background: var(--c-bg-alt); color: var(--c-text); }

/* ── Navigation ───────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h); background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--c-border);
}
.nav-inner {
  max-width: var(--max-w); margin: 0 auto; height: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 32px;
  gap: 24px;
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1.05rem; color: var(--c-text); text-decoration: none;
  letter-spacing: -0.01em;
  justify-self: start;
  padding: 6px 0;
}
.nav-brand svg {
  color: #fff;
  width: 32px; height: 32px;
  padding: 6px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  border-radius: 9px;
  box-shadow: 0 2px 6px rgba(37,99,235,.28);
  box-sizing: border-box;
  flex-shrink: 0;
}
.nav-links { display: flex; list-style: none; gap: 2px; justify-self: center; }
.nav-links a {
  position: relative;
  padding: 9px 18px; border-radius: var(--radius-xs);
  font-size: 0.875rem; font-weight: 500; color: var(--c-text-secondary);
  text-decoration: none; transition: color .18s;
}
/* Animated underline that grows from center on hover/active */
.nav-links a::after {
  content: '';
  position: absolute; left: 18px; right: 18px; bottom: 4px;
  height: 2px; background: var(--c-primary);
  transform: scaleX(0); transform-origin: center;
  transition: transform .25s ease;
  border-radius: 1px;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--c-primary);
  background: transparent;
}
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--c-text); border-radius: 2px; transition: all .2s; }

/* ── Sections ─────────────────────────────────────── */
section { padding: 80px 0; }
.section-container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.section-header {
  text-align: center; margin-bottom: 48px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.section-header h2 { color: var(--c-text); }
.section-desc { color: var(--c-text-secondary); font-size: 1rem; max-width: 560px; }

/* ── Hero ─────────────────────────────────────────── */
.hero {
  padding: 120px 0 100px;
  background: linear-gradient(180deg, #f0f5ff 0%, #ffffff 100%);
  display: flex; align-items: center; justify-content: center; gap: 60px;
  flex-wrap: wrap;
}
.hero-content { max-width: 560px; padding: 0 24px; }
.hero-badge {
  display: inline-block; font-size: 0.8rem; font-weight: 600; color: var(--c-primary);
  background: var(--c-primary-light); padding: 5px 14px; border-radius: 20px;
  margin-bottom: 20px; letter-spacing: 0.02em;
}
.hero h1 { margin-bottom: 18px; }
.hero-subtitle { font-size: 1.1rem; color: var(--c-text-secondary); margin-bottom: 32px; line-height: 1.7; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 48px; }
.hero-stats { display: flex; gap: 32px; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-value { font-weight: 700; font-size: 0.9rem; color: var(--c-text); font-family: var(--font-mono); }
.stat-label { font-size: 0.75rem; color: var(--c-text-muted); }

.hero-visual { flex-shrink: 0; }
.dna-helix { display: flex; flex-direction: column; gap: 6px; }
.helix-bar {
  width: 200px; height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, var(--c-primary-light), var(--c-primary), var(--c-primary-light));
  opacity: 0.6;
}
.helix-bar:nth-child(odd) { margin-left: 20px; width: 180px; }
.helix-bar:nth-child(even) { margin-left: 0; }

/* ── Workflow / Pipeline ──────────────────────────── */
.workflow { background: var(--c-bg); }
.pipeline {
  display: flex; align-items: flex-start; justify-content: center;
  gap: 0; flex-wrap: wrap;
}
.pipeline-step {
  text-align: center; width: 180px; padding: 24px 12px;
  position: relative;
}
.step-number {
  width: 28px; height: 28px; border-radius: 50%; margin: 0 auto 12px;
  background: var(--c-primary); color: #fff; font-size: 0.8rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.step-icon {
  width: 56px; height: 56px; margin: 0 auto 12px;
  border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center;
  background: var(--c-primary-light); color: var(--c-primary);
}
.pipeline-step h4 { margin-bottom: 6px; font-size: 0.95rem; }
.pipeline-step p { font-size: 0.8rem; color: var(--c-text-secondary); line-height: 1.5; }
.pipeline-arrow {
  display: flex; align-items: center; padding-top: 44px;
  color: var(--c-text-muted); flex-shrink: 0;
}

/* ── Submit ───────────────────────────────────────── */
.submit-section { background: transparent; }
.submit-grid {
  display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start;
}
.submit-panel {
  background: var(--c-bg-card); border-radius: var(--radius);
  border: 1px solid var(--c-border); padding: 28px;
  box-shadow: var(--shadow-sm);
}

/* Tabs */
.panel-tabs { display: flex; gap: 0; margin-bottom: 20px; border-bottom: 2px solid var(--c-border-light); }
.tab {
  padding: 10px 20px; font-size: 0.875rem; font-weight: 600; cursor: pointer;
  background: none; border: none; color: var(--c-text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all .15s;
}
.tab.active { color: var(--c-primary); border-bottom-color: var(--c-primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Dropzone */
.dropzone {
  border: 2px dashed var(--c-border); border-radius: var(--radius-sm);
  padding: 40px 20px; text-align: center; cursor: pointer;
  transition: all .2s;
}
.dropzone:hover, .dropzone.drag-over { border-color: var(--c-primary); background: var(--c-primary-light); }
.dropzone-icon { color: var(--c-text-muted); margin-bottom: 12px; }
.dropzone-text { font-size: 0.95rem; color: var(--c-text-secondary); }
.dropzone-text .link { color: var(--c-primary); font-weight: 600; }
.dropzone-hint { font-size: 0.8rem; color: var(--c-text-muted); margin-top: 6px; }

.file-info { margin-top: 12px; }
.file-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--c-primary-light); color: var(--c-primary);
  padding: 6px 14px; border-radius: 20px; font-size: 0.85rem; font-weight: 500;
}
.file-remove {
  background: none; border: none; font-size: 1.1rem; cursor: pointer;
  color: var(--c-primary); padding: 0 2px;
}

.seq-textarea {
  width: 100%; padding: 14px; border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 0.85rem;
  resize: vertical; background: var(--c-bg-alt); color: var(--c-text);
  transition: border-color .15s;
}
.seq-textarea:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-light); }

/* Validity badge — real-time input hint */
.validity-badge {
  margin-top: 8px; padding: 6px 12px; border-radius: var(--radius-sm);
  font-size: 0.8rem; font-weight: 500; display: flex; align-items: center; gap: 6px;
}
.validity-badge.dn { display: none; }
.validity-accept  { background: var(--c-success-light); color: var(--c-success); }
.validity-reject  { background: var(--c-danger-light);  color: var(--c-danger); }
.validity-suspicious { background: #fef3c7; color: #92400e; }
.vb-icon { font-size: 0.9rem; line-height: 1; }

/* Pre-scan panel (multi-sequence validity) */
.prescan-panel {
  margin-top: 10px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  max-height: 260px;
  overflow-y: auto;
}
.prescan-panel.dn { display: none; }
.prescan-summary {
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border-bottom: 1px solid var(--c-border);
  background: var(--c-bg-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 1;
}
.prescan-summary .ps-count { font-size: 0.75rem; font-weight: 400; }
.prescan-summary .ps-count.valid { color: var(--c-success); }
.prescan-summary .ps-count.reject { color: var(--c-danger); }
.prescan-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  font-size: 0.78rem;
  border-bottom: 1px solid var(--c-border-light, #f0f0f0);
}
.prescan-item:last-child { border-bottom: none; }
.prescan-item .ps-seq-id {
  font-family: var(--font-mono);
  font-weight: 500;
  min-width: 60px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--c-text);
}
.prescan-item .ps-seq-preview {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--c-text-muted);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prescan-item .ps-badge {
  flex-shrink: 0;
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 500;
  white-space: nowrap;
}
.ps-badge.valid    { background: var(--c-success-light); color: var(--c-success); }
.ps-badge.reject   { background: var(--c-danger-light);  color: var(--c-danger); }
.ps-badge.warn     { background: #fef3c7; color: #92400e; }
.prescan-item .ps-reason {
  font-size: 0.68rem;
  color: var(--c-danger);
  flex-shrink: 0;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Results summary banner */
.results-banner {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}
.results-banner.has-rejects {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  color: #92400e;
}
.results-banner .banner-count { font-weight: 700; }

.submit-options { margin: 18px 0; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--c-text-secondary); cursor: pointer; }
.checkbox-label input[type="checkbox"] { accent-color: var(--c-primary); }

.submit-status { margin-top: 14px; padding: 12px 16px; border-radius: var(--radius-sm); font-size: 0.875rem; font-weight: 500; }
.submit-status.success { background: var(--c-success-light); color: var(--c-success); }
.submit-status.error { background: var(--c-danger-light); color: var(--c-danger); }
.submit-status.info { background: var(--c-primary-light); color: var(--c-primary); }
.submit-status.dn { display: none; }

/* Info Panel */
.info-panel {
  background: var(--c-bg-card); border-radius: var(--radius);
  border: 1px solid var(--c-border); padding: 24px;
  box-shadow: var(--shadow-sm);
}
.info-panel h4 { margin-bottom: 14px; }
.info-list {
  list-style: none; padding: 0; margin-bottom: 20px;
}
.info-list li {
  position: relative; padding-left: 20px; margin-bottom: 8px;
  font-size: 0.85rem; color: var(--c-text-secondary); line-height: 1.55;
}
.info-list li::before {
  content: ''; position: absolute; left: 0; top: 7px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--c-primary);
}
.info-example { margin-bottom: 16px; }
.info-example h5 { margin-bottom: 8px; }
.info-example .example-fasta {
  background: #f1f5f9;
  border: 1px solid var(--c-border);
}
.info-example .example-fasta code {
  background: transparent;
  border: none;
  padding: 0;
}
.fasta-label {
  color: #2563eb;
  font-weight: 600;
}
.fasta-seq {
  color: #1e293b;
}
.info-note {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 0.8rem; color: var(--c-text-muted); padding-top: 12px;
  border-top: 1px solid var(--c-border-light);
}
.info-note svg { flex-shrink: 0; margin-top: 2px; }

/* ── Results Table ────────────────────────────────── */
.results-section { background: var(--c-bg); }
.task-table-wrapper {
  background: var(--c-bg-card); border-radius: var(--radius);
  border: 1px solid var(--c-border); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.task-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.task-table th {
  text-align: left; padding: 14px 18px; font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-text-muted);
  background: var(--c-bg-alt); border-bottom: 1px solid var(--c-border);
}
.task-table td { padding: 14px 18px; border-bottom: 1px solid var(--c-border-light); vertical-align: middle; }
.task-table tbody tr:last-child td { border-bottom: none; }
.task-table tbody tr:hover { background: #f8fafc; }
.empty-row td { text-align: center; color: var(--c-text-muted); padding: 48px 18px !important; }

.status-badge {
  display: inline-block; padding: 4px 12px; border-radius: 12px;
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
}
.status-badge.pending { background: var(--c-warning-light); color: var(--c-warning); }
.status-badge.running { background: var(--c-primary-light); color: var(--c-primary); }
.status-badge.completed { background: var(--c-success-light); color: var(--c-success); }
.status-badge.failed { background: var(--c-danger-light); color: var(--c-danger); }

.job-id { font-family: var(--font-mono); font-size: 0.8rem; color: var(--c-text-muted); }

/* ── FAQ ──────────────────────────────────────────── */
.help-section { background: var(--c-bg-alt); }
.faq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
.faq-item {
  background: var(--c-bg-card); border-radius: var(--radius);
  border: 1px solid var(--c-border); padding: 24px;
}
.faq-item h4 { margin-bottom: 10px; }
.faq-item p { font-size: 0.875rem; color: var(--c-text-secondary); line-height: 1.65; }

/* ── About ────────────────────────────────────────── */
.about-section { background: var(--c-bg); }
.about-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.about-card {
  background: var(--c-bg-card); border-radius: var(--radius);
  border: 1px solid var(--c-border); padding: 24px;
}
.about-card h4 { margin-bottom: 12px; }
.about-card p { font-size: 0.875rem; color: var(--c-text-secondary); line-height: 1.65; }
.citation-box { background: var(--c-bg-alt); padding: 16px; border-radius: var(--radius-sm); border: 1px solid var(--c-border-light); }
.citation-text { font-style: italic; margin-top: 8px; color: var(--c-text-secondary); }
.tech-list { list-style: none; padding: 0; }
.tech-list li { font-size: 0.85rem; color: var(--c-text-secondary); padding: 4px 0; }

/* ── Modal ────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15,23,42,.5); backdrop-filter: blur(4px);
  animation: fadeIn .2s ease;
}
.modal-overlay.dn { display: none; }
.modal {
  background: var(--c-bg-card); border-radius: var(--radius);
  width: 92%; max-width: 1100px; max-height: 82vh;
  overflow-y: auto; box-shadow: var(--shadow-lg);
  border: 1px solid var(--c-border);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 28px; border-bottom: 1px solid var(--c-border);
  position: sticky; top: 0; background: var(--c-bg-card); z-index: 1;
}
.modal-close {
  background: none; border: none; font-size: 1.6rem; cursor: pointer;
  color: var(--c-text-muted); padding: 4px 10px; border-radius: var(--radius-xs);
}
.modal-close:hover { background: var(--c-bg-alt); color: var(--c-text); }
.modal-body { padding: 28px; }

/* Result table in modal */
.result-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.result-table th {
  text-align: left; padding: 10px 14px; font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--c-text-muted);
  border-bottom: 1px solid var(--c-border);
}
.result-table td { padding: 12px 14px; border-bottom: 1px solid var(--c-border-light); }
.result-table tbody tr:last-child td { border-bottom: none; }
/* Error-detail meta table: unlike result-table, EVERY row keeps its separator
   (including the last) so all fields read as a uniform list. */
.error-meta-table { width: 100%; max-width: 520px; border-collapse: collapse; font-size: 0.875rem; }
.error-meta-table th {
  text-align: left; width: 130px; padding: 10px 14px;
  color: var(--c-text-muted); font-weight: 500; white-space: nowrap;
  border-bottom: 1px solid var(--c-border-light); vertical-align: top;
}
.error-meta-table td { padding: 10px 14px; border-bottom: 1px solid var(--c-border-light); }
.error-meta-table tbody tr:last-child th,
.error-meta-table tbody tr:last-child td { border-bottom: 1px solid var(--c-border-light); }
/* Task ID inside the meta table: keep the monospace look but match the
   body text color/size so it reads uniformly with the other values. */
.error-meta-table .job-id { color: inherit; font-size: 0.875rem; }
.prob-bar-wrap { display: flex; align-items: center; gap: 8px; }
.prob-bar { height: 8px; border-radius: 4px; min-width: 2px; }
.prob-value { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 0.85rem; }
.tropism-tag {
  display: inline-block; padding: 4px 12px; border-radius: 10px;
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
}
.tropism-tag.R5 { background: var(--c-success-light); color: var(--c-success); }
.tropism-tag.X4 { background: var(--c-primary-light); color: var(--c-primary); }
.tropism-tag.Dual { background: var(--c-warning-light); color: var(--c-warning); }

.band-chip {
  display: inline-block; padding: 3px 10px; border-radius: 8px;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
}
.band-chip.high { background: var(--c-success-light); color: var(--c-success); }
.band-chip.medium { background: var(--c-warning-light); color: var(--c-warning); }
.band-chip.low { background: var(--c-danger-light); color: var(--c-danger); }

/* ── Footer ───────────────────────────────────────── */
.footer { margin-top: auto; background: #0f172a; color: #cbd5e1; padding: 56px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-brand h4 { color: #fff; margin-bottom: 10px; }
.footer-brand p { font-size: 0.85rem; color: #94a3b8; line-height: 1.6; }
.footer-links h5 { color: #fff; margin-bottom: 12px; }
.footer-links a { display: block; font-size: 0.85rem; color: #94a3b8; padding: 4px 0; text-decoration: none; }
.footer-links a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #1e293b; padding-top: 20px; }
.footer-bottom p { font-size: 0.8rem; color: #64748b; }
.footer-beian { margin-top: 8px; }
.footer-beian a { color: #64748b; text-decoration: none; }
.footer-beian a:hover { color: #94a3b8; text-decoration: underline; }

/* ── Animations ───────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 900px) {
  h1 { font-size: 2rem; }
  .submit-grid { grid-template-columns: 1fr; }
  .hero { padding: 100px 0 60px; text-align: center; }
  .hero-content { max-width: 100%; }
  .hero-stats { justify-content: center; }
  .hero-actions { justify-content: center; }
  .hero-visual { display: none; }
  .pipeline { flex-direction: column; align-items: center; }
  .pipeline-arrow { transform: rotate(90deg); padding-top: 0; }
  .pipeline-step { width: 100%; max-width: 320px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}

/* ── Help Page TOC + Content Grid ─────────────────── */
.help-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  align-items: start;
}

@media (max-width: 640px) {
  .nav-links { display: none; position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; background: var(--c-bg-card); border-bottom: 1px solid var(--c-border);
    box-shadow: var(--shadow-md); padding: 8px;
  }
  .nav-links.open { display: flex; }
  .nav-inner { display: flex; align-items: center; padding: 0 14px; gap: 10px; position: relative; }
  /* Hamburger must stay visible on small screens — the auth links can push
     it past the viewport edge, so anchor it absolutely to the right. */
  .nav-toggle { display: flex; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); z-index: 2; }
  .nav-brand { font-size: 0.92rem; gap: 8px; }
  .nav-brand svg { width: 18px; height: 18px; }
  .nav-brand span { max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .auth-nav { justify-self: auto; margin-left: auto; margin-right: 44px; gap: 10px; }
  .faq-grid, .about-grid { grid-template-columns: 1fr; }
  .help-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  /* Hero: make the content column take the full viewport width so children
     (badge, buttons, stats) start at the 24px gutter instead of overflowing
     to the right edge on narrow screens. */
  .hero-content { width: 100%; min-width: 0; }
  .hero-badge {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 20px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .hero-subtitle { word-break: break-word; }
  .hero-stats { gap: 16px; flex-wrap: wrap; justify-content: center; }
  .stat-value { font-size: 0.85rem; }
  h1, h2 { overflow-wrap: break-word; }

  /* ── Task tables → card list on mobile ────────────────
     The 5-7 column task table is unusable at 375px (columns clipped, action
     buttons unreachable). Turn each row into a stacked card; labels come from
     the ::before rule below. */
  .task-table thead { display: none; }
  .task-table, .task-table tbody { display: block; width: 100%; }
  .task-table tbody tr {
    display: block;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 10px;
    background: var(--c-bg-card);
  }
  .task-table tbody tr:hover { background: var(--c-bg-card); }
  .task-table tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: none;
    padding: 6px 0;
  }
  .task-table tbody td::before {
    content: attr(data-label);
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--c-text-muted);
  }
  .task-table tbody td:last-child { justify-content: flex-start; }
  .task-table tbody td:last-child::before { margin-right: auto; }
  /* Collapse the copy button + job id into one compact block */
  .task-table .copy-id-btn { margin-left: 6px; }
  .empty-row td { display: block !important; text-align: center; }
}

/* ═══════════════════════════════════════════════════════
   Shared Components (used by all pages)
   ═══════════════════════════════════════════════════════ */

/* ── Page Container (non-hero pages: tasks, 404) ────── */
.page-container {
  /* width:100% is REQUIRED: inside the flex-column body, `margin: 0 auto`
     on the cross axis makes a flex item shrink to fit-content — short pages
     (e.g. account) would render far narrower than --max-w otherwise. */
  width: 100%;
  max-width: var(--max-w); margin: 0 auto;
  padding: calc(var(--nav-h) + 48px) 24px 80px;
  min-height: calc(100vh - 350px);
}
/* History list pages (tasks, my-tasks) keep the SAME width as every other
   page (--max-w = 1120px) so all pages feel uniform. width:100% +
   align-self:center are required inside the flex-column body for the
   container to actually expand to its max-width (a bare max-width alone
   does not stretch a flex item). */
.page-container-wide { max-width: var(--max-w); width: 100%; align-self: center; }

.page-container .page-header {
  margin-bottom: 32px;
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
}
.page-container .page-header h2 { flex-shrink: 0; }

/* ── Skeleton Loading ──────────────────────────────── */
@keyframes shimmer { 100% { transform: translateX(100%); } }
.skeleton {
  background: var(--c-bg-alt); border-radius: var(--radius-xs);
  position: relative; overflow: hidden;
}
.skeleton::after {
  content: ''; position: absolute; inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent);
  animation: shimmer 1.5s infinite;
}
.skeleton-row { height: 48px; border-radius: 0; }
.skeleton-row:nth-child(even) { background: #f1f5f9; }
.skeleton-table { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--c-border); }

/* ── Toast Notifications ───────────────────────────── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 300;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px; border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 500; pointer-events: auto;
  box-shadow: var(--shadow-lg); animation: slideUp .3s ease;
  max-width: 380px;
}
.toast.success { background: #065f46; color: #fff; }
.toast.error   { background: #991b1b; color: #fff; }
.toast.info    { background: #1e40af; color: #fff; }
.toast.fade-out { animation: fadeOut .25s ease forwards; }
@keyframes fadeOut { to { opacity: 0; transform: translateY(10px); } }

/* ── Back to Top ───────────────────────────────────── */
.back-to-top {
  position: fixed; bottom: 28px; right: 28px; z-index: 150;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--c-primary); color: #fff; border: none;
  cursor: pointer; box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity var(--transition-base), transform var(--transition-base);
}
.back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { background: var(--c-primary-dark); }

/* ── Copy Button ───────────────────────────────────── */
.copy-btn {
  background: none; border: 1px solid var(--c-border);
  padding: 4px 10px; border-radius: var(--radius-xs);
  font-size: 0.75rem; color: var(--c-text-muted); cursor: pointer;
  transition: all var(--transition-fast);
}
.copy-btn:hover { border-color: var(--c-primary); color: var(--c-primary); background: var(--c-primary-light); }
.copy-btn.copied { border-color: var(--c-success); color: var(--c-success); background: var(--c-success-light); }

/* ── 404 Page ──────────────────────────────────────── */
.page-404 { background: linear-gradient(180deg, #f0f5ff 0%, #ffffff 100%); min-height: 100vh; }
.not-found {
  text-align: center; padding: 120px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.not-found-code {
  font-size: 6rem; font-weight: 800;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; line-height: 1;
}
.not-found h1 { font-size: 1.5rem; }
.not-found p { color: var(--c-text-secondary); max-width: 400px; }

/* ── Pagination ────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 20px 0 8px;
}
.pagination button {
  background: var(--c-bg-card); border: 1px solid var(--c-border);
  padding: 6px 14px; border-radius: var(--radius-xs); font-size: 0.8rem;
  font-weight: 500; color: var(--c-text-secondary); cursor: pointer;
  transition: all var(--transition-fast); font-family: var(--font);
}
.pagination button:hover:not(:disabled) { border-color: var(--c-primary); color: var(--c-primary); background: var(--c-primary-light); }
.pagination button.active { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.pagination button:disabled { opacity: .35; cursor: not-allowed; pointer-events: none; }
.page-info { font-size: 0.8rem; color: var(--c-text-muted); margin: 0 8px; }

/* ── Toolbar (search + refresh + actions row) ──────── */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar .search-input {
  flex: 1; min-width: 200px; padding: 8px 14px;
  border: 1.5px solid var(--c-border); border-radius: var(--radius-xs);
  font-size: 0.85rem; font-family: var(--font); color: var(--c-text);
  background: var(--c-bg-card); transition: border-color var(--transition-fast);
}
.toolbar .search-input:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-light); }
.toolbar .auto-refresh-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.8rem; color: var(--c-text-muted); cursor: pointer; white-space: nowrap;
}
.toolbar .auto-refresh-label input { accent-color: var(--c-primary); }

/* ── Summary Cards Row ─────────────────────────────── */
.summary-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px; margin-bottom: 20px;
}
.summary-card {
  background: var(--c-bg-card); border: 1px solid var(--c-border);
  border-radius: var(--radius-sm); padding: 16px 20px;
  text-align: center;
}
.summary-card .count {
  font-size: 2rem; font-weight: 700; color: var(--c-text);
  font-family: var(--font-mono); line-height: 1.1;
}
.summary-card .label {
  font-size: 0.75rem; color: var(--c-text-muted); text-transform: uppercase;
  letter-spacing: 0.05em; margin-top: 4px;
}

/* ── Utility: Hidden ───────────────────────────────── */
.dn { display: none !important; }

/* ── Error Block ───────────────────────────────────── */
.error-block {
  text-align: center; padding: 48px 24px;
  background: var(--c-danger-light); border-radius: var(--radius);
  color: var(--c-danger);
}
.error-block h4 { margin-bottom: 8px; }
.error-block p { font-size: 0.85rem; color: #991b1b; }
.error-block .btn { margin-top: 16px; }

/* ═══════════════════════════════════════════════════════
   Report Sections (Simple & Professional)
   ═══════════════════════════════════════════════════════ */

/* ── Report Toggle Button ─────────────────────────── */
.report-toggle-btn {
  font-size: 0.8rem !important;
  padding: 6px 16px !important;
  transition: all var(--transition-base);
}

/* ── Simple Report Card ───────────────────────────── */
.report-simple {
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin-bottom: 16px;
}

.report-simple-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.report-predicted-plain {
  font-size: 0.95rem;
  color: var(--c-text-secondary);
  margin-bottom: 8px;
}

.report-conclusion {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--c-border-light);
}

/* ── Credibility Card ─────────────────────────────── */
.credibility-card {
  background: var(--c-bg-card);
  border: 1px solid var(--c-border-light);
  border-radius: var(--radius-xs);
  padding: 14px 18px;
}

.credibility-header {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-muted);
  margin-bottom: 6px;
}

.credibility-body {
  font-size: 0.9rem;
  color: var(--c-text-secondary);
  line-height: 1.6;
}

.credibility-recommendation {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--c-border-light);
  font-size: 0.85rem;
  color: var(--c-text);
}

/* ── Probability Bars Row ─────────────────────────── */
.prob-bars-row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 12px 20px;
  margin-bottom: 16px;
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
}

/* ── Professional Report Section ──────────────────── */
.report-professional {
  animation: reportExpand 0.35s ease;
  margin-top: 8px;
}

@keyframes reportExpand {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.prof-section {
  background: var(--c-bg-card);
  border: 2px solid var(--c-primary-light);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.prof-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-primary);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--c-primary-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Metrics Grid ─────────────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.metric-item {
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border-light);
  border-radius: var(--radius-xs);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--c-text-muted);
}

.metric-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--c-text);
}

.metric-value.mono {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.metric-desc {
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--c-text-muted);
  line-height: 1.5;
  margin-top: 2px;
}

/* ── Prediction Results Card ──────────────────────── */
.prof-prediction-card {
  background: linear-gradient(135deg, var(--c-bg-alt) 0%, #ffffff 100%);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 18px;
}

.prof-prediction-header {
  background: var(--c-primary);
  padding: 12px 20px;
}

.prof-prediction-header h5 {
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0;
}

.prof-prediction-body {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.prof-prediction-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.prof-prediction-main .tropism-tag {
  font-size: 0.95rem;
  padding: 8px 20px;
  border-radius: 10px;
}

.prof-prediction-details {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.prof-pred-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.prof-pred-stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--c-text-muted);
}

.prof-pred-stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--c-text);
  font-family: var(--font-mono);
}

.prof-pred-stat-value.mono {
  font-size: 0.9rem;
}

/* ── Confidence Inline Badge ─────────────────────── */
.prof-confidence-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font);
  vertical-align: middle;
  line-height: 1.5;
}

.prof-confidence-badge.review-badge-medium {
  background: var(--c-warning-light);
  color: var(--c-warning);
}

.prof-confidence-badge.review-badge-low {
  background: var(--c-danger-light);
  color: var(--c-danger);
}

/* ── Warning Banner (prominent, sibling of main/details) ── */
.prof-warning-banner {
  font-size: 0.82rem;
  font-weight: 700;
  color: #b91c1c;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border: 1.5px solid #fca5a5;
  padding: 8px 16px;
  border-radius: 10px;
  line-height: 1.5;
  flex-shrink: 0;
}

/* ── Sequence Analysis Text ───────────────────────── */
.prof-analysis {
  background: var(--c-primary-light);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-xs);
  padding: 16px 20px;
  margin-bottom: 18px;
}

.prof-analysis p {
  font-size: 0.875rem;
  color: var(--c-text);
  line-height: 1.75;
}

.prof-analysis p strong {
  color: var(--c-primary);
}

/* ── Professional Sub-sections ────────────────────── */
.prof-subsection {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--c-border-light);
}

.prof-subsection h5 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 8px;
}

.prof-text {
  font-size: 0.85rem;
  color: var(--c-text-secondary);
  line-height: 1.7;
}

/* ── Probability Distribution Grid ────────────────── */
.prob-dist-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.prob-dist-item {
  border-radius: var(--radius-xs);
  padding: 14px 16px;
  text-align: center;
  border: 1px solid var(--c-border-light);
}
.prob-dist-item.r5  { background: var(--c-success-light); border-color: #a7f3d0; }
.prob-dist-item.x4  { background: var(--c-primary-light); border-color: #93c5fd; }
.prob-dist-item.dual { background: var(--c-warning-light); border-color: #fde68a; }

.prob-dist-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--c-text-secondary);
  margin-bottom: 4px;
}

.prob-dist-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--c-text);
}

/* ── Caveats List ─────────────────────────────────── */
.caveats-list {
  list-style: none;
  padding: 0;
}

.caveats-list li {
  position: relative;
  padding: 8px 0 8px 18px;
  font-size: 0.85rem;
  color: var(--c-text-secondary);
  line-height: 1.6;
  border-bottom: 1px solid var(--c-border-light);
}

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

.caveats-list li::before {
  content: '!';
  position: absolute;
  left: 0;
  top: 8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--c-warning-light);
  color: var(--c-warning);
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ── Aligned Sequence ─────────────────────────────── */
.aligned-seq {
  background: #f1f5f9 !important;
  color: var(--c-text) !important;
  font-size: 16px !important;
  padding: 12px 16px !important;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-xs);
  white-space: pre-wrap;
  word-break: break-all;
}

/* ── Sequence Detail Accordion ─────────────────────── */
/* ── Detail Toggle Buttons ──────────────────────── */
.btn-detail-view {
  font-size: 0.75rem;
  padding: 5px 14px;
  white-space: nowrap;
  cursor: pointer;
  background: var(--c-primary);
  color: #fff;
  border: 1.5px solid var(--c-primary);
  border-radius: var(--radius-xs);
  font-weight: 600;
  transition: all var(--transition-fast);
}
.btn-detail-view:hover {
  background: var(--c-primary-dark);
  border-color: var(--c-primary-dark);
  box-shadow: var(--shadow-sm);
}

.btn-detail-hide {
  font-size: 0.75rem;
  padding: 5px 14px;
  white-space: nowrap;
  cursor: pointer;
  background: var(--c-primary);
  color: #fff;
  border: 1.5px solid var(--c-primary);
  border-radius: var(--radius-xs);
  font-weight: 600;
  transition: all var(--transition-fast);
}
.btn-detail-hide:hover {
  background: var(--c-primary-dark);
  border-color: var(--c-primary-dark);
  box-shadow: var(--shadow-sm);
}

.pdf-download-btn {
  font-size: 0.75rem;
  padding: 5px 14px;
  white-space: nowrap;
  cursor: pointer;
  background: var(--c-primary);
  color: #fff;
  border: 1.5px solid var(--c-primary);
  border-radius: var(--radius-xs);
  font-weight: 600;
  transition: all var(--transition-fast);
  font-family: var(--font);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pdf-download-btn:hover {
  background: var(--c-primary-dark);
  border-color: var(--c-primary-dark);
  box-shadow: var(--shadow-sm);
}

.seq-detail-row td {
  padding: 0 !important;
  border-bottom: 2px solid var(--c-primary-light) !important;
  background: #f8fafd;
}

.seq-detail-wrapper {
  padding: 24px;
  animation: reportExpand 0.35s ease;
}

.seq-detail-wrapper .prof-section {
  margin-bottom: 0;
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
}

.seq-detail-wrapper .prof-section-title {
  font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════════════
   Admin Page
   ═══════════════════════════════════════════════════════ */

.admin-body {
  background: linear-gradient(180deg, #f0f5ff 0%, #ffffff 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* Auth screens (login + init) */
.admin-auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #f0f5ff 0%, #ffffff 100%);
}

.admin-auth-card {
  background: var(--c-bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-lg);
  width: 92%;
  max-width: 420px;
  padding: 40px 36px;
}

.admin-auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.admin-auth-header h1 {
  font-size: 1.6rem;
  margin-bottom: 6px;
}

.admin-auth-header p {
  font-size: 0.875rem;
  color: var(--c-text-muted);
}

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

.admin-form label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--c-text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--c-text);
  background: var(--c-bg);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-light);
}

.form-error {
  background: var(--c-danger-light);
  color: var(--c-danger);
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  font-size: 0.85rem;
  margin-bottom: 16px;
  border: 1px solid #fecaca;
}

/* Top bar — removed: admin panel now reuses the site's single main nav
   (see admin.html page-header for the admin actions). */
.admin-username {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-text-secondary);
  padding: 4px 12px;
  background: var(--c-bg-alt);
  border-radius: var(--radius-xs);
  white-space: nowrap;
}

/* Toolbar */
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.admin-toolbar h2 {
  font-size: 1.4rem;
}

.admin-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-count {
  font-size: 0.8rem;
  color: var(--c-text-muted);
  font-weight: 500;
}

.admin-checkbox {
  accent-color: var(--c-primary);
  cursor: pointer;
  width: 16px;
  height: 16px;
}

/* Password modal */
.admin-pwd-modal {
  max-width: 420px;
}

/* Responsive */
@media (max-width: 900px) {
  .admin-auth-card {
    padding: 32px 24px;
  }
}

@media (max-width: 640px) {
  .admin-topbar-inner {
    padding: 0 16px;
  }
  .admin-content {
    padding: 24px 16px 60px;
  }
  .admin-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── Responsive additions ──────────────────────────── */
/* ── Tropism Statistical Summary ──────────────────── */
.tropism-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 18px;
  margin-bottom: 16px;
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--c-text-secondary);
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 12px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}
.stat-chip.r5  { background: var(--c-success-light); color: var(--c-success); }
.stat-chip.x4  { background: var(--c-danger-light);  color: var(--c-danger); }
.stat-chip.dual { background: var(--c-warning-light); color: var(--c-warning); }

/* ── Inline Mini Bar (Table Probability Cells) ────── */
.table-minibar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 90px;
}
.table-minibar-fill {
  height: 8px;
  border-radius: 4px;
  min-width: 2px;
  transition: width 0.3s ease;
}
.table-minibar-fill.r5   { background: var(--c-success); }
.table-minibar-fill.x4   { background: var(--c-danger); }
.table-minibar-fill.dual { background: var(--c-warning); }
.table-minibar-val {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--c-text-secondary);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .tropism-summary { gap: 6px; padding: 8px 12px; }
  .stat-chip { font-size: 0.75rem; padding: 2px 8px; }
  .table-minibar { min-width: 60px; gap: 4px; }
  .table-minibar-val { font-size: 0.7rem; }
}

/* ── Validity Badges ────────────────────────────── */
.validity-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 12px;
  letter-spacing: 0.04em;
}
.validity-tag.rejected {
  background: #fde8e8;
  color: #c53030;
  border: 1px solid #fc8181;
}

.validity-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.validity-dot.valid     { background: #48bb78; }
.validity-dot.suspicious { background: #ecc94b; }

/* ── Rejected Row ───────────────────────────────── */
.row-rejected td {
  background: #fff5f5;
}
.row-rejected td:first-child {
  border-left: 3px solid #c53030;
}

/* ── OOD Rejection Card (Professional Report) ──── */
.prof-ood-card {
  border: 2px solid #c53030;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
}
.prof-ood-header {
  background: #c53030;
  color: #fff;
  padding: 10px 16px;
}
.prof-ood-header h5 {
  margin: 0; font-size: 0.9rem; font-weight: 700;
}
.prof-ood-body {
  padding: 16px;
  background: #fff5f5;
}
.prof-ood-message {
  font-size: 0.9rem;
  color: #742a2a;
  margin-bottom: 12px;
  line-height: 1.6;
}
.ood-signal-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 0;
  font-size: 0.82rem;
}
.ood-signal-label {
  color: var(--c-text-secondary);
  min-width: 120px;
}
.ood-signal-value {
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--c-text-primary);
}
.ood-signal-value.ood-fail {
  color: #c53030;
}
.ood-signal-thr {
  color: var(--c-text-muted);
  font-size: 0.75rem;
}

/* ── Utilities extracted from inline styles (about/help/index/admin/submit/tasks) ──
   Appended at end of file so these win over base rules of equal specificity. */

/* generic spacing */
.mt-8  { margin-top:8px; }
.mt-12 { margin-top:12px; }
.mt-16 { margin-top:16px; }
.mb-8  { margin-bottom:8px; }
.mb-12 { margin-bottom:12px; }
.mb-16 { margin-bottom:16px; }
.mb-20 { margin-bottom:20px; }

/* index */
.cta-center { text-align:center; margin-top:32px; }

/* about */
.about-sec { padding:0; margin-bottom:40px; }
.about-grid-single { grid-template-columns:1fr; }
.about-note-muted { margin-top:16px; font-size:0.85rem; color:var(--c-text-muted); }

/* help / docs shared */
.doc-h3 { margin-bottom:16px; padding-bottom:8px; border-bottom:2px solid var(--c-primary-light); }
.doc-p { color:var(--c-text-secondary); margin-bottom:16px; }
.doc-p-sm { color:var(--c-text-secondary); font-size:0.9rem; margin-bottom:12px; }
.doc-p-muted { color:var(--c-text-muted); font-size:0.85rem; margin-bottom:8px; }
.doc-p-plain { color:var(--c-text-secondary); font-size:0.9rem; }
.doc-h4 { margin-bottom:8px; }
.doc-h4-spaced { margin-bottom:8px; margin-top:20px; }
.doc-ol { color:var(--c-text-secondary); font-size:0.9rem; line-height:1.8; margin-bottom:16px; padding-left:20px; }
.doc-chips { display:flex; gap:12px; flex-wrap:wrap; margin-bottom:20px; }
.help-sec { padding:0; margin-bottom:48px; }
.help-toc-box { background:var(--c-bg-card); border:1px solid var(--c-border); border-radius:var(--radius); padding:20px; }
.help-toc-title { margin-bottom:12px; }
.help-toc-list { list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:4px; }
.help-toc-link { display:block; padding:6px 10px; border-radius:var(--radius-xs); font-size:0.85rem; color:var(--c-text-secondary); text-decoration:none; }
.example-fasta-box { border:1px solid var(--c-border); background:#f1f5f9; }
.faq-grid-col { display:flex; flex-direction:column; gap:16px; }
.tag-lg { font-size:0.85rem; padding:6px 16px; }
.chip-sm { font-size:0.8rem; padding:4px 12px; }

/* submit */
.submit-section-hero { padding-top: calc(var(--nav-h) + 60px); }
.flex-gap-10 { display:flex; gap:10px; }
.flex-inline { display:flex; align-items:center; gap:10px; }

/* tasks */
.section-desc-left { text-align:left; margin-top:4px; }
.task-id-meta { font-size:0.8rem; color:var(--c-text-muted); margin-top:2px; }

/* admin */
.col-w-40 { width:40px; }
.col-w-160 { width:160px; }

/* help — exact equivalents of the last inline styles (margin-bottom:8px variants) */
.doc-p-sm8 { color:var(--c-text-secondary); font-size:0.9rem; margin-bottom:8px; }
.doc-h4-spaced16 { margin-bottom:8px; margin-top:16px; }

/* ═══════════════════════════════════════════════════════
   Auth — nav slot, login / register pages
   (inputs reuse the existing .form-input / .form-error classes)
   ═══════════════════════════════════════════════════════ */
.auth-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-self: end;
}
.auth-link {
  position: relative;
  color: var(--c-text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: color .18s;
}
/* Animated underline, matching the main nav links */
.auth-link::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -5px;
  height: 2px; background: var(--c-primary);
  transform: scaleX(0); transform-origin: center;
  transition: transform .25s ease;
  border-radius: 1px;
}
.auth-link:hover { color: var(--c-primary); }
.auth-link:hover::after { transform: scaleX(1); }
/* Register is a filled button — no underline for it */
.auth-register::after { display: none; }
.auth-register {
  background: var(--c-primary);
  color: #fff;
  padding: 7px 16px;
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(37,99,235,.25);
  transition: transform .15s, box-shadow .15s, background-color .15s;
}
.auth-register:hover {
  background: var(--c-primary-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37,99,235,.32);
}
.auth-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--c-text);
}
.auth-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--c-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
}
.auth-logout-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--c-text-secondary);
  font: inherit;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0;
}
/* Log out uses the danger red for both text and underline on hover */
.auth-logout-btn::after { background: var(--c-danger); }
.auth-logout-btn:hover { color: var(--c-danger); }

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  /* Stretch to fill the space between the fixed nav and the footer so the
     auth card sits exactly in the vertical middle of the visible area
     (the old min-height:60vh left it biased toward the top). */
  flex: 1 0 auto;
  padding: 48px 24px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--c-surface, #fff);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg, 16px);
  padding: 36px;
  box-shadow: var(--shadow-md, 0 6px 24px rgba(15, 23, 42, 0.08));
}
.auth-title { font-size: 1.5rem; margin: 0 0 6px; }
.auth-sub { color: var(--c-text-muted); margin: 0 0 24px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-text-secondary);
}
.field-optional { font-weight: 400; color: var(--c-text-muted); }
.auth-alt {
  margin-top: 18px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--c-text-muted);
}
.auth-alt a { color: var(--c-primary); }


/* ── Task-id copy button (used on tasks / my-tasks / admin / result modal) ── */
.copy-id-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  width: 22px;
  height: 22px;
  margin-left: 6px;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  background: transparent;
  color: var(--c-text-muted);
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.copy-id-btn:hover {
  color: var(--c-primary);
  border-color: var(--c-primary);
  background: var(--c-bg-alt);
}
.modal .task-id-meta .copy-id-btn { margin-left: 8px; }
