/* Explorer-specific — clean editorial restyling.
   Targets the same class names emitted by build_static_explorer.py. */

.page-explorer {
  max-width: none;
  width: 100%;
  padding-left: 2rem;
  padding-right: 2rem;
}

.page-explorer .columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: 1.5rem;
  align-items: start;
}

.page-explorer .col {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.25rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.page-explorer .col:last-child {
  border-right: 1px solid var(--gray-200);
}

/* ── Rank header ─────────────────────────────────── */

.rank-header {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 10px;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.rank-badge {
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 4px 10px;
  border-radius: 4px;
  flex-shrink: 0;
}

.rank-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--gray-900);
}

/* ── Metrics panel ───────────────────────────────── */

.page-explorer .metrics-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--gray-50);
}

.page-explorer .metrics-panel .metric {
  padding: 14px 16px;
  min-width: 0;
  border-right: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
}

.page-explorer .metrics-panel .metric:nth-child(-n + 4) {
  min-height: 96px;
}

.page-explorer .metrics-panel .metric:nth-child(2n):not(.metric-wide) {
  border-right: none;
}

.page-explorer .metrics-panel .metric:nth-child(3):not(.metric-wide),
.page-explorer .metrics-panel .metric:nth-child(4) {
  border-bottom: none;
}

.page-explorer .metrics-panel .metric-wide {
  grid-column: 1 / -1;
  border-right: none;
}

.page-explorer .metrics-panel .metric-wide:not(:last-child) {
  border-bottom: 1px solid var(--gray-200);
}

.page-explorer .metrics-panel .metric-wide:last-child {
  border-bottom: none;
}

.metric-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: 6px;
  line-height: 1.3;
}

.metric-value {
  font-family: "IBM Plex Mono", monospace;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  color: var(--gray-900);
}

.metric-sub {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 4px;
  line-height: 1.5;
}

/* ── Sequence block ──────────────────────────────── */

.seq-block {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 1rem;
  font-size: 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  flex-shrink: 0;
  color: var(--gray-700);
}

/* ── Pane (residue analysis / 3D / mol2d) ────────── */

.pane {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 12px;
  min-width: 0;
  overflow: hidden;
}

.pane-label {
  padding: 8px 14px;
  background: var(--gray-100);
  color: var(--gray-700);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  border-bottom: 1px solid var(--gray-200);
}

.pane-body {
  padding: 0;
  background: #fff;
}

.pane-body--padded {
  padding: 1rem;
}

.pane-body p {
  font-family: Inter, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--gray-700);
}

.pane-body .caption {
  margin: 0;
  padding: 10px 14px 12px;
  font-size: 12px;
  color: var(--gray-500);
}

.plot-frame {
  width: 100%;
  border: 0;
  display: block;
  vertical-align: top;
}

.viewer-frame {
  width: 100%;
  height: 340px;
  border: 0;
  display: block;
}

.mol2d-img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  margin: 8px 0;
}

.footer-line {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--gray-400);
  text-transform: uppercase;
  margin-top: 8px;
  line-height: 1.4;
}

/* ── Responsive ──────────────────────────────────── */

@media (max-width: 960px) {
  .page-explorer .columns {
    grid-template-columns: 1fr;
  }
  .page-explorer .col {
    border-right: 1px solid var(--gray-200);
  }
}

@media (max-width: 600px) {
  .page-explorer {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}
