/* DMedicine — theme adapted from ClinExonCNV webapp */

:root {
  --dm-primary: #1e40af;
  --dm-primary-dark: #1e3a8a;
  --dm-accent: #0ea5e9;
  --dm-bg: #f1f5f9;
  --dm-surface: #ffffff;
  --dm-text: #0f172a;
  --dm-muted: #64748b;
  --dm-border: #e2e8f0;
  --dm-nav-height: 64px;
  --dm-radius: 12px;
  --dm-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  --dm-shadow-lg: 0 4px 16px rgba(15, 23, 42, 0.1);
  --dm-content-max-width: 70%;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--dm-bg);
  color: var(--dm-text);
  font-family: "Segoe UI", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

.dm-site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ----- Navbar ----- */
.dm-navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--dm-nav-height);
  background: linear-gradient(135deg, var(--dm-primary-dark) 0%, var(--dm-primary) 55%, #2563eb 100%);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.18);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 24px;
}

.dm-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
  flex-shrink: 0;
}

.dm-brand:hover { color: #e0f2fe; text-decoration: none; }

.dm-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.dm-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.dm-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.dm-brand-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.dm-brand-sub {
  font-size: 11px;
  opacity: 0.85;
  font-weight: 400;
}

.dm-nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  flex-wrap: wrap;
}

.dm-nav-link {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.dm-nav-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  text-decoration: none;
}

.dm-nav-link.is-locked {
  opacity: 0.72;
}

.dm-flash-stack {
  max-width: 1100px;
  margin: 16px auto 0;
  padding: 0 16px;
  display: grid;
  gap: 8px;
}

.dm-flash {
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
}

.dm-flash-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.dm-flash-error,
.dm-flash-warning {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fdba74;
}

.dm-flash-info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.dm-plan-pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #e2e8f0;
  color: #334155;
  text-decoration: none;
  line-height: 1.4;
}

.dm-plan-row {
  display: inline-flex !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.dm-plan-pill.dm-plan-standard {
  background: #e0f2fe;
  color: #075985;
}

.dm-plan-pill.dm-plan-premium {
  background: #fef3c7;
  color: #92400e;
}

.dm-plan-pill.dm-plan-admin {
  background: #e2e8f0;
  color: #334155;
}

a.dm-plan-pill.dm-plan-admin:hover {
  background: #cbd5e1;
  color: #0f172a;
  text-decoration: none;
}

.dm-vitality-block {
  display: block !important;
  grid-column: 1 / -1;
  padding-top: 4px;
}

.dm-vitality-block dt {
  margin-bottom: 6px;
}

.dm-vitality-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.dm-vitality-score {
  font-size: 18px;
  font-weight: 800;
  color: #0c4a6e;
  letter-spacing: -0.02em;
}

.dm-vitality-tier {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
}

.dm-vitality-tier-soft {
  background: #fef3c7;
  color: #92400e;
}

.dm-vitality-tier-hard {
  background: #ffedd5;
  color: #9a3412;
}

.dm-vitality-tier-dormant {
  background: #fee2e2;
  color: #991b1b;
}

.dm-vitality-bar {
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin-bottom: 6px;
}

.dm-vitality-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0284c7, #0ea5e9);
}

.dm-vitality-hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: #64748b;
}

.dm-user-upgrade {
  display: block;
  padding: 10px 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #0369a1;
  text-decoration: none;
  border-top: 1px solid var(--dm-border);
}

.dm-user-upgrade:hover {
  background: #f0f9ff;
  color: #0c4a6e;
  text-decoration: none;
}
  color: #fff;
  text-decoration: none;
}

.dm-nav-link.active {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.dm-nav-meta {
  margin-left: auto;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
}

/* ----- Navbar user menu ----- */
.dm-nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.dm-user-menu {
  position: relative;
  flex-shrink: 0;
}

.dm-user-trigger,
.dm-user-login-link,
.dm-nav-repo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  padding: 0;
  text-decoration: none;
}

.dm-user-trigger:hover,
.dm-user-login-link:hover,
.dm-nav-repo-link:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
  text-decoration: none;
}

.dm-user-icon,
.dm-nav-repo-icon {
  width: 22px;
  height: 22px;
}

.dm-user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 280px;
  background: var(--dm-surface);
  border: 1px solid var(--dm-border);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
  color: var(--dm-text);
  z-index: 1100;
  overflow: hidden;
}

.dm-user-menu.is-open .dm-user-dropdown {
  display: block;
}

.dm-user-dropdown-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
  border-bottom: 1px solid var(--dm-border);
}

.dm-user-trigger.has-photo,
.dm-user-trigger.has-photo:hover {
  padding: 0;
  overflow: hidden;
  border-color: rgba(255, 255, 255, 0.35);
}

.dm-user-trigger.is-pending {
  background: rgba(251, 191, 36, 0.22);
  border-color: rgba(251, 191, 36, 0.55);
}

.dm-user-trigger-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dm-user-pending-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-align: center;
  color: #fff;
  padding: 2px;
}

.dm-user-avatar .dm-user-pending-label {
  color: #b45309;
  font-size: 11px;
}

.dm-user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #dbeafe;
  color: var(--dm-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.dm-user-avatar.has-photo {
  background: #e2e8f0;
}

.dm-user-avatar.is-pending {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #f59e0b;
}

.dm-user-avatar svg {
  width: 24px;
  height: 24px;
}

.dm-user-avatar-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dm-user-avatar-edit {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0;
  transition: opacity 0.15s;
}

.dm-user-avatar:hover .dm-user-avatar-edit,
.dm-user-avatar:focus-visible .dm-user-avatar-edit {
  opacity: 1;
}

.dm-user-avatar.is-pending:hover .dm-user-avatar-edit {
  opacity: 1;
}

.dm-user-avatar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.dm-user-avatar-btn {
  border: 1px solid var(--dm-border);
  background: #fff;
  color: var(--dm-text-muted, #64748b);
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.2;
  padding: 3px 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.dm-user-avatar-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: var(--dm-text);
}

.dm-user-avatar-btn.is-muted {
  color: #94a3b8;
}

.dm-user-avatar-btn.is-hidden {
  display: none;
}

.dm-user-avatar-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

/* 覆盖 Bootstrap input[type=file]{display:block}，避免露出原生「选择文件」 */
.dm-avatar-file-input,
#dm-avatar-file {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  display: block !important;
  opacity: 0 !important;
  pointer-events: none;
}

.dm-user-avatar-status {
  font-size: 11px;
  color: var(--dm-text-muted, #64748b);
}

.dm-user-avatar-status.is-error {
  color: #dc2626;
}

/* 头像裁剪弹层 */
body.dm-avatar-crop-open {
  overflow: hidden;
}

.dm-avatar-crop-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.dm-avatar-crop-modal[hidden] {
  display: none !important;
}

.dm-avatar-crop-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.dm-avatar-crop-panel {
  position: relative;
  width: min(100%, 360px);
  background: var(--dm-surface, #fff);
  border: 1px solid var(--dm-border, #e2e8f0);
  border-radius: 14px;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.22);
  padding: 16px;
}

.dm-avatar-crop-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: var(--dm-text, #0f172a);
}

.dm-avatar-crop-hint {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--dm-text-muted, #64748b);
}

.dm-avatar-crop-viewport {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto 10px;
  overflow: hidden;
  border-radius: 12px;
  background: #0f172a;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.dm-avatar-crop-viewport:active {
  cursor: grabbing;
}

.dm-avatar-crop-viewport img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  max-height: none;
  pointer-events: none;
}

.dm-avatar-crop-frame {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.45);
  border-radius: 12px;
  pointer-events: none;
}

.dm-avatar-crop-zoom-label {
  display: block;
  font-size: 12px;
  color: var(--dm-text-muted, #64748b);
  margin-bottom: 4px;
}

.dm-avatar-crop-zoom {
  width: 100%;
  margin-bottom: 12px;
}

.dm-avatar-crop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.dm-user-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--dm-text);
}

.dm-user-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dm-gitee-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: #c71d23;
  border-radius: 6px;
  transition: background 0.15s, transform 0.1s;
  flex-shrink: 0;
}

.dm-gitee-link:hover {
  background: rgba(199, 29, 35, 0.1);
  transform: translateY(-1px);
}

.dm-gitee-link svg {
  width: 18px;
  height: 18px;
}

