/* ============================================================
   Psilocybin enzymes in 3D: hub tab + report part (psi-structures.js).
   Hand-maintained like the other legacy css.
   ============================================================ */

.PsiStruct {
  margin-top: var(--body-margin);
  width: 100%;
}

.StrainPsilocybin--subheading {
  margin: 2em 0 .5em;
  font-size: 1.25rem;
  font-weight: 700;
}

.PsiStruct--error { color: var(--danger); font-style: italic; }
.PsiStruct--note,
.PsiStruct--dim { color: var(--dim-blue-30); }
.PsiStruct--note { max-width: 80ch; }

/* ---- enzyme tabs ---- */
.PsiStruct--tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .25em;
  margin-bottom: .75em;
}

.PsiStruct--tab {
  padding: .35em .9em;
  border: 1px solid var(--dim-blue-85, #c9d6ea);
  border-radius: 999px;
  background: #fff;
  color: #1f272e;
  cursor: pointer;
}

.PsiStruct--tab.is-active {
  background: #1f4e99;
  border-color: #1f4e99;
  color: #fff;
}

.PsiStruct--head p { margin: 0 0 .5em; max-width: 80ch; }

/* ---- viewer + side card ---- */
.PsiStruct--body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18rem;
  gap: 1em;
  margin-top: .5em;
}

@media (max-width: 800px) {
  .PsiStruct--body { grid-template-columns: minmax(0, 1fr); }
}

.PsiStruct--stage {
  position: relative;
  height: 460px;
  border: 1px solid var(--dim-blue-90, #e6ebf1);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

@media (max-width: 800px) {
  .PsiStruct--stage { height: 340px; }
}

.PsiStruct--mount {
  position: absolute;
  inset: 0;
}

.PsiStruct--overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .85);
  color: #5c748a;
  font-style: italic;
  z-index: 2;
}

.PsiStruct--overlay[hidden] { display: none; }

.PsiStruct--flipBar {
  position: absolute;
  left: .75em;
  top: .75em;
  display: flex;
  flex-wrap: wrap;
  gap: .5em;
  z-index: 3;
}

.PsiStruct--flip {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  padding: .4em .8em;
  border: 1px solid #1f4e99;
  border-radius: 999px;
  background: #fff;
  color: #5c748a;
  cursor: pointer;
  font-size: .875rem;
}

