/* Do prairie voles have MUPs? Scoped under #vm; inherits the site's dark theme.
   Base tokens and components copied from the Getz explorer (projects/getz-vole-trapping/explorer.css). */

.wrapper:has(#vm) { max-width: 1240px; }

#vm {
  --surface: #0d0d0d;
  --surface-2: #151515;
  --ink: #ffffff;
  --ink-2: #c3c2b7;
  --muted: #898781;
  --grid: #2c2c2a;
  --axis: #383835;
  --border: rgba(255, 255, 255, 0.10);
  --mup: #f08a3c;     /* MUP clade (orange) */
  --obp: #3f9bdc;     /* OBP / aphrodisin-type clade (blue) */
  --obp2: #9d86e6;    /* OBP2 clade (violet) */
  --lipo: #b9b39a;    /* other lipocalins */
  --flank: #6f6e68;   /* flanking genes */
  --gene: #3b3a37;    /* other genes */
  --gapc: #e66767;    /* assembly gaps */
  --accent: #3987e5;
  color: var(--ink-2);
}

#vm h1 { color: var(--ink); margin: 0 0 12px; font-size: 2.1em; font-weight: 400; }
#vm h2 { color: var(--ink); font-weight: 400; margin: 0 0 6px; }
#vm a { color: #4a9eff; }
#vm h3.vm-h3 { color: var(--ink); font-weight: 400; font-size: 1.12em; margin: 26px 0 6px; }
#vm h3.vm-h3-sub { font-size: 0.98em; margin-top: 14px; }

.vm-kicker { color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 12px; margin: 0 0 6px; }
.vm-lede { max-width: 780px; font-size: 1.05em; color: var(--ink-2); }
.vm-byline { color: var(--muted); font-size: 14px; margin: 4px 0 0; }

.vm-stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 6px; }
.vm-stat { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; min-width: 130px; max-width: 220px; }
.vm-stat b { display: block; color: var(--ink); font-size: 1.6em; font-weight: 400; line-height: 1.2; }
.vm-stat span { color: var(--muted); font-size: 13px; }

.vm-credit { margin: 22px 0 8px; padding: 14px 18px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 6px 6px 0; font-size: 14px; line-height: 1.6; }
.vm-credit strong { color: var(--ink); }
.vm-credit p { margin: 0 0 8px; }
.vm-credit p:last-child { margin-bottom: 0; }

.vm-toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; }
.vm-toc a { font-size: 13px; padding: 4px 12px; border: 1px solid var(--border); border-radius: 14px; text-decoration: none; color: var(--ink-2) !important; }
.vm-toc a:hover { border-color: #555; color: var(--ink) !important; }

.vm-section { margin-top: 48px; }
.vm-note { color: var(--muted); font-size: 14px; max-width: 860px; margin: 0 0 14px; }
.vm-note b { color: var(--ink-2); font-weight: 500; }

.vm-terms { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; margin: 10px 0 12px; }
.vm-term { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 11px 14px; font-size: 13.5px; line-height: 1.5; }
.vm-term b { display: block; color: var(--ink); font-weight: 500; margin-bottom: 3px; font-size: 14px; }
.vm-term em { color: var(--ink); font-style: normal; }

.vm-steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin: 8px 0 4px; }
.vm-step { display: grid; grid-template-columns: 30px 1fr; gap: 2px 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 13.5px; line-height: 1.5; }
.vm-step b { grid-row: span 2; color: var(--muted); font-size: 15px; font-weight: 400; font-variant-numeric: tabular-nums; }
.vm-step span { color: var(--ink-2); }
.vm-step em { color: var(--muted); font-style: normal; font-size: 12.5px; }