.dm-user-sub {
  font-size: 12px;
  color: var(--dm-muted);
  margin-top: 2px;
}

.dm-user-info {
  margin: 0;
  padding: 12px 16px;
  display: grid;
  gap: 8px;
}

.dm-user-info div {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 8px;
  font-size: 13px;
}

.dm-user-info dt {
  margin: 0;
  color: var(--dm-muted);
  font-weight: 500;
}

.dm-user-info dd {
  margin: 0;
  color: var(--dm-text);
  word-break: break-all;
}

.dm-user-logout {
  display: block;
  padding: 12px 16px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #b91c1c !important;
  background: #fef2f2;
  border-top: 1px solid #fecaca;
  text-decoration: none;
  transition: background 0.15s;
}

.dm-user-logout:hover {
  background: #fee2e2;
  text-decoration: none;
  color: #991b1b !important;
}

/* ----- Main layout ----- */
.dm-main {
  flex: 1;
  max-width: var(--dm-content-max-width);
  width: 100%;
  margin: 0 auto;
  padding: 20px 20px 36px;
}

/* 全站内容区与「生信工具」页同宽，覆盖 Bootstrap .container 固定宽度 */
.dm-main .container,
.dm-main .container-fluid {
  width: 100% !important;
  max-width: 100% !important;
  padding-left: 0;
  padding-right: 0;
  margin-left: 0;
  margin-right: 0;
}

.dm-page-title {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.4px;
  color: var(--dm-text);
}

.dm-page-lead {
  color: var(--dm-muted);
  font-size: 14px;
  margin: 0 0 24px;
  line-height: 1.6;
}

.dm-card {
  background: var(--dm-surface);
  border: 1px solid var(--dm-border);
  border-radius: var(--dm-radius);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--dm-shadow);
}

.dm-card h2, .dm-card h3 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
}

.dm-card h2 { font-size: 18px; }

/* ----- Hero ----- */
.dm-hero {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 50%, #f0f9ff 100%);
  border: 1px solid #bfdbfe;
  border-radius: var(--dm-radius);
  padding: 40px 32px;
  margin-bottom: 24px;
  text-align: center;
}

.dm-hero h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--dm-primary-dark);
  margin: 0 0 12px;
}

.dm-hero .lead {
  font-size: 16px;
  color: var(--dm-muted);
  margin-bottom: 20px;
}

/* ----- Home / About page ----- */
.dm-home {
  display: grid;
  gap: 16px;
}

.dm-home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  background:
    linear-gradient(
      105deg,
      rgba(15, 23, 42, 0.9) 0%,
      rgba(15, 23, 42, 0.72) 36%,
      rgba(30, 58, 138, 0.48) 58%,
      rgba(37, 99, 235, 0.28) 100%
    ),
    url("/static/images/DNA_back.jpg") center / cover no-repeat;
  border: none;
  border-radius: var(--dm-radius);
  padding: 22px 24px;
  color: #fff;
  box-shadow: 0 8px 24px rgba(30, 58, 138, 0.25);
  overflow: hidden;
  position: relative;
}

.dm-home-hero > div {
  position: relative;
  z-index: 1;
}

.dm-home-hero-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.dm-home-hero h1 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}

.dm-home-hero .lead {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.9);
}

.dm-home-hero-about {
  align-items: center;
  min-height: 220px;
}

.dm-home-hero-about-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.dm-home-hero-about h1 {
  font-size: 36px;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.dm-home-hero-about .lead {
  margin-bottom: 0;
  font-size: 15px;
  max-width: 520px;
}

.dm-home-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: max-content;
  max-width: 100%;
  margin-top: auto;
  padding-top: 14px;
}

.dm-home-actions .dm-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  white-space: nowrap;
}

.dm-home-quick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-content: stretch;
  height: 100%;
}

.dm-home-quick a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 72px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}

.dm-home-quick a:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
  text-decoration: none;
}

.dm-home-quick strong {
  font-size: 15px;
  color: #fff;
  margin-bottom: 4px;
}

.dm-home-quick span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.45;
}

