/* Genome Lab page (builds on site.css and lab.css) */

/* Video */
.gm-film { margin-top: 24px; }
.film-panel video { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; background: #0d1018; margin-top: 8px; }
.gm-try { margin-top: 40px; margin-bottom: 16px; }

/* Viewer */
.viewer-panel { padding: 0; overflow: hidden; }
.gm-viewer {
  position: relative; height: 620px; min-height: 380px; overflow: hidden;
  background: radial-gradient(ellipse at 55% 40%, color-mix(in srgb, var(--surface) 70%, var(--accent-soft)) 0%, var(--bg) 78%);
}
.gm-viewer canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.gm-viewer canvas:active { cursor: grabbing; }
.gm-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.gm-lines line { stroke: var(--muted); stroke-width: 1; opacity: .7; }
.gm-lines circle { fill: var(--text); }
.gm-label {
  position: absolute; left: 0; top: 0; pointer-events: none; white-space: nowrap; z-index: 2;
  font: 500 12.5px var(--font); color: var(--text); padding: 3px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.gm-label[hidden], .gm-tag[hidden] { display: none; }
.gm-tag {
  position: absolute; left: 0; top: 0; pointer-events: none; z-index: 3; white-space: nowrap;
  font: 500 13px var(--font); padding: 4px 11px; border-radius: 8px; color: #fff; background: #1c2233; box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}
.gm-tag b { font-family: ui-monospace, Consolas, monospace; letter-spacing: 1px; }
.gm-tag.hot { background: #e5671f; }
.gm-hud {
  position: absolute; top: 12px; left: 12px; z-index: 3; max-width: min(460px, calc(100% - 24px));
  background: color-mix(in srgb, var(--surface) 90%, transparent); border: 1px solid var(--border); border-radius: 10px; padding: 9px 13px;
  font-size: 13px; line-height: 1.5; box-shadow: var(--shadow);
}
.gm-hud b { display: block; font: 600 14px var(--font-head); }
.gm-hud span { color: var(--muted); font-variant-numeric: tabular-nums; }
.gm-progress { height: 4px; border-radius: 2px; background: var(--border); margin-top: 6px; overflow: hidden; }
.gm-progress i { display: block; height: 100%; width: 0; background: var(--accent); }
.gm-key {
  position: absolute; left: 12px; bottom: 34px; z-index: 3; display: flex; flex-wrap: wrap; gap: 4px 12px; max-width: calc(100% - 24px);
  font-size: 12px; color: var(--muted);
}
.gm-key span { display: inline-flex; align-items: center; gap: 5px; }
.gm-key i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.gm-key i.r { border-radius: 50%; }
.gm-key i.glow { background: #ff8a2a; box-shadow: 0 0 6px 2px rgba(255, 138, 42, .7); }
.gm-key .sep { width: 1px; height: 12px; background: var(--border); }
.gm-viewer .viewer-hint { position: absolute; left: 12px; right: 12px; bottom: 10px; text-align: center; z-index: 1; pointer-events: none; font-size: 12.5px; color: var(--muted); }
.gm-caption {
  position: absolute; left: 50%; bottom: 64px; transform: translateX(-50%); z-index: 4; max-width: 80%;
  text-align: center; font: 600 22px/1.35 var(--font-head); color: #fff; background: rgba(16, 20, 32, .82); padding: 10px 20px; border-radius: 12px;
}
.gm-caption small { display: block; font: 400 15px var(--font); color: #c9d2e6; margin-top: 2px; }
.gm-caption[hidden] { display: none; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px 20px; margin: 0 0 14px; }
.facts dt { font-size: 12.5px; color: var(--muted); }
.facts dd { margin: 0; font: 600 17px var(--font-head); font-variant-numeric: tabular-nums; }

/* Controls */
.controls textarea {
  width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text);
  font: 12.5px/1.5 ui-monospace, Consolas, monospace; resize: vertical; word-break: break-all;
}
.var-row { display: flex; gap: 8px; margin-bottom: 10px; }
.var-row input {
  flex: 1; min-width: 0; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text);
  font: 14px ui-monospace, Consolas, monospace;
}
.var-row input:focus, .controls textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.hint.err { color: #d03a48; margin-top: 0; }
.hint.err:empty { display: none; }
.hint code, .sub code { font-size: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }
#known .chip { font-size: 12.5px; }
#modes { margin-bottom: 12px; }
#play[aria-pressed=false] { background: var(--accent); border-color: var(--accent); color: #fff; }
[data-theme="dark"] #play[aria-pressed=false] { color: #0f1115; }
#own { margin-top: 4px; }
#own .btn { margin-bottom: 10px; }

/* Variant report */
.impact { font: 600 12px var(--font); letter-spacing: .4px; padding: 3px 10px; border-radius: 999px; background: var(--border); color: var(--text); }
.impact.high { background: #d03a48; color: #fff; }
.impact.moderate { background: #e5671f; color: #fff; }
.impact.low { background: #2a9d68; color: #fff; }
.effect-title { margin: 8px 0 6px; font-size: 18px; }
.effect-title b { font: 600 22px var(--font-head); margin-right: 6px; }
.effect-title code { font-size: 14px; color: var(--muted); }
.effect-sum { color: var(--text); font-size: 15px; line-height: 1.7; margin-bottom: 14px; max-width: 760px; }
.nmd { font-size: 14px; line-height: 1.7; padding: 10px 14px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); border-left-width: 4px; margin: 0 0 14px; }
.nmd.likely { border-left-color: #d03a48; }
.nmd.escape { border-left-color: #e5671f; }
h3.mini { font-size: 14px; color: var(--muted); font-weight: 600; margin: 6px 0 8px; }
.protmap { position: relative; margin-bottom: 22px; }
.protmap svg { display: block; width: 100%; height: 34px; }
.protmap line { stroke: var(--text); stroke-width: 3; vector-effect: non-scaling-stroke; }
.protmap .lost { fill: var(--surface); opacity: .72; }
.pm-axis { position: relative; height: 16px; font-size: 12px; color: var(--muted); }
.pm-axis span { position: absolute; top: 0; }
.pm-axis span:first-child { left: 0; }
.pm-axis span:last-child { right: 0; }
.pm-axis span:nth-child(2) { transform: translateX(-50%); color: var(--text); font-weight: 600; white-space: nowrap; }
.align { overflow-x: auto; padding-bottom: 4px; }
.al-row { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.al-row > span { flex: 0 0 56px; font-size: 13px; color: var(--muted); }
.al-row > div { display: flex; white-space: nowrap; }
.al-row i {
  flex: 0 0 20px; width: 20px; height: 24px; margin-right: 2px; border-radius: 4px; font: 600 13px/24px ui-monospace, Consolas, monospace; text-align: center; font-style: normal;
  color: var(--text); background: var(--bg); border: 1px solid transparent;
}
.al-row i.hydrophobic { background: color-mix(in srgb, #f0ad2e 26%, transparent); }
.al-row i.polar { background: color-mix(in srgb, #2fa36b 24%, transparent); }
.al-row i.positive { background: color-mix(in srgb, #3b7ddd 24%, transparent); }
.al-row i.negative { background: color-mix(in srgb, #e2505c 24%, transparent); }
.al-row i.special { background: color-mix(in srgb, #a3a9b4 30%, transparent); }
.al-row i.stop { background: #8e44d9; color: #fff; }
.al-row i.diff { border-color: #e5671f; box-shadow: 0 0 0 1px #e5671f; }
.al-row i.gap { background: none; }
.al-pos b { font-size: 12px; color: #e5671f; display: inline-block; width: 20px; text-align: center; }

/* CRISPR */
.guides td.seq { text-align: left; }
.guides code { font: 13px ui-monospace, Consolas, monospace; letter-spacing: .5px; }
.guides code.pam { color: #e5671f; font-weight: 600; }
.guides th, .guides td { padding: 7px 9px; }
.guides td.notes { text-align: left; white-space: normal; min-width: 116px; font-size: 13px; color: var(--muted); }
.guides th:nth-child(2), .guides th:last-child { text-align: left; }
.score { display: inline-block; width: 36px; height: 6px; border-radius: 3px; background: var(--border); margin-right: 8px; vertical-align: middle; overflow: hidden; }
.score i { display: block; height: 100%; background: var(--accent); }
.tag-spec { white-space: nowrap; background: color-mix(in srgb, #2a9d68 18%, transparent); color: #1f7d52; font-size: 12px; padding: 1px 8px; margin: 0; }
[data-theme="dark"] .tag-spec { color: #5fd39b; }
#crispr .table-wrap { max-height: none; margin-bottom: 14px; }
.tpl { display: flex; gap: 10px; align-items: flex-start; }
.tpl code {
  flex: 1; min-width: 0; font: 12.5px/1.6 ui-monospace, Consolas, monospace; word-break: break-all; background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; letter-spacing: .5px;
}
.tpl mark { background: #e5671f; color: #fff; border-radius: 3px; padding: 0 1px; }

@media (max-width: 1100px) { .gm-viewer { height: 540px; } }
@media (max-width: 680px) {
  .gm-viewer { height: 440px; }
  .gm-key { display: none; }
  .gm-hud { font-size: 12px; padding: 7px 10px; }
  .gm-label { font-size: 11px; padding: 2px 7px; }
  .gm-caption { font-size: 16px; bottom: 40px; }
}
