:root {
  --meth-ink: #17212b;
  --meth-muted: #64748b;
  --meth-line: rgba(38, 85, 104, 0.16);
  --meth-panel: rgba(255, 255, 255, 0.94);
  --meth-teal: #3083dd;
  --meth-blue: #577fee;
  --meth-amber: #a3c4f3;
  --meth-soft: #eef4ff;
  --meth-shadow: 0 16px 38px rgba(26, 55, 73, 0.12);
}

.methylation-page-header {
  background: linear-gradient(135deg, #3083dd, #a3c4f3);
}

.methylation-page {
  max-width: 1800px;
  margin: 0 auto;
  padding: 10px 22px 56px;
  color: var(--meth-ink);
}

.query-panel,
.summary-strip article,
.visual-panel,
.table-panel {
  background: var(--meth-panel);
  border: 1px solid var(--meth-line);
  box-shadow: var(--meth-shadow);
}

.query-panel {
  padding: 20px;
  margin-bottom: 16px;
}

.query-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(280px, 1.4fr) minmax(160px, 0.7fr) auto;
  gap: 14px;
  align-items: end;
}

.field-group {
  display: grid;
  gap: 7px;
}

.field-group label,
.chart-mode label {
  color: var(--meth-muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.field-group input,
.field-group select,
.chart-mode select {
  width: 100%;
  min-height: 42px;
  box-sizing: border-box;
  border: 1px solid rgba(15, 143, 131, 0.28);
  background: #fff;
  color: var(--meth-ink);
  padding: 9px 11px;
  font-size: 0.96rem;
  outline: none;
}

.field-group input:focus,
.field-group select:focus,
.chart-mode select:focus {
  border-color: var(--meth-teal);
  box-shadow: 0 0 0 4px rgba(15, 143, 131, 0.13);
}

#srr-select {
  min-height: 96px;
}

.run-selector-row {
  display: grid;
  grid-template-columns: minmax(320px, 560px) 1fr;
  gap: 16px;
  align-items: center;
  margin-top: 14px;
}

.run-hint {
  margin: 0;
  color: var(--meth-muted);
  line-height: 1.6;
}

.search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 22px;
  border: 0;
  background: var(--meth-teal);
  color: #fff;
  font-weight: 850;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.search-btn:hover {
  transform: translateY(-2px);
  background: #0b746b;
  box-shadow: 0 10px 22px rgba(15, 143, 131, 0.24);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.summary-strip article {
  padding: 16px;
}

.summary-strip span {
  display: block;
  color: var(--meth-teal);
  font-size: 1.9rem;
  font-weight: 900;
  line-height: 1.1;
}

.summary-strip small {
  color: var(--meth-muted);
  font-weight: 800;
}

.visual-panel,
.table-panel {
  padding: 20px;
  margin-bottom: 16px;
}

.panel-title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--meth-line);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--meth-teal);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.panel-title-row h2 {
  margin: 0;
  font-size: 1.25rem;
}

.chart-mode {
  display: grid;
  gap: 6px;
  min-width: 150px;
}

.methylation-chart {
  min-height: 420px;
  background:
    linear-gradient(180deg, rgba(240, 245, 255, 0.82), rgba(255, 255, 255, 0.78));
  border: 1px solid rgba(48, 131, 221, 0.1);
}

.table-wrap {
  overflow: auto;
  border: 1px solid rgba(38, 85, 104, 0.12);
}

#methylation-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

#methylation-table th,
#methylation-table td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(38, 85, 104, 0.1);
  text-align: left;
  white-space: nowrap;
}

#methylation-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f5faf9;
  color: #24505c;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#methylation-table tbody tr:hover {
  background: rgba(15, 143, 131, 0.05);
}

#methylation-table a {
  color: var(--meth-blue);
  text-decoration: none;
  font-weight: 750;
}

#methylation-table a:hover {
  text-decoration: underline;
}

.ratio-cell {
  min-width: 170px;
}

.ratio-bar {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
  align-items: center;
}

.ratio-value {
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  color: #24505c;
}

.ratio-track {
  height: 9px;
  background: #edf2f7;
  overflow: hidden;
}

.ratio-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #cfe0ff, var(--meth-teal), #5b8def);
}

.empty {
  text-align: center;
  color: var(--meth-muted);
  padding: 28px 12px !important;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--meth-muted);
  font-size: 0.9rem;
}

.pagination button {
  border: 1px solid rgba(15, 143, 131, 0.2);
  background: var(--meth-soft);
  color: var(--meth-teal);
  padding: 7px 12px;
  font-weight: 800;
  cursor: pointer;
}

.pagination button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .query-grid,
  .run-selector-row,
  .summary-strip {
    grid-template-columns: 1fr;
  }

  .panel-title-row {
    display: grid;
  }

  .pagination {
    flex-wrap: wrap;
  }
}