.dm-home-body {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.dm-home-body .dm-card {
  margin-bottom: 0;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.dm-home-body .dm-card h2 {
  margin-bottom: 10px;
  font-size: 16px;
  flex-shrink: 0;
}

.dm-home-body .dm-home-intro {
  overflow: hidden;
  border: 1px solid var(--dm-border, #e2e8f0);
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  box-shadow: none;
}

.dm-home-body .dm-home-intro h2,
.dm-home-body .dm-home-intro .dm-home-intro-title {
  position: relative;
  margin-bottom: 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1e3a8a;
  line-height: 1.35;
  flex-shrink: 0;
}

.dm-home-intro-title-base,
.dm-home-intro-title-scan {
  display: block;
}

.dm-home-intro-title-scan {
  position: absolute;
  inset: 0;
  color: #38bdf8;
  animation: dm-home-genome-scan 5.2s linear infinite;
  pointer-events: none;
}

.dm-home-intro-scroll {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 10%, #000 90%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 10%, #000 90%, transparent 100%);
}

.dm-home-intro-sizer {
  margin: 0;
  visibility: hidden;
  pointer-events: none;
  font-size: 13px;
  line-height: 1.7;
  columns: 2;
  column-gap: 22px;
}

.dm-home-intro-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  animation: dm-home-intro-marquee 48s linear infinite;
  will-change: transform;
}

.dm-home-intro-scroll:hover .dm-home-intro-track {
  animation-play-state: paused;
}

.dm-home-intro-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: #475569;
  columns: 2;
  column-gap: 22px;
}

@keyframes dm-home-intro-marquee {
  0% { transform: translateY(0); }
  100% { transform: translateY(calc(-50% - 14px)); }
}

@media (prefers-reduced-motion: reduce) {
  .dm-home-intro-track {
    animation: none;
    position: static;
  }

  .dm-home-intro-sizer {
    display: none;
  }

  .dm-home-intro-scroll {
    overflow-y: auto;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .dm-home-intro-track .dm-home-intro-text[aria-hidden="true"] {
    display: none;
  }
}

/* 高度跟随左侧简介模块；SVG 绝对填满 */
.dm-home-body .dm-home-platforms {
  position: relative;
  display: block;
  padding: 0 !important;
  overflow: hidden;
  min-height: 0;
  border: 1px solid var(--dm-border, #e2e8f0);
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  box-shadow: none;
}

.dm-home-body .dm-home-genome-anim {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  min-height: 0;
  max-width: none;
}

.dm-home-genome-read {
  animation: dm-home-genome-slide 5.2s ease-in-out infinite;
}

.dm-home-genome-read.is-1 { animation-delay: 0s; }
.dm-home-genome-read.is-2 { animation-delay: 0.22s; }
.dm-home-genome-read.is-3 { animation-delay: 0.44s; }
.dm-home-genome-read.is-4 { animation-delay: 0.66s; }
.dm-home-genome-read.is-5 { animation-delay: 0.88s; }
.dm-home-genome-read.is-6 { animation-delay: 1.1s; }
.dm-home-genome-read.is-7 { animation-delay: 1.32s; }
.dm-home-genome-read.is-8 { animation-delay: 1.54s; }
.dm-home-genome-read.is-9 { animation-delay: 1.76s; }

.dm-home-genome-snv {
  transform-origin: 143px 71.5px;
  animation: dm-home-genome-pulse 2.4s ease-in-out infinite;
}

.dm-home-genome-link {
  animation: dm-home-genome-link 2.4s ease-in-out infinite;
}

.dm-home-genome-tag {
  opacity: 0;
  animation: dm-home-genome-fade 5.2s ease-in-out infinite;
}

.dm-home-genome-tag.is-1 { animation-delay: 1s; }
.dm-home-genome-tag.is-2 { animation-delay: 1.4s; }
.dm-home-genome-tag.is-3 { animation-delay: 1.8s; }
.dm-home-genome-tag.is-4 { animation-delay: 2.2s; }
.dm-home-genome-tag.is-5 { animation-delay: 2.6s; }
.dm-home-genome-tag.is-c1 { animation-delay: 0.7s; }
.dm-home-genome-tag.is-c2 { animation-delay: 0.95s; }
.dm-home-genome-tag.is-c3 { animation-delay: 1.2s; }
.dm-home-genome-tag.is-c4 { animation-delay: 1.45s; }

.dm-home-genome-helix {
  animation: dm-home-genome-float 5s ease-in-out infinite;
}

.dm-home-genome-igv-badge {
  animation: dm-home-genome-igv 3.6s ease-in-out infinite;
}

.dm-home-genome-scan {
  opacity: 0;
  animation: dm-home-genome-scan 5.2s linear infinite;
}

@keyframes dm-home-genome-slide {
  0% { transform: translateX(0); opacity: 0.15; }
  14% { opacity: 1; }
  58% { transform: translateX(200px); opacity: 1; }
  86%, 100% { transform: translateX(238px); opacity: 0.1; }
}

@keyframes dm-home-genome-pulse {
  0%, 100% { transform: scale(1); opacity: 0.92; }
  50% { transform: scale(1.08); opacity: 1; }
}

@keyframes dm-home-genome-link {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

@keyframes dm-home-genome-fade {
  0%, 12% { opacity: 0; }
  26%, 84% { opacity: 1; }
  100% { opacity: 0.25; }
}

@keyframes dm-home-genome-scan {
  0% { clip-path: inset(0 100% 0 0); opacity: 0.9; }
  35% { clip-path: inset(0 0 0 0); opacity: 0.55; }
  55%, 100% { clip-path: inset(0 0 0 100%); opacity: 0; }
}

@keyframes dm-home-genome-float {
  0%, 100% { transform: translate(304px, 16px); }
  50% { transform: translate(304px, 13px); }
}

@keyframes dm-home-genome-igv {
  0%, 100% { opacity: 0.88; }
  50% { opacity: 1; }
}

.dm-home-address.dm-card {
  grid-column: 1 / -1;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  align-items: stretch;
  overflow: hidden;
}

.dm-home-address-text {
  padding: 18px 28px 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.dm-home-address-text h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.dm-home-address-text p {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--dm-muted);
  line-height: 1.6;
  text-align: left;
}

.dm-home-address-text p:last-child {
  margin-bottom: 0;
}

.dm-home-address-media {
  padding: 18px 20px 18px 28px;
  border-left: 1px solid var(--dm-border);
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-height: 200px;
}

.dm-home-map {
  width: 100%;
  height: 100%;
  min-height: 200px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  z-index: 1;
}

.dm-home-map .leaflet-control-attribution {
  font-size: 10px;
}

.dm-home-map-fallback {
  display: none;
  width: 100%;
  min-height: 200px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  align-content: stretch;
}

.dm-home-map-fallback.is-visible {
  display: grid;
}

.dm-home-map-fallback figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}

.dm-home-map-fallback img {
  width: 100%;
  flex: 1;
  min-height: 120px;
  max-height: 170px;
  object-fit: cover;
  border-radius: 8px;
  background: #e2e8f0;
}

.dm-home-map-fallback figcaption {
  font-size: 12px;
  font-weight: 600;
  color: var(--dm-primary);
  text-align: center;
}

.dm-home-map.is-hidden {
  display: none;
}

@media (max-width: 960px) {
  .dm-home-hero,
  .dm-home-body {
    grid-template-columns: 1fr;
  }

  .dm-home-platforms {
    aspect-ratio: 360 / 200;
    min-height: 160px;
  }

  .dm-home-address.dm-card {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .dm-home-address-media {
    border-left: none;
    border-top: 1px solid var(--dm-border);
    padding: 18px 20px;
  }

  .dm-home-address-text {
    padding: 18px 20px;
  }

  .dm-home-intro-sizer,
  .dm-home-intro-text {
    columns: 1;
  }
}

@media (max-width: 520px) {
  .dm-home-hero { padding: 18px 16px; }
  .dm-home-quick { grid-template-columns: 1fr; }
  .dm-home-actions {
    width: 100%;
    grid-template-columns: 1fr;
  }
  .dm-home-hero-about h1 { font-size: 28px; }
}

/* ----- Stats ----- */
.dm-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.dm-stat {
  background: var(--dm-bg);
  border-radius: 10px;
  padding: 16px;
  border: 1px solid var(--dm-border);
}

.dm-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--dm-primary);
}

.dm-stat-label {
  font-size: 12px;
  color: var(--dm-muted);
  margin-top: 4px;
}

/* ----- Buttons ----- */
.dm-btn {
  display: inline-block;
  padding: 10px 18px;
  background: var(--dm-primary);
  color: #fff !important;
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.dm-btn:hover {
  background: var(--dm-primary-dark);
  color: #fff !important;
  text-decoration: none;
  transform: translateY(-1px);
}

.dm-btn-secondary {
  background: var(--dm-surface);
  color: var(--dm-primary) !important;
  border: 1px solid var(--dm-border);
}

.dm-btn-secondary:hover {
  background: var(--dm-bg);
}

.dm-btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}

.dm-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 12px;
}

.dm-section-head .dm-section-title {
  margin: 0;
  border: none;
  padding: 0;
}

.dm-btn-lg {
  padding: 12px 24px;
  font-size: 15px;
}

.dm-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

/* ----- Forms ----- */
.dm-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.dm-form-grid.is-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 768px) {
  .dm-form-grid.is-cols-3 {
    grid-template-columns: 1fr;
  }
}

.dm-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dm-form-field label {
  font-size: 13px;
  font-weight: 600;
}

.dm-form-field .form-control,
.dm-text-input {
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--dm-border);
  border-radius: 8px;
  font-size: 13px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.dm-form-field textarea.form-control {
  height: auto;
  min-height: 80px;
  padding: 10px 12px;
}

.dm-form-field .form-control:focus,
.dm-text-input:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.dm-alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}

.dm-alert-danger {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
}

.dm-alert-info {
  background: #eff6ff;
  border: 1px solid #93c5fd;
  color: #1d4ed8;
}

.dm-alert-warning {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #b45309;
}

/* ----- Tool cards (bioinformatics) ----- */
.dm-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.dm-tool-card {
  background: var(--dm-surface);
  border: 1px solid var(--dm-border);
  border-radius: var(--dm-radius);
  padding: 0;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
  box-shadow: var(--dm-shadow);
}

.dm-tool-card:hover {
  box-shadow: var(--dm-shadow-lg);
  transform: translateY(-3px);
  border-color: #93c5fd;
}

.dm-tool-card a {
  display: block;
  padding: 22px 20px;
  text-decoration: none;
  color: inherit;
}

.dm-tool-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--dm-primary-dark);
}

.dm-tool-card p {
  margin: 0;
  font-size: 13px;
  color: var(--dm-muted);
  line-height: 1.5;
}

.dm-tool-icon {
  font-size: 28px;
  color: var(--dm-primary);
  margin-bottom: 10px;
  display: block;
}

.dm-category-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dm-muted);
  margin: 28px 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--dm-border);
}

.dm-category-title:first-child { margin-top: 0; }

/* ----- Tables ----- */
.dm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.dm-table th,
.dm-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--dm-border);
}

.dm-table th {
  font-weight: 600;
  color: var(--dm-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #f8fafc;
}

.dm-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--dm-border);
  border-radius: 8px;
}

/* ----- Footer ----- */
.dm-footer {
  text-align: center;
  padding: 16px 24px;
  font-size: 12px;
  color: var(--dm-muted);
  border-top: 1px solid var(--dm-border);
  background: var(--dm-surface);
}

.dm-footer a { color: var(--dm-primary); }

.dm-icp {
  text-align: center;
  padding: 8px;
  font-size: 12px;
  color: var(--dm-muted);
  background: var(--dm-bg);
}

/* ----- Auth pages ----- */
.dm-auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 15% 20%, rgba(14, 165, 233, 0.22), transparent 42%),
    radial-gradient(circle at 85% 80%, rgba(99, 102, 241, 0.18), transparent 40%),
    linear-gradient(135deg, #0f172a 0%, var(--dm-primary-dark) 38%, var(--dm-primary) 72%, #2563eb 100%);
  padding: 24px 16px 56px;
}

.dm-auth-shell {
  width: 100%;
  max-width: 960px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(8px);
}

.dm-auth-brand {
  padding: 40px 36px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.dm-auth-brand-mark {
  width: 120px;
  height: 120px;
  border-radius: 28px;
  margin: 0 auto 28px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.5px;
}

.dm-auth-brand-mark img {
  width: 96px;
  height: 96px;
  object-fit: contain;
}

.dm-auth-brand h2 {
  margin: 0 0 10px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.4px;
}

.dm-auth-brand p {
  margin: 0 0 24px;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.82);
}