.vm-controls { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 6px 0 8px; }
.vm-controls label { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.vm-controls select { background: var(--surface-2); color: var(--ink); border: 1px solid #333; border-radius: 6px; padding: 5px 8px; font: inherit; font-size: 13px; max-width: 100%; }
.vm-controls select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.vm-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--ink-2); margin: 4px 0 8px; }
.vm-legend span { display: inline-flex; align-items: center; gap: 7px; }
.vm-legend i { display: inline-block; width: 16px; height: 10px; border-radius: 2px; }
.vm-legend i.vm-dot { width: 9px; height: 9px; border-radius: 50%; }
.vm-legend i.vm-dot-focal { width: 12px; height: 12px; box-shadow: 0 0 0 1.5px #fff; }
.vm-legend i.vm-lg-pseudo { opacity: 0.45; outline: 1px dashed var(--ink-2); outline-offset: -1px; }

.vm-svg { display: block; overflow: visible; max-width: 100%; }
.vm-svg text { font-family: inherit; font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.vm-svg .vm-row-lab { fill: var(--ink-2); font-size: 12px; font-variant-numeric: normal; }
.vm-svg .vm-row-focal { fill: var(--ink); font-weight: 600; }
.vm-svg .vm-row-kb { fill: var(--muted); font-size: 11px; }
.vm-svg .vm-panel-title { fill: var(--ink-2); font-size: 12px; font-variant-numeric: normal; }
.vm-svg .vm-axis-note { fill: var(--muted); font-size: 11px; font-variant-numeric: normal; }
.vm-svg .vm-gridline { stroke: var(--grid); stroke-width: 1; }
.vm-svg .vm-bar-n { fill: var(--ink-2); font-size: 11px; }
.vm-backbone { stroke: #4a4945; stroke-width: 1; }
.vm-open { fill: var(--gapc) !important; font-size: 12px !important; }
.vm-gap { fill: var(--gapc); }
.vm-gene { stroke: none; }
.vm-gene.vm-k-gene { fill: var(--gene); }
.vm-gene.vm-pseudo { fill-opacity: 0.42; stroke: var(--ink-2); stroke-width: 0.6; stroke-dasharray: 2 1.5; }
.vm-gene.vm-gsel { stroke: #fff; stroke-width: 2; stroke-dasharray: none; }
.vm-gene:hover { stroke: #fff; stroke-width: 1.2; }
.vm-flank-lab { fill: var(--muted) !important; font-size: 9.5px !important; font-style: italic; pointer-events: none; }
.vm-link { stroke: #2f2e2b; stroke-width: 1; }
.vm-row.vm-dim { opacity: 0.25; }

#vm-syn-plot, #vm-count-plot, #vm-liver-plot { width: 100%; }
#vm-syn-plot { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 6px 4px; box-sizing: border-box; }

.vm-tree-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.vm-tree-grid > div { min-width: 0; }
#vm-tree-plot { display: flex; justify-content: center; }
.vm-tree .vm-branch { fill: none; stroke: #6a6964; stroke-width: 0.8; }
.vm-tree .vm-tip-dash { stroke: #242422; stroke-width: 0.5; stroke-dasharray: 1 2; }
.vm-tree .vm-tipdot { stroke: #0d0d0d; stroke-width: 0.5; cursor: pointer; }
.vm-tree .vm-tipfocal { stroke: #fff; stroke-width: 1.2; }
.vm-tree .vm-tipdot:hover { stroke: #fff; stroke-width: 1.5; }
.vm-tree .vm-ring { fill: none; stroke: #fff; stroke-width: 1; opacity: 0.6; pointer-events: none; }
.vm-tree .vm-ring-sel { stroke-width: 2.2; opacity: 1; }
.vm-tree .vm-clade-lab { font-size: 12.5px !important; font-weight: 600; font-variant-numeric: normal; }
.vm-scalebar { stroke: var(--ink-2); stroke-width: 1.5; }
.vm-treeinfo { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; }

.vm-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; font-size: 13px; }
.vm-card .vm-empty { color: var(--muted); margin: 0; }
.vm-card h3 { margin: 0 0 2px; color: var(--ink); font-weight: 400; font-size: 1.1em; display: flex; align-items: center; gap: 8px; }
.vm-card h3 i { width: 12px; height: 12px; display: inline-block; border-radius: 50%; flex: none; }
.vm-card .vm-sub { color: var(--muted); margin: 0 0 10px; }
.vm-card dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0 0 10px; }
.vm-card dt { color: var(--muted); }
.vm-card dd { margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.vm-card .vm-close { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; }

.vm-liver-grid { display: grid; gap: 12px 24px; }
.vm-pair-title { color: var(--ink-2); font-size: 13.5px; margin: 0 0 2px; }
.vm-pair-src { color: var(--ink-3, var(--ink-2)); font-size: 12px; margin: 0 0 4px; opacity: .8; }
#vm-liver-compare { margin: 6px 0 18px; }
.vm-axis-lab { font-size: 11.5px; }

.vm-model { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; margin: 4px 0 14px; max-width: 900px; font-size: 14px; line-height: 1.6; }
.vm-model p { margin: 0; }
.vm-reading { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--mup); border-radius: 0 8px 8px 0; padding: 16px 20px; max-width: 960px; }
.vm-reading p { font-size: 14.5px; line-height: 1.65; color: var(--ink-2); margin: 0 0 10px; }
.vm-reading p:last-child { margin-bottom: 0; }
.vm-limits { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; max-width: 1100px; }
.vm-limits ul { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.6; }
.vm-limits li { margin: 0 0 8px; }

.vm-tip {
  position: fixed; z-index: 50; pointer-events: none; display: none; max-width: 300px;
  background: #1f1f1e; border: 1px solid #333; border-radius: 6px; padding: 8px 10px;
  font-size: 12px; color: var(--ink-2); box-shadow: 0 6px 20px rgba(0,0,0,.5);
}
.vm-tip .vm-tip-h { color: var(--ink); margin-bottom: 4px; }
.vm-tip .vm-tip-r { display: flex; align-items: center; gap: 7px; line-height: 1.55; }
.vm-tip .vm-tip-r i { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.vm-tip .vm-tip-r b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.vm-tip .vm-tip-sub { color: var(--muted); font-size: 11px; margin-top: 3px; }

.vm-about details { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 16px; margin-bottom: 10px; font-size: 14px; }
.vm-about summary { cursor: pointer; color: var(--ink); }
.vm-about li { margin: 6px 0; }
.vm-refs li { margin: 4px 0; }

@media (max-width: 900px) {
  .vm-tree-grid { grid-template-columns: minmax(0, 1fr); }
  #vm h1 { font-size: 1.6em; }
}
@media (max-width: 620px) {
  .vm-svg .vm-row-lab { font-size: 11px; }
  .vm-svg .vm-row-kb { font-size: 9.5px; }
}
@media (max-width: 760px) {
  .vm-limits { grid-template-columns: minmax(0, 1fr); }
  .vm-stat { min-width: 0; flex: 1 1 40%; }
}
.vm-tablewrap { overflow-x: auto; margin: 10px 0 14px; }
.vm-table { border-collapse: collapse; font-size: 13px; width: 100%; min-width: 560px; }
.vm-table th, .vm-table td { text-align: left; vertical-align: top; padding: 6px 10px 6px 0; border-bottom: 1px solid rgba(255,255,255,.12); }
.vm-table th { color: var(--ink); font-weight: 500; }
.vm-table td { color: var(--ink-2); }
.vm-3d-pick { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 12px; }
.vm-3d-btn { background: transparent; color: var(--ink-2); border: 1px solid rgba(255,255,255,.25); border-radius: 999px;
  padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.vm-3d-btn.vm-3d-mup { border-color: var(--mup); }
.vm-3d-btn.vm-3d-obp { border-color: var(--obp); }
.vm-3d-btn[aria-selected="true"].vm-3d-mup { background: var(--mup); color: #111; }
.vm-3d-btn[aria-selected="true"].vm-3d-obp { background: var(--obp); color: #111; }
.vm-3d-pending { opacity: .55; border-style: dashed; }
.vm-3d-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; align-items: start; }
.vm-3d-view { position: relative; width: 100%; height: 380px; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; }
.vm-3d-title { color: var(--ink); font-size: 1.15em; margin: 4px 0 6px; }
@media (max-width: 720px) { .vm-3d-grid { grid-template-columns: 1fr; } .vm-3d-view { height: 300px; } }