.PsiStruct--flip:disabled { opacity: .5; cursor: default; }
.PsiStruct--flip .is-on { color: #1f4e99; font-weight: 700; }
.PsiStruct--flip[aria-pressed="true"] .is-on { color: #d1495b; }
.PsiStruct--flipArrow { color: #1f272e; }

.PsiStruct--picker {
  max-width: 22rem;
  padding: .35em .5em;
  border: 1px solid var(--dim-blue-85, #c9d6ea);
  border-radius: 6px;
  background: #fff;
  font-size: .875rem;
}

.PsiStruct--side { font-size: .9rem; }

.PsiStruct--card {
  padding: .75em 1em;
  border: 1px solid var(--dim-blue-90, #e6ebf1);
  border-radius: 6px;
  background: var(--plot-bg, #fafbfd);
}

.PsiStruct--card > div + div { margin-top: .35em; }
.PsiStruct--cardTitle { font-size: 1.25rem; font-weight: 700; color: #d1495b; }

/* ---- population track ---- */
.PsiStruct--track { margin-top: 1em; }
.PsiStruct--svg { width: 100%; height: auto; display: block; }
.PsiStruct--svg .-axis { font-size: 11px; fill: #5c748a; }
.PsiStruct--svg .-lab { font-size: 11px; fill: #1f272e; }
.PsiStruct--pop { cursor: pointer; outline: none; }
.PsiStruct--pop:hover circle,
.PsiStruct--pop:focus circle { stroke-width: 3; }

.PsiStruct--legend {
  display: flex;
  flex-wrap: wrap;
  gap: .5em 1.25em;
  font-size: .8rem;
  color: #5c748a;
}

.PsiStruct--legend .-dot {
  display: inline-block;
  width: .7em;
  height: .7em;
  margin-right: .3em;
  border: 2px solid #5c748a;
  border-radius: 50%;
  vertical-align: -.05em;
}

.PsiStruct--legend .-dot.-on { background: #d1495b; border-color: #d1495b; }
.PsiStruct--legend .-dot.-reads { border: 1.5px dashed #5c748a; opacity: .8; }
.PsiStruct--svg .-lab.-ro { fill: #5c748a; }
.PsiStruct--pop.-faint .-lab { opacity: .55; }

.PsiStruct--legend .-bar {
  display: inline-block;
  width: 1.2em;
  height: .6em;
  margin-right: .3em;
  background: #f2d7a6;
  vertical-align: 0;
}

/* ---- versions table (hub) ---- */
.PsiStruct--versions { margin-top: 1em; overflow-x: auto; }
.PsiStruct--table { border-collapse: collapse; font-size: .875rem; min-width: 32rem; }
.PsiStruct--table th,
.PsiStruct--table td { padding: .35em .75em; border-bottom: 1px solid var(--dim-blue-90, #e6ebf1); text-align: left; vertical-align: top; }
.PsiStruct--table .-num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- hub page tabs (Gene cluster / Enzymes in 3D) ---- */
.PsiHub--tabs {
  display: flex;
  gap: .25em;
  margin: 1em 0;
  border-bottom: 1px solid var(--dim-blue-85, #c9d6ea);
}

.PsiHub--tab {
  padding: .5em 1em;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  background: none;
  color: #5c748a;
  cursor: pointer;
  margin-bottom: -1px;
}

.PsiHub--tab.is-active {
  border-color: var(--dim-blue-85, #c9d6ea);
  background: #fff;
  color: #1f272e;
  font-weight: 700;
}

.PsiHub--panel[hidden] { display: none; }

/* ==== Card mode (2026-10-28): the enzyme's 3D view inside its Variants gene card ==== */
/* Rows on the left, the structure on the right; stacked on narrow screens. */
.VariantGene--withStruct { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 1.25em; align-items: start; }
@media (max-width: 900px) { .VariantGene--withStruct { grid-template-columns: 1fr; } }
.VariantGene.-hasStruct .VariantGene--body { height: auto !important; overflow: visible; }

.PsiStruct.-card { margin: 0; }
.PsiStruct.-card .PsiStruct--head p { font-size: .9rem; margin-bottom: .4em; }
.PsiStruct.-card .PsiStruct--body { grid-template-columns: 1fr; gap: .6em; }
.PsiStruct.-card .PsiStruct--stage { height: 360px; }
.PsiStruct.-card .PsiStruct--side { font-size: .85rem; }
.PsiStruct.-card .PsiStruct--track { margin-top: .5em; }
.PsiStruct.-card .PsiStruct--legend { font-size: .75rem; }

/* Variant rows linked to residues */
.VariantRow.-on3d { cursor: pointer; }
.VariantRow.is-linked { background: color-mix(in srgb, #d1495b 12%, transparent); box-shadow: inset 3px 0 0 #d1495b; }
.VariantRow--on3d { display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; margin-left: .4em;
  padding: 0; border: 1px solid var(--dim-blue-85, #c9d6ea); border-radius: 4px; background: var(--plot-bg, #fff); color: #1f4e99; cursor: pointer; flex: none; }
.VariantRow--on3d:hover, .VariantRow.is-linked .VariantRow--on3d { border-color: #d1495b; color: #d1495b; }
.VariantRow--on3d svg { width: 1rem; height: 1rem; }

/* Psilocybin section: enzymes shown in a card keep only the population view here */
.PsiStruct--cardNote { margin: 0 0 .5em; font-size: .9rem; }

/* Stage and side card on the page palette's surface colour (same as the blob plot); the Mol* canvas
   itself is set from --plot-bg in psi-structures.js. */
.PsiStruct--stage, .PsiStruct--card { background: var(--plot-bg, #fff); }
.PsiStruct--tab, .PsiStruct--flip, .PsiStruct--picker, .PsiHub--tab.is-active { background: var(--plot-bg, #fff); }
.PsiStruct--overlay { background: color-mix(in srgb, var(--plot-bg, #fff) 85%, transparent); }

/* The 3D viewer sits in a slightly recessed well (--plot-well, psilo only) so the structure reads as the
   focal point of the card; falls back to the surface colour elsewhere. */
.PsiStruct--stage { background: var(--plot-well, var(--plot-bg, #fff)); border-color: color-mix(in srgb, var(--plot-well, var(--dim-blue-90, #e6ebf1)) 70%, #8a7a6a); }

/* "i" on the legend's "low prediction confidence" (psi-structures.js CONF_HELP); CSS-only hover */
.PsiStruct--help {
  position: relative; display: inline-block; width: 1.1em; height: 1.1em; margin-left: .3em;
  border-radius: 50%; background: #859aad; color: #fff; font-style: italic; font-weight: 700;
  font-size: .75rem; line-height: 1.1em; text-align: center; cursor: help; vertical-align: .1em;
}
.PsiStruct--helpText {
  position: absolute; left: 50%; bottom: calc(100% + .5em); z-index: 100; width: 22em; max-width: 80vw;
  padding: .75em 1em; transform: translateX(-50%); background: #1f272e; color: #fff;
  font-style: normal; font-weight: 400; font-size: .8125rem; line-height: 1.45; text-align: left;
  opacity: 0; pointer-events: none; transition: opacity .15s ease;
}
.PsiStruct--help:hover .PsiStruct--helpText,
.PsiStruct--help:focus .PsiStruct--helpText { opacity: 1; }
@media print { .PsiStruct--help { display: none; } }