.dm-auth-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.dm-auth-features li {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
}

.dm-auth-features li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7dd3fc;
  box-shadow: 0 0 0 4px rgba(125, 211, 252, 0.18);
  flex-shrink: 0;
}

.dm-auth-card {
  width: 100%;
  background: var(--dm-surface);
  padding: 36px 32px 32px;
}

.dm-auth-card--wide {
  max-width: none;
}

.dm-auth-card-head {
  margin-bottom: 24px;
}

.dm-auth-card-head h1 {
  font-size: 24px;
  font-weight: 700;
  text-align: left;
  margin: 0 0 6px;
  color: var(--dm-text);
  letter-spacing: -0.3px;
}

.dm-auth-card-head p {
  margin: 0;
  font-size: 13px;
  color: var(--dm-muted);
  line-height: 1.6;
}

.dm-auth-field {
  margin-bottom: 16px;
}

.dm-auth-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--dm-text);
  margin-bottom: 6px;
}

.dm-auth-card .form-control,
.dm-auth-card input[type="text"],
.dm-auth-card input[type="email"],
.dm-auth-card input[type="password"],
.dm-auth-card select {
  width: 100%;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--dm-border);
  padding: 0 14px;
  font-size: 14px;
  color: var(--dm-text);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.dm-auth-card .form-control:focus,
.dm-auth-card input:focus,
.dm-auth-card select:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.dm-auth-card select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.captcha-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.captcha-row .form-control {
  margin-bottom: 0;
  flex: 1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.captcha-row img {
  height: 44px;
  min-width: 110px;
  border-radius: 10px;
  border: 1px solid var(--dm-border);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
  background: #f8fafc;
}

.captcha-row img:hover {
  border-color: #93c5fd;
  transform: scale(1.02);
}

.captcha-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--dm-muted);
}

.dm-auth-error {
  color: #b91c1c;
  font-size: 13px;
  display: block;
  margin: 6px 0 0;
}

.dm-auth-alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.dm-auth-alert--success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.dm-auth-link-sep {
  margin: 0 8px;
  color: #cbd5e1;
}

.dm-auth-submit {
  width: 100%;
  margin-top: 8px;
  height: 44px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
}

.dm-auth-link {
  text-align: center;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--dm-border);
  font-size: 13px;
  color: var(--dm-muted);
}

.dm-auth-link a {
  color: var(--dm-primary);
  font-weight: 600;
  text-decoration: none;
}

.dm-auth-link a:hover {
  text-decoration: underline;
}

.dm-auth-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: 10px 16px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(15, 23, 42, 0.28);
}

/* Register layout */
.dm-reg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}

.dm-reg-grid .full {
  grid-column: 1 / -1;
}

.dm-reg-section {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dm-primary);
  margin: 4px 0 -2px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--dm-border);
}

.dm-reg-grid .dm-auth-field {
  margin-bottom: 0;
}

.dm-auth-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--dm-muted);
  line-height: 1.5;
  cursor: pointer;
}

.dm-auth-checkbox input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--dm-primary);
  flex-shrink: 0;
}

/* Register: wider shell (~60% viewport) */
@media (min-width: 861px) {
  .dm-auth-page--register .dm-auth-shell {
    width: 60%;
    max-width: 72rem;
  }
}

@media (max-width: 860px) {
  .dm-auth-shell {
    grid-template-columns: 1fr;
    max-width: 520px;
    width: 100%;
  }

  .dm-auth-page--register .dm-auth-shell {
    max-width: 520px;
    width: 100%;
  }

  .dm-auth-brand-mark {
    width: 96px;
    height: 96px;
    border-radius: 22px;
    margin-bottom: 20px;
  }

  .dm-auth-brand-mark img {
    width: 76px;
    height: 76px;
  }

  .dm-auth-brand {
    padding: 28px 24px 24px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .dm-auth-brand h2 {
    font-size: 22px;
  }

  .dm-auth-features {
    display: none;
  }

  .dm-auth-card {
    padding: 28px 24px 24px;
  }
}

@media (max-width: 520px) {
  .dm-reg-grid {
    grid-template-columns: 1fr;
  }

  .dm-auth-page {
    padding: 16px 12px 52px;
  }
}

/* ----- IGV ----- */
.dm-igv-container {
  width: 100%;
  min-height: 520px;
  border: 1px solid var(--dm-border);
  border-radius: 10px;
  background: #fff;
}

/* ----- Legacy bootstrap overrides inside themed pages ----- */
.dm-main .masthead { display: none; }

.dm-main .page-title h2 {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 8px;
}

.dm-main .page-title p {
  color: var(--dm-muted);
  margin: 0 0 24px;
}

.dm-main .footer { display: none; }

.dm-hero-image {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: var(--dm-radius);
  margin-bottom: 24px;
  opacity: 0.92;
}

@media (max-width: 768px) {
  .dm-navbar {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 16px;
    gap: 12px;
  }
  .dm-nav-menu { order: 3; width: 100%; }
  .dm-nav-meta { display: none; }

  .dm-user-dropdown {
    right: 0;
    left: auto;
    width: min(280px, calc(100vw - 24px));
  }
  .dm-main { padding: 20px 16px 32px; }
}

/* ----- Section titles (CNV results, data blocks) ----- */
.dm-section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--dm-primary-dark);
  margin: 28px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #bfdbfe;
}

.dm-section-title:first-child { margin-top: 0; }

/* ----- Scrollable data tables ----- */
.dm-table-scroll,
.mytable {
  max-height: 400px;
  overflow: auto;
  border: 1px solid var(--dm-border);
  border-radius: 10px;
  background: var(--dm-surface);
  margin-bottom: 20px;
  box-shadow: var(--dm-shadow);
}

.dm-table-scroll table,
.mytable table {
  margin-bottom: 0;
  font-size: 13px;
}

.dm-table-scroll thead th,
.mytable thead th,
.dm-main .table thead tr th {
  background: #eff6ff !important;
  color: var(--dm-primary-dark) !important;
  font-weight: 600;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 1;
  border-color: var(--dm-border) !important;
  font-size: 12px;
}

.dm-table-scroll td,
.mytable td {
  text-align: center;
  vertical-align: middle;
}

/* ----- Result display ----- */
.dm-result-box {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 16px 20px;
  font-family: ui-monospace, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.8;
  word-break: break-all;
  color: var(--dm-text);
}

.dm-result-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--dm-primary-dark);
  margin-bottom: 12px;
}

.dm-query-badge {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.dm-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: var(--dm-primary-dark);
}

/* ----- File upload ----- */
.dm-file-field {
  margin: 12px 0;
  font-size: 13px;
  color: var(--dm-muted);
}

.dm-file-field input[type="file"] {
  margin-top: 6px;
  font-size: 13px;
}

/* ----- Image result ----- */
.dm-image-result {
  border: 1px solid var(--dm-border);
  border-radius: 10px;
  padding: 16px;
  background: var(--dm-surface);
  margin-bottom: 20px;
}

.dm-image-result img {
  max-width: 100%;
  border-radius: 6px;
}

.dm-zoom-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.dm-zoom-controls button {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--dm-border);
  background: var(--dm-surface);
  cursor: pointer;
}

/* ----- Legacy button overrides ----- */
.dm-main .btn-success,
.dm-main .mybutton {
  background: var(--dm-primary) !important;
  border-color: var(--dm-primary) !important;
  border-radius: 8px !important;
  font-weight: 500;
}

.dm-main .btn-success:hover,
.dm-main .mybutton:hover {
  background: var(--dm-primary-dark) !important;
  border-color: var(--dm-primary-dark) !important;
}

.dm-main .btn-success.btn-sm {
  pointer-events: none;
  opacity: 0.95;
}

/* ----- ACMG calculator (see acmg-calculator.css for full styles) ----- */
.dm-main .acmg-page {
  width: 100%;
  max-width: 100%;
}

/* ----- CNV result page ----- */
.dm-result-actions {
  margin: 32px 0 16px;
}

.dm-result-actions .dm-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 14px;
  font-size: 16px;
}

/* hide legacy per-page footers */
footer.footer,
.footer-container { display: none !important; }

/* bootstrap form polish inside theme */
.dm-main .form-control {
  border-radius: 8px;
  border-color: var(--dm-border);
  box-shadow: none;
}

.dm-main .form-control:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.dm-main .table-hover > tbody > tr:hover {
  background-color: #f8fafc;
}

.dm-main .table-bordered {
  border-color: var(--dm-border);
}

.dm-main .help-block {
  font-size: 12px;
  color: var(--dm-muted);
  margin-top: 4px;
}

/* ----- CNV query page ----- */
.cnv-hero {
  background:
    linear-gradient(
      105deg,
      rgba(15, 23, 42, 0.9) 0%,
      rgba(15, 23, 42, 0.72) 36%,
      rgba(30, 58, 138, 0.48) 58%,
      rgba(37, 99, 235, 0.28) 100%
    ),
    url("/static/images/DNA_back.jpg") center / cover no-repeat;
  border-radius: var(--dm-radius);
  padding: 28px 32px;
  margin-bottom: 28px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: 0 8px 24px rgba(30, 58, 138, 0.25);
  overflow: hidden;
  position: relative;
}

.cnv-hero-text {
  position: relative;
  z-index: 1;
}

.cnv-hero-text h1 {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.3px;
}

.cnv-hero-text p {
  margin: 0;
  font-size: 14px;
  opacity: 0.9;
  line-height: 1.6;
  max-width: 520px;
}

.cnv-hero-badge {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  padding: 16px 20px;
  text-align: center;
  min-width: 120px;
  position: relative;
  z-index: 1;
}

.cnv-hero-badge .num {
  display: block;
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
}

.cnv-hero-badge .lbl {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 4px;
}

.cnv-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 28px;
  align-items: start;
}

.cnv-visual {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.cnv-visual-card {
  position: relative;
  border-radius: var(--dm-radius);
  overflow: hidden;
  background: linear-gradient(160deg, #0f172a 0%, #1e3a8a 60%, #1e40af 100%);
  border: 1px solid #1e40af;
  box-shadow: var(--dm-shadow-lg);
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.cnv-visual-card img {
  width: 100%;
  /* 避免图片固有高度撑开整列；由父级剩余高度分配 */
  height: 0;
  flex: 1 1 auto;
  min-height: 180px;
  object-fit: cover;
  opacity: 0.55;
  display: block;
}

.cnv-visual-body {
  padding: 20px;
  color: #fff;
  flex-shrink: 0;
}

.cnv-visual-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: 10px;
}

.cnv-visual-body h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 14px;
}

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

.cnv-db-chip {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.92);
}

.cnv-example-box {
  background: var(--dm-surface);
  border: 1px solid var(--dm-border);
  border-radius: var(--dm-radius);
  padding: 16px 18px;
  box-shadow: var(--dm-shadow);
  flex-shrink: 0;
}

.cnv-example-box .label {
  font-size: 12px;
  font-weight: 600;
  color: var(--dm-muted);
  display: block;
  margin-bottom: 8px;
}

.cnv-example-box code,
.cnv-example-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font-family: ui-monospace, "Courier New", monospace;
  font-size: 14px;
  color: var(--dm-primary-dark);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 10px;
}

.cnv-example-input:focus {
  outline: none;
  border-color: var(--dm-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  background: #fff;
}

.cnv-example-hint {
  margin-top: 8px;
  font-size: 12px;
  color: #b91c1c;
}

.cnv-use-example {
  font-size: 12px;
  color: var(--dm-primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cnv-use-example:hover { color: var(--dm-primary-dark); }

.cnv-form-card {
  background: var(--dm-surface);
  border: 1px solid var(--dm-border);
  border-radius: var(--dm-radius);
  box-shadow: var(--dm-shadow-lg);
  overflow: hidden;
  height: auto;
  align-self: start;
  /* CNV / SNV 右列同高：以 CNV 典型内容高度为下限 */
  min-height: 620px;
  display: flex;
  flex-direction: column;
}

.cnv-form-header {
  padding: 20px 28px;
  border-bottom: 1px solid var(--dm-border);
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.cnv-form-header h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--dm-text);
}

.cnv-form-header p {
  margin: 0;
  font-size: 13px;
  color: var(--dm-muted);
}

.cnv-form-body {
  padding: 28px;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cnv-field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--dm-text);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cnv-field-label .glyphicon {
  color: var(--dm-primary);
  font-size: 14px;
}

.cnv-region-builder {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: #f8fafc;
  border: 1px solid var(--dm-border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 8px;
}

.cnv-region-part {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cnv-region-part label {
  font-size: 11px;
  font-weight: 600;
  color: var(--dm-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 12px 4px;
  background: #f1f5f9;
  border-bottom: 1px solid var(--dm-border);
}

.cnv-region-part input {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  height: 44px !important;
  background: #fff !important;
  font-size: 15px !important;
  font-weight: 500;
}

.cnv-region-part input:focus {
  background: #eff6ff !important;
}

.cnv-region-sep {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  flex-shrink: 0;
  background: #e2e8f0;
  color: var(--dm-muted);
  font-weight: 700;
  font-size: 16px;
  border-left: 1px solid var(--dm-border);
  border-right: 1px solid var(--dm-border);
}

.cnv-region-preview {
  font-family: ui-monospace, "Courier New", monospace;
  font-size: 13px;
  color: var(--dm-primary-dark);
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 24px;
  min-height: 40px;
  display: flex;
  align-items: center;
}

.cnv-region-preview.empty {
  color: var(--dm-muted);
  background: #f8fafc;
  border-color: var(--dm-border);
  font-family: inherit;
}

.cnv-type-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.cnv-type-toggle input { display: none; }

.cnv-type-toggle label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 12px;
  border: 2px solid var(--dm-border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  text-align: center;
  margin: 0;
  background: #fff;
}

.cnv-type-toggle label .cnv-type-cn {
  font-size: 15px;
  font-weight: 700;
  color: var(--dm-text);
}

.cnv-type-toggle label .cnv-type-en {
  font-size: 12px;
  color: var(--dm-muted);
}

.cnv-type-toggle input:checked + label {
  border-color: var(--dm-primary);
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.cnv-type-toggle input:checked + label .cnv-type-cn {
  color: var(--dm-primary-dark);
}

.cnv-type-del input:checked + label { border-color: #dc2626; background: #fef2f2; box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1); }
.cnv-type-del input:checked + label .cnv-type-cn { color: #b91c1c; }

.cnv-type-dup input:checked + label { border-color: #2563eb; }

.cnv-type-hint {
  margin: -12px 0 20px;
  font-size: 12px;
  color: var(--dm-muted);
  line-height: 1.5;
}

.cnv-errors {
  margin-bottom: 20px;
}

.cnv-submit-row {
  display: flex;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--dm-border);
  margin-top: 8px;
}

.cnv-submit-row .dm-btn:first-child {
  flex: 1;
  text-align: center;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 600;
}

.cnv-tips {
  margin-top: auto;
  padding: 16px 18px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid var(--dm-border);
}

.cnv-tips h4 {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--dm-muted);
}

.cnv-tips ul {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--dm-muted);
  line-height: 1.8;
}

@media (max-width: 960px) {
  .cnv-layout { grid-template-columns: 1fr; }
  .cnv-visual { height: auto !important; }
  .cnv-visual-card { flex: none; display: block; }
  .cnv-visual-card img { flex: none; height: 200px; min-height: 0; }
  .cnv-form-card { min-height: 0; }
  .cnv-hero { flex-direction: column; text-align: center; }
  .cnv-hero-text p { max-width: none; }
  .cnv-region-builder { flex-direction: column; }
  .cnv-region-sep {
    width: 100%;
    height: 28px;
    border: none;
    border-top: 1px solid var(--dm-border);
    border-bottom: 1px solid var(--dm-border);
    border-left: none;
    border-right: none;
  }
  .cnv-submit-row { flex-direction: column; }
  .cnv-submit-row .dm-btn { width: 100%; }
}

/* ----- CNV result page ----- */
.cnv-result-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  background:
    linear-gradient(
      105deg,
      rgba(15, 23, 42, 0.9) 0%,
      rgba(15, 23, 42, 0.72) 36%,
      rgba(30, 58, 138, 0.48) 58%,
      rgba(37, 99, 235, 0.28) 100%
    ),
    url("/static/images/DNA_back.jpg") center / cover no-repeat;
  border: none;
  border-radius: var(--dm-radius);
  padding: 24px 28px;
  margin-bottom: 20px;
  color: #fff;
  box-shadow: 0 8px 24px rgba(30, 58, 138, 0.25);
  overflow: hidden;
  position: relative;
}

.cnv-result-hero-main,
.cnv-result-hero-actions {
  position: relative;
  z-index: 1;
}

.cnv-result-hero .dm-page-title {
  margin-bottom: 6px;
  color: #fff;
}

.cnv-result-hero .dm-page-lead {
  margin-bottom: 14px;
  color: rgba(255, 255, 255, 0.9);
}

.cnv-result-hero .dm-page-lead strong {
  color: #fff;
}

.cnv-result-hero .dm-query-badge {
  margin-bottom: 0;
}

.cnv-result-hero .dm-badge {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
}

.cnv-result-hero-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.cnv-badge-region {
  font-family: ui-monospace, "Courier New", monospace;
  font-weight: 600;
}

.cnv-badge-type.is-del {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.cnv-result-hero .cnv-badge-type.is-del {
  background: rgba(220, 38, 38, 0.38);
  border-color: rgba(252, 165, 165, 0.55);
  color: #fecaca;
}

.cnv-badge-type.is-dup {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.cnv-result-hero .cnv-badge-type.is-dup {
  background: rgba(37, 99, 235, 0.38);
  border-color: rgba(147, 197, 253, 0.55);
  color: #dbeafe;
}

.cnv-result-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  padding: 12px 14px;
  background: var(--dm-surface);
  border: 1px solid var(--dm-border);
  border-radius: 10px;
  position: sticky;
  top: calc(var(--dm-nav-height) + 8px);
  z-index: 50;
  box-shadow: var(--dm-shadow);
}

.cnv-result-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--dm-muted);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.cnv-result-nav a:hover {
  background: #eff6ff;
  color: var(--dm-primary-dark);
  text-decoration: none;
}

.cnv-result-nav a span {
  display: inline-block;
  min-width: 18px;
  text-align: center;
  padding: 1px 6px;
  border-radius: 999px;
  background: #e2e8f0;
  color: var(--dm-text);
  font-size: 11px;
  font-weight: 700;
}

.cnv-result-nav a span:empty::before { content: "0"; }

.cnv-result-section {
  background: var(--dm-surface);
  border: 1px solid var(--dm-border);
  border-radius: var(--dm-radius);
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: var(--dm-shadow);
  scroll-margin-top: calc(var(--dm-nav-height) + 72px);
}

.cnv-result-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  border-bottom: 1px solid var(--dm-border);
}

.cnv-result-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.cnv-result-section-title h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--dm-primary-dark);
}

.cnv-count-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: var(--dm-primary-dark);
}

.cnv-count-badge.is-zero {
  background: #f8fafc;
  border-color: var(--dm-border);
  color: var(--dm-muted);
}

.cnv-result-table {
  max-height: 360px;
  border: none;
  border-radius: 0;
  margin: 0;
  box-shadow: none;
}

.cnv-empty {
  padding: 28px 20px;
  text-align: center;
  color: var(--dm-muted);
  font-size: 13px;
  background: #f8fafc;
}

.cnv-truncated-hint {
  margin: 0 18px 10px;
  color: #64748b;
  font-size: 12px;
}

.cnv-result-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
  padding-top: 8px;
}

.cnv-result-footer .dm-btn {
  text-align: center;
  padding: 14px;
}

.cnv-result-table a {
  color: var(--dm-primary);
  font-weight: 500;
}

.cnv-result-table a:hover {
  color: var(--dm-primary-dark);
}

@media (max-width: 768px) {
  .cnv-result-hero { flex-direction: column; }
  .cnv-result-hero-actions { width: 100%; }
  .cnv-result-hero-actions .dm-btn { flex: 1; text-align: center; }
  .cnv-result-nav { position: static; }
  .cnv-result-footer { grid-template-columns: 1fr; }
}

/* SNV / InDel query — 标题区高度与 CNV 一致；状态胶囊绝对定位垂直居中，不撑高模块 */
.snv-form-header {
  position: relative;
  padding-right: 320px;
}

.snv-form-header-text {
  min-width: 0;
}

.snv-form-header-text h2 {
  margin: 0 0 4px;
}

.snv-form-header-text p {
  margin: 0;
}

.snv-example-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
}

.snv-db-status-row {
  position: absolute;
  top: 50%;
  right: 28px;
  transform: translateY(-50%);
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 200px);
}

.snv-db-status-row .bio-data-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  line-height: 1.3;
  white-space: nowrap;
}

.snv-db-status-row .bio-data-pill.is-ready {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.snv-db-status-row .bio-data-pill.is-missing {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.snv-top-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.snv-top-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.snv-help {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--dm-muted);
}

.snv-tier {
  display: inline-block;
  min-width: 48px;
  text-align: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #e2e8f0;
  color: #334155;
}

.snv-tier-Tier1 { background: #fee2e2; color: #991b1b; }
.snv-tier-Tier2 { background: #ffedd5; color: #9a3412; }
.snv-tier-Tier3 { background: #e2e8f0; color: #475569; }

@media (max-width: 900px) {
  .snv-top-grid,
  .snv-top-grid-2 { grid-template-columns: 1fr; }

  .snv-form-header {
    padding-right: 28px;
  }

  .snv-db-status-row {
    position: static;
    transform: none;
    max-width: none;
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-top: 12px;
  }
}

/* Sample 点击 → inhouse 弹窗（对齐站点蓝白主题） */
.snv-sample-link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--dm-primary);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.snv-sample-link:hover {
  color: var(--dm-primary-dark);
}

body.snv-modal-open {
  overflow: hidden;
}

.snv-modal[hidden] {
  display: none !important;
}

.snv-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.snv-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 58, 138, 0.42);
}

.snv-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  max-height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
  background: var(--dm-surface);
  border: 1px solid var(--dm-border);
  border-radius: var(--dm-radius);
  box-shadow: var(--dm-shadow-lg);
  overflow: hidden;
}

.snv-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--dm-primary-dark) 0%, var(--dm-primary) 55%, #2563eb 100%);
  color: #fff;
}

.snv-modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.snv-modal-close {
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease;
}

.snv-modal-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.snv-modal-body {
  padding: 16px 18px 20px;
  overflow: auto;
  background: linear-gradient(180deg, #f8fafc 0%, var(--dm-bg) 28%, var(--dm-surface) 100%);
}

.snv-modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.snv-inhouse-section {
  border: 1px solid var(--dm-border);
  border-radius: var(--dm-radius);
  margin-bottom: 14px;
  overflow: hidden;
  background: var(--dm-surface);
  box-shadow: var(--dm-shadow);
}

.snv-inhouse-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  border-bottom: 1px solid var(--dm-border);
}

.snv-inhouse-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--dm-text);
  font-size: 14px;
}

.snv-inhouse-section-title strong {
  color: var(--dm-primary-dark);
}

.snv-inhouse-section-title .glyphicon {
  color: var(--dm-primary);
}

.snv-help-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--dm-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  cursor: help;
}

.snv-filter-btn,
.snv-chip-filter {
  border: 1px solid var(--dm-border);
  background: var(--dm-surface);
  color: var(--dm-muted);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.snv-filter-btn:hover,
.snv-chip-filter:hover {
  border-color: #bfdbfe;
  color: var(--dm-primary-dark);
  background: #eff6ff;
}

.snv-filter-btn.is-active,
.snv-chip-filter.is-active {
  background: var(--dm-primary);
  border-color: var(--dm-primary);
  color: #fff;
}

.snv-sample-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.snv-sample-stats {
  color: var(--dm-muted);
  font-size: 12px;
}

.snv-sample-stats .is-patient {
  color: var(--dm-primary);
  font-weight: 700;
}

.snv-zyg-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4em;
  margin: 0;
  padding: 0 5px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #e2e8f0;
  color: #0f172a;
  font: inherit;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.snv-zyg-filter:hover:not(:disabled) {
  background: #bae6fd;
  border-color: #7dd3fc;
  color: #075985;
}

.snv-zyg-filter.is-active {
  background: #0284c7;
  border-color: #0284c7;
  color: #fff;
}

.snv-zyg-filter.is-disabled,
.snv-zyg-filter:disabled {
  opacity: 0.45;
  cursor: default;
  background: #f1f5f9;
  color: #94a3b8;
}

.snv-pheno-table-wrap {
  max-height: 240px;
  overflow: auto;
  background: var(--dm-surface);
}

.snv-pheno-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  color: var(--dm-text);
}

.snv-pheno-table th,
.snv-pheno-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--dm-border);
  text-align: left;
  white-space: nowrap;
}

.snv-pheno-table th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: var(--dm-muted);
  font-weight: 600;
  z-index: 1;
}

.snv-pheno-table tr.is-focus-pheno td {
  color: #b91c1c;
  font-weight: 600;
  background: #fef2f2;
}

.snv-sample-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  padding: 14px;
  background: var(--dm-surface);
  min-height: 60px;
  box-sizing: border-box;
}

.snv-sample-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--dm-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--dm-shadow);
  cursor: pointer;
}

.snv-sample-pill-id {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.snv-sample-pill.is-hot {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.snv-sample-pill.is-pheno-match {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.snv-sample-tip-list li.is-matched {
  color: #fde68a;
  font-weight: 600;
}

.snv-inhouse-section-samples {
  overflow: visible;
}

.snv-sample-tip {
  display: none;
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  bottom: auto;
  transform: translateX(-50%);
  z-index: 40;
  width: max-content;
  max-width: min(320px, 70vw);
  padding: 10px 12px;
  border-radius: 10px;
  background: #0f172a;
  color: #f8fafc;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.28);
  text-align: left;
  font-weight: 500;
  white-space: normal;
  pointer-events: auto;
}

/* 填补胶囊与提示框之间的空隙，避免移入提示时 hover 断开 */
.snv-sample-tip::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -10px;
  height: 10px;
}

.snv-sample-tip::after {
  content: "";
  position: absolute;
  bottom: 100%;
  top: auto;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: #0f172a;
}

.snv-sample-pill:hover,
.snv-sample-pill:focus-within {
  z-index: 45;
}

.snv-sample-pill:hover .snv-sample-tip,
.snv-sample-pill:focus-within .snv-sample-tip {
  display: block;
}

.snv-sample-tip-head {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.snv-sample-tip-meta {
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 8px;
  line-height: 1.4;
}

.snv-sample-tip-title {
  font-size: 11px;
  font-weight: 700;
  color: #93c5fd;
  margin-bottom: 4px;
}

.snv-sample-tip-list {
  margin: 0;
  padding-left: 16px;
  font-size: 12px;
  line-height: 1.45;
  color: #e2e8f0;
  max-height: 180px;
  overflow: auto;
}

.snv-sample-tip-list li + li {
  margin-top: 2px;
}

.snv-sample-tip-empty {
  font-size: 12px;
  color: #94a3b8;
}

.snv-sample-empty {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  color: var(--dm-muted);
  font-size: 13px;
  text-align: center;
}

.snv-empty-cell {
  padding: 14px;
  text-align: center;
  color: var(--dm-muted);
  font-size: 13px;
}

/* 叠在「inhouse患者数」之上：该样本的本地患者变异信息表 */
#snv-patient-modal {
  z-index: 2100;
}

.snv-patient-dialog {
  width: min(1100px, 100%);
}

.snv-patient-hpo-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
}

.snv-patient-table-wrap {
  max-height: min(52vh, 520px);
}

.snv-patient-table tr.is-focus td {
  background: #fef2f2;
  color: #b91c1c;
  font-weight: 600;
}

.snv-patient-focus-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #fecaca;
  color: #991b1b;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}

@media (max-width: 860px) {
  .snv-sample-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .snv-modal { padding: 12px; }
}

/* ----- CNV-seq patient detail modal ----- */
/* 叠在「CNV 区间概览」之上，便于从区间图下钻查看报告后仍保留概览 */
#cnv-seq-patient-modal {
  z-index: 2100;
}

.cnv-patient-dialog {
  width: min(920px, 100%);
}

.cnv-patient-header-text {
  min-width: 0;
}

.cnv-patient-header-text h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.cnv-patient-header-sub {
  margin: 4px 0 0;
  font-size: 12px;
  opacity: 0.88;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cnv-patient-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.cnv-patient-section {
  margin-bottom: 16px;
  background: var(--dm-surface);
  border: 1px solid var(--dm-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.cnv-patient-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  border-bottom: 1px solid var(--dm-border);
  color: var(--dm-text);
  font-size: 13px;
}

.cnv-patient-section-head .glyphicon {
  color: var(--dm-primary);
  font-size: 13px;
}

.cnv-patient-count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--dm-muted);
  background: #f1f5f9;
  border-radius: 999px;
  padding: 2px 10px;
}

.cnv-patient-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 4px 0;
}

.cnv-patient-grid-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cnv-patient-field {
  padding: 10px 16px;
  border-bottom: 1px solid #f1f5f9;
  min-width: 0;
}

.cnv-patient-field.is-wide {
  grid-column: 1 / -1;
}

.cnv-patient-field dt {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--dm-muted);
}

.cnv-patient-field dd {
  margin: 0;
  font-size: 13px;
  color: var(--dm-text);
  line-height: 1.55;
  word-break: break-word;
}

.cnv-patient-field dd.is-pre {
  white-space: pre-wrap;
}

.cnv-patient-empty {
  color: #cbd5e1;
}

.cnv-patient-variants {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px 16px;
}

.cnv-patient-variant {
  border: 1px solid var(--dm-border);
  border-radius: 10px;
  background: #fafbfc;
  overflow: hidden;
}

.cnv-patient-variant.is-focus {
  border-color: #93c5fd;
  background: linear-gradient(180deg, #eff6ff 0%, #fff 42%);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.cnv-patient-variant-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px 8px;
}

.cnv-patient-variant-locus {
  font-family: ui-monospace, "SF Mono", "Courier New", monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--dm-primary-dark);
}

.cnv-patient-variant-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cnv-patient-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #e2e8f0;
  color: #334155;
}

.cnv-patient-pill.is-del {
  background: #fef2f2;
  color: #b91c1c;
}

.cnv-patient-pill.is-dup {
  background: #eff6ff;
  color: #1d4ed8;
}

.cnv-patient-pill.is-acmg {
  background: #fff7ed;
  color: #c2410c;
}

.cnv-patient-pill.is-focus-tag {
  background: var(--dm-primary);
  color: #fff;
}

.cnv-patient-loading,
.cnv-patient-error,
.cnv-patient-empty-block {
  padding: 36px 20px;
  text-align: center;
  color: var(--dm-muted);
  font-size: 14px;
}

.cnv-patient-error {
  color: #b91c1c;
  background: #fef2f2;
  border-radius: 10px;
  border: 1px solid #fecaca;
}

@media (max-width: 720px) {
  .cnv-patient-grid,
  .cnv-patient-grid-compact {
    grid-template-columns: 1fr;
  }
}

/* ----- GTEx expression modal ----- */
.gtex-gene-link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--dm-primary);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.gtex-gene-link:hover {
  color: var(--dm-primary-dark);
}

.cnv-ext-mini {
  margin-left: 6px;
  font-size: 12px;
  color: var(--dm-muted);
  text-decoration: none;
}

.cnv-ext-mini:hover {
  color: var(--dm-primary);
}

.gtex-expr-dialog {
  width: min(1100px, 100%);
}

.gtex-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.gtex-tx-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.gtex-tx-tab {
  border: 1px solid var(--dm-border);
  background: #fff;
  color: var(--dm-text);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.gtex-tx-tab:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.gtex-tx-tab.is-active {
  background: var(--dm-primary);
  border-color: var(--dm-primary);
  color: #fff;
}

.gtex-focus-note {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--dm-muted);
}

.gtex-top-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.gtex-top-card {
  position: relative;
  padding: 12px 14px 12px 16px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--dm-border);
  border-left: 4px solid var(--gtex-accent, var(--dm-primary));
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  min-width: 0;
}

.gtex-top-card .gtex-top-rank {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--dm-muted);
}

.gtex-top-card strong {
  display: block;
  font-size: 13px;
  color: var(--dm-text);
  margin-bottom: 6px;
  padding-right: 28px;
  line-height: 1.35;
}

.gtex-top-card em {
  font-style: normal;
  font-size: 18px;
  font-weight: 800;
  color: var(--dm-primary-dark);
  font-variant-numeric: tabular-nums;
}

.gtex-top-card small {
  font-size: 11px;
  font-weight: 600;
  color: var(--dm-muted);
}

.gtex-panel {
  background: #fff;
  border: 1px solid var(--dm-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.gtex-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--dm-border);
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.gtex-panel-head strong {
  font-size: 13px;
  color: var(--dm-text);
}

.gtex-panel-head span {
  font-size: 11px;
  color: var(--dm-muted);
  flex-shrink: 0;
  margin-right: 4px;
}

/* 外框负责与白卡片边框拉开距离；内部再滚动 */
.gtex-chart-frame {
  padding: 14px 20px 18px;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.9) 0%, #fff 40%);
}

.gtex-chart {
  min-height: 268px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 0 0 1px rgba(226, 232, 240, 0.9);
}

.gtex-chart-inner {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  width: max-content;
  box-sizing: content-box;
  padding: 12px 8px 14px 12px;
}

.gtex-chart-end {
  flex: 0 0 28px;
  width: 28px;
  height: 1px;
  display: block;
  pointer-events: none;
}

.gtex-bar-col {
  flex: 0 0 36px;
  width: 36px;
  min-width: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.gtex-bar-track {
  width: 100%;
  height: 180px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-radius: 8px 8px 4px 4px;
  background:
    repeating-linear-gradient(
      to top,
      transparent 0,
      transparent 35px,
      rgba(148, 163, 184, 0.12) 35px,
      rgba(148, 163, 184, 0.12) 36px
    );
}

.gtex-bar {
  width: 70%;
  min-height: 0;
  border-radius: 6px 6px 3px 3px;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
  transition: filter 0.15s ease, transform 0.15s ease;
}

.gtex-bar-col:hover .gtex-bar {
  filter: brightness(1.05);
  transform: scaleX(1.08);
}

.gtex-bar-value {
  min-height: 14px;
  font-size: 9px;
  font-weight: 700;
  color: var(--dm-muted);
  font-variant-numeric: tabular-nums;
}

.gtex-bar-label {
  font-size: 9px;
  font-weight: 700;
  color: #64748b;
  writing-mode: horizontal-tb;
  text-align: center;
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .gtex-top-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .gtex-top-grid {
    grid-template-columns: 1fr;
  }

  .gtex-chart-frame {
    padding-left: 14px;
    padding-right: 14px;
  }

  .gtex-bar-col {
    flex: 0 0 30px;
    width: 30px;
    min-width: 30px;
  }
}

/* ----- CNV-seq region track viz modal ----- */
.cnv-region-viz-dialog {
  width: min(960px, 100%);
}

.cnv-region-viz-dialog .snv-modal-body {
  max-height: min(72vh, 640px);
  overflow: auto;
}

.cnv-region-viz-dialog .snv-modal-body.is-samples-scroll {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cnv-region-viz-dialog .snv-modal-body.is-samples-scroll .cnv-region-legend {
  flex-shrink: 0;
}

.cnv-region-viz-dialog .snv-modal-body.is-samples-scroll .cnv-region-viz-frame {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cnv-region-viz-dialog .snv-modal-body.is-samples-scroll .cnv-region-viz-sticky {
  flex-shrink: 0;
  background: #f8fafc;
  box-shadow: 0 1px 0 var(--dm-border);
  z-index: 1;
}

.cnv-region-viz-dialog .snv-modal-body.is-samples-scroll .cnv-region-viz-samples {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* 标题栏：展示三体胶囊开关 */
.cnv-region-viz-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
}

.cnv-region-trisomy-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px 5px 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  font: inherit;
  line-height: 1;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.cnv-region-trisomy-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.42);
}

.cnv-region-trisomy-toggle.is-on {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.55);
}

.cnv-region-trisomy-toggle-text {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.cnv-region-trisomy-toggle-track {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  transition: background 0.18s ease;
}

.cnv-region-trisomy-toggle.is-on .cnv-region-trisomy-toggle-track {
  background: #34d399;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.cnv-region-trisomy-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.35);
  transition: transform 0.18s ease;
}

.cnv-region-trisomy-toggle.is-on .cnv-region-trisomy-toggle-knob {
  transform: translateX(16px);
}

@media (max-width: 640px) {
  .cnv-region-trisomy-toggle-text {
    display: none;
  }

  .cnv-region-trisomy-toggle {
    padding: 5px 6px;
  }
}

.cnv-region-viz-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--dm-muted);
  font-size: 13px;
}

.cnv-region-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--dm-muted);
}

.cnv-region-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--dm-text);
}

.cnv-region-legend-item i {
  display: inline-block;
  width: 18px;
  height: 10px;
  border-radius: 3px;
}

.cnv-region-legend-item i.is-target {
  background: #f59e0b;
  box-shadow: inset 0 0 0 1px #d97706;
}

.cnv-region-legend-item i.is-ideo {
  background: linear-gradient(90deg, #fff 0%, #c8c8c8 35%, #2a2a2a 55%, #c8c8c8 75%, #fff 100%);
  border: 1px solid #94a3b8;
}

.cnv-region-legend-item i.is-del {
  background: #ef4444;
}

.cnv-region-legend-item i.is-dup {
  background: #3b82f6;
}

.cnv-region-legend-note {
  margin-left: auto;
  font-weight: 500;
  color: var(--dm-muted);
}

.cnv-region-legend-hint {
  font-size: 11px;
  font-weight: 500;
  color: var(--dm-muted);
  white-space: nowrap;
}

.cnv-region-zoom-reset {
  margin-left: 0;
  padding: 3px 10px;
  border: 1px solid var(--dm-border);
  border-radius: 999px;
  background: #fff;
  color: var(--dm-text);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.4;
}

.cnv-region-zoom-reset:hover {
  border-color: var(--dm-primary);
  color: var(--dm-primary);
}

.cnv-region-viz-frame {
  background: #f8fafc;
  border: 1px solid var(--dm-border);
  border-radius: 12px;
  padding: 12px 8px 8px;
  overflow-x: auto;
}

.cnv-region-viz-frame.is-zoomable {
  cursor: grab;
}

.cnv-region-viz-frame.is-panning {
  cursor: grabbing;
  user-select: none;
}

.cnv-region-svg {
  display: block;
  min-width: 520px;
  font-family: inherit;
}

.cnv-region-axis {
  stroke: #94a3b8;
  stroke-width: 1.5;
}

.cnv-region-tick {
  stroke: #94a3b8;
  stroke-width: 1;
}

.cnv-region-tick-label {
  fill: var(--dm-muted);
  font-size: 11px;
  font-weight: 600;
}

.cnv-ideo-outline {
  fill: #fff;
  stroke: #64748b;
  stroke-width: 1.25;
}

.cnv-ideo-band {
  stroke: none;
}

.cnv-ideo-band-fallback {
  fill: #e2e8f0;
}

.cnv-ideo-cen {
  fill: none;
  stroke: #7f1d1d;
  stroke-width: 1.25;
  opacity: 0.85;
}

.cnv-ideo-target {
  fill: rgba(245, 158, 11, 0.85);
  stroke: #d97706;
  stroke-width: 0.75;
  pointer-events: none;
}

.cnv-ideo-target-caption {
  fill: #b45309;
}

.cnv-region-label {
  fill: var(--dm-text);
  font-size: 11px;
  font-weight: 600;
}

.cnv-region-sample-hit {
  fill: transparent;
  cursor: pointer;
}

.cnv-region-sample-link {
  fill: var(--dm-primary);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cnv-region-sample-link:hover,
.cnv-region-sample-hit:hover + .cnv-region-sample-link {
  fill: var(--dm-primary-dark);
}

.cnv-region-label-target {
  fill: #b45309;
}

.cnv-region-meta {
  fill: var(--dm-muted);
  font-size: 10px;
  font-weight: 500;
}

.cnv-region-bar {
  stroke-width: 0;
}

.cnv-region-bar.is-target {
  fill: #f59e0b;
  opacity: 0.92;
}

.cnv-region-bar.is-del {
  fill: #ef4444;
  opacity: 0.88;
}

.cnv-region-bar.is-dup {
  fill: #3b82f6;
  opacity: 0.88;
}

.cnv-region-bar.is-whole {
  opacity: 0.78;
  stroke: rgba(15, 23, 42, 0.25);
  stroke-width: 1;
}

.cnv-region-bar:hover {
  opacity: 1;
  filter: brightness(0.95);
}

@media (max-width: 640px) {
  .cnv-region-legend-note,
  .cnv-region-legend-hint {
    margin-left: 0;
    width: 100%;
    white-space: normal;
  }
}

