/* locus.geneticker.com — overlay on the shared Geneticker theme (styles.css, imported
   verbatim from Cipher). This sheet (1) sets Locus's own accent so it reads as a
   sibling of Cipher (teal) / Decipher (indigo) / Swap (violet) — Locus is CYAN — and
   (2) adds the components unique to the genome workbench: dataset cards, the chart
   primitives, the multi-track browser stage, QC flags and the dense virtual tables.

   DARK-MODE RULE (see darkmode-token-traps): every token and every hard-coded
   accent-rgba rule below is declared THREE times — light :root, explicit
   [data-theme="dark"], and the @media prefers-dark block. Both dark blocks are
   byte-identical. Add to all three or the theme flip will miss one path. */

/* ---------------------------------------------------------------- accent */
:root {
  --locus:      #0e7490;   /* cyan-700 — Locus accent (AA on white as text) */
  --locus-h:    #155e75;   /* cyan-800 */
  --locus-on:   #fff;      /* foreground ON the accent */
  --locus-soft: rgba(14,116,144,.10);
  --locus-line: rgba(14,116,144,.40);
  --teal:   #0e7490;       /* remap the family accent token so brand/eyebrow/.btn-teal inherit Locus cyan */
  --teal-h: #155e75;
  --indigo: #4f46e5;       /* series colours referenced by charts.js (cipher's sheet lacks indigo) */
  --plum:   #7c3aed;
  --gb-bg:  #0b1020;       /* browser canvas surface — deliberately dark in BOTH themes */
  --zone-good: rgba(13,144,79,.10);
  --zone-mid:  rgba(227,116,0,.10);
  --zone-bad:  rgba(217,48,37,.10);
}
:root[data-theme="dark"] {
  --locus:      #22d3ee;   /* cyan-400 */
  --locus-h:    #67e8f9;   /* cyan-300 */
  --locus-on:   #06222b;
  --locus-soft: rgba(34,211,238,.14);
  --locus-line: rgba(34,211,238,.5);
  --teal:   #22d3ee;
  --teal-h: #67e8f9;
  --indigo: #7c73ff;
  --plum:   #a78bfa;
  --zone-good: rgba(40,180,99,.12);
  --zone-mid:  rgba(245,166,35,.10);
  --zone-bad:  rgba(255,107,94,.12);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --locus:      #22d3ee;
    --locus-h:    #67e8f9;
    --locus-on:   #06222b;
    --locus-soft: rgba(34,211,238,.14);
    --locus-line: rgba(34,211,238,.5);
    --teal:   #22d3ee;
    --teal-h: #67e8f9;
    --indigo: #7c73ff;
    --plum:   #a78bfa;
    --zone-good: rgba(40,180,99,.12);
    --zone-mid:  rgba(245,166,35,.10);
    --zone-bad:  rgba(255,107,94,.12);
  }
}

/* Re-tint the places Cipher hard-coded its teal rgba (light + both dark blocks). */
.brand .logo { background: linear-gradient(135deg, var(--locus), #0891b2); }
.side-item.active { background: var(--locus-soft); color: var(--locus-h); }
.side-item.active .si-badge { background: var(--locus-soft); color: var(--locus-h); }
:root[data-theme="dark"] .side-item.active { background: var(--locus-soft); color: var(--locus-h); }
:root[data-theme="dark"] .side-item.active .si-badge { background: var(--locus-soft); color: var(--locus-h); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .side-item.active { background: var(--locus-soft); color: var(--locus-h); }
  :root:not([data-theme="light"]) .side-item.active .si-badge { background: var(--locus-soft); color: var(--locus-h); }
}

/* ---------------------------------------------------------------- shell / views */
.content { flex: 1; min-width: 0; }
.view { display: none; }
.view.show { display: block; animation: lc-fade .14s ease; }
@keyframes lc-fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; } }

.lc-offline-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--locus-line); background: var(--locus-soft); color: var(--locus-h); font-family: var(--display); font-weight: 600; font-size: 12px; white-space: nowrap; }
.lc-offline-chip .material-icons-outlined { font-size: 15px; }
@media (max-width: 640px) { .lc-offline-chip span:last-child { display: none; } }

/* ---------------------------------------------------------------- dataset manager */
.ds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-top: 18px; }
.ds-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ds-card.err { border-color: rgba(217,48,37,.4); }
.ds-head { display: flex; align-items: flex-start; gap: 10px; }
.ds-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--locus-soft); color: var(--locus-h); }
.ds-name { font-family: var(--mono); font-size: 12.5px; font-weight: 500; color: var(--ink); word-break: break-all; line-height: 1.35; }
.ds-sub { font-size: 11.5px; color: var(--ink3); margin-top: 2px; }
.ds-note { font-size: 12px; color: var(--ink2); }
.ds-actions { display: flex; gap: 6px; margin-top: 2px; flex-wrap: wrap; }
.ds-err { font-family: var(--mono); font-size: 11.5px; color: var(--red-ink); background: rgba(217,48,37,.08); border: 1px solid rgba(217,48,37,.25); border-radius: 8px; padding: 8px 10px; overflow-wrap: anywhere; }

.kind-badge { font-family: var(--display); font-size: 10px; font-weight: 700; letter-spacing: .5px; padding: 2px 8px; border-radius: 999px; flex: none; }
.kind-badge.vcf   { background: rgba(79,70,229,.12);  color: #4f46e5; }
.kind-badge.fasta { background: rgba(13,144,79,.12);  color: var(--green); }
.kind-badge.fastq { background: rgba(227,116,0,.12);  color: var(--amber-ink); }
.kind-badge.gfa   { background: rgba(124,58,237,.12); color: var(--violet-ink); }
.kind-badge.bed   { background: rgba(26,115,232,.12); color: var(--blue-ink); }
.kind-badge.gff   { background: rgba(26,115,232,.12); color: var(--blue-ink); }
:root[data-theme="dark"] .kind-badge.vcf { color: #a5b4fc; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .kind-badge.vcf { color: #a5b4fc; } }

.qc-flag { display: inline-flex; align-items: center; gap: 4px; font-family: var(--display); font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.qc-flag .material-icons-outlined { font-size: 14px; }
.qc-flag.pass { background: rgba(13,144,79,.12); color: var(--green); }
.qc-flag.warn { background: rgba(227,116,0,.13); color: var(--amber-ink); }
.qc-flag.fail { background: rgba(217,48,37,.12); color: var(--red-ink); }
.qc-flag.info { background: var(--panel2); color: var(--ink2); }

.lc-picker { display: inline-flex; align-items: center; gap: 7px; }
.lc-picker .material-icons-outlined { font-size: 17px; color: var(--ink3); }

/* ---------------------------------------------------------------- toolbars, inputs */
.lc-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); margin-top: 16px; }
.lc-toolbar label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--ink3); }
.lc-toolbar .sep { width: 1px; align-self: stretch; background: var(--line2); margin: 0 2px; }
.gb-select, .gb-input { padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-family: var(--mono); font-size: 12px; }
.gb-input:focus, .gb-select:focus { outline: none; border-color: var(--locus); box-shadow: 0 0 0 1px var(--locus); }
.gb-input.wide { min-width: 220px; }

/* segmented control */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { border: none; background: var(--panel); color: var(--ink2); font-family: var(--display); font-weight: 600; font-size: 12px; padding: 7px 12px; }
.seg button + button { border-left: 1px solid var(--line2); }
.seg button.on { background: var(--locus-soft); color: var(--locus-h); }

/* ---------------------------------------------------------------- browser stage */
.gb-stage { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--gb-bg); box-shadow: var(--shadow); margin-top: 14px; position: relative; }
.gb-canvas { display: block; width: 100%; cursor: crosshair; touch-action: none; }
.gb-scroll { height: 14px; background: var(--panel2); position: relative; cursor: pointer; }
.gb-scroll .gb-thumb { position: absolute; top: 2px; height: 10px; border-radius: 999px; background: var(--locus); min-width: 24px; opacity: .85; }
.gb-minimap { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); padding: 12px 14px; margin-top: 12px; }
.gb-ideogram { position: relative; height: 26px; border-radius: 6px; background: linear-gradient(90deg, var(--panel2), var(--line2)); overflow: hidden; cursor: pointer; border: 1px solid var(--line); }
.gb-ideogram .ig-view { position: absolute; top: 0; bottom: 0; background: var(--locus-soft); border-left: 1px solid var(--locus); border-right: 1px solid var(--locus); }
.gb-ideogram .ig-mark { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--plum); }
.gb-legend { display: flex; flex-wrap: wrap; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); margin-top: 12px; font-size: 12px; color: var(--ink2); }
.gb-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.gb-legend .lg-sw { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.gb-status { display: flex; align-items: center; gap: 14px; font-family: var(--mono); font-size: 11.5px; color: var(--ink3); padding: 8px 4px 0; flex-wrap: wrap; }
.gb-tip { position: fixed; z-index: 120; max-width: 340px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 10px 12px; font-size: 12px; color: var(--ink); pointer-events: none; }
.gb-tip .t-h { font-family: var(--mono); font-size: 11px; color: var(--locus-h); margin-bottom: 4px; }

/* track config rows under the stage */
.trk-list { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.trk-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-size: 12.5px; }
.trk-row .t-name { font-family: var(--mono); font-size: 11.5px; color: var(--ink); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trk-row .t-kind { font-size: 10.5px; color: var(--ink3); text-transform: uppercase; letter-spacing: .4px; }

/* ---------------------------------------------------------------- charts */
.chart { width: 100%; display: block; }
.chart-empty { display: grid; place-items: center; gap: 6px; padding: 34px 16px; color: var(--ink3); font-size: 12.5px; text-align: center; border: 1px dashed var(--line); border-radius: 12px; }
.chart-empty .material-icons-outlined { font-size: 30px; }
.grid-line { stroke: var(--line2); stroke-width: 1; }
.grid-line.strong { stroke: var(--ink3); }
.axis-label { fill: var(--ink3); font-size: 10px; font-family: var(--mono); }
.series-line { fill: none; stroke: var(--locus); stroke-width: 2; vector-effect: non-scaling-stroke; }
.series-area { fill: var(--locus-soft); stroke: none; }
.dot { fill: var(--locus); }
.bar { fill: var(--locus); opacity: .85; }
.bar.dim { fill: var(--ink3); opacity: .4; }
.bar.warn { fill: var(--amber); }
.bar.bad { fill: var(--red); }
.zone.good { fill: var(--zone-good); }
.zone.mid { fill: var(--zone-mid); }
.zone.bad { fill: var(--zone-bad); }
.bw-box { fill: var(--locus-soft); stroke: var(--locus); stroke-width: 1; }
.bw-med { stroke: var(--red); stroke-width: 1.4; }
.bw-whisk { stroke: var(--ink3); stroke-width: 1; }
.bw-mean { fill: none; stroke: var(--blue); stroke-width: 1.4; stroke-dasharray: 4 3; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; font-size: 12px; color: var(--ink2); }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.qualifier { font-size: 11.5px; color: var(--ink3); margin-top: 6px; }

.hbars { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 220px) auto 1fr; align-items: center; gap: 10px; font-size: 12.5px; }
.hbar .hb-lab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-size: 11.5px; }
.hbar .hb-val { color: var(--ink3); font-family: var(--mono); font-size: 11px; white-space: nowrap; }
.hbar .hb-track { height: 8px; border-radius: 999px; background: var(--panel2); overflow: hidden; }
.hbar .hb-fill { display: block; height: 100%; border-radius: 999px; background: var(--locus); }

.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 10px; }
.donut-legend { display: flex; flex-direction: column; gap: 6px; min-width: 180px; }
.donut-legend .dl { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink); }
.donut-legend .dl i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.donut-legend .dl .n { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--ink3); }

.mx { display: grid; gap: 2px; margin-top: 12px; font-size: 10.5px; overflow-x: auto; }
.mx-h, .mx-l { font-family: var(--mono); color: var(--ink3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; align-self: center; }
.mx-h { text-align: center; }
.mx-l { padding-right: 6px; text-align: right; }
.mx-c { border-radius: 4px; min-height: 26px; display: grid; place-items: center; }
.mx-c i { font-style: normal; font-family: var(--mono); font-size: 9.5px; color: var(--ink); mix-blend-mode: normal; }

/* ---------------------------------------------------------------- dense tables */
.table-scroll { overflow-x: auto; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-top: 16px; }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line2); flex-wrap: wrap; }
.panel-head h3 { font-family: var(--display); font-weight: 700; font-size: 15px; }
.panel-head .spacer { flex: 1; }
.panel-body { padding: 16px 18px; }
table.lc { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.lc th, table.lc td { text-align: left; padding: 9px 12px; white-space: nowrap; }
table.lc th { font-family: var(--display); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink3); background: var(--panel2); border-bottom: 1px solid var(--line); user-select: none; position: sticky; top: 0; }
table.lc th[data-sort] { cursor: pointer; }
table.lc th[data-sort]:hover { color: var(--ink); }
table.lc td { border-bottom: 1px solid var(--line2); }
table.lc tbody tr { transition: background .1s; }
table.lc tbody tr:hover { background: var(--panel2); }
table.lc tbody tr.row-link { cursor: pointer; }
table.lc td.num, table.lc th.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 11.5px; }
table.lc .empty-row td { text-align: center; color: var(--ink3); padding: 36px; font-size: 13px; white-space: normal; }
.vt-scroll { max-height: 520px; overflow-y: auto; }

/* filter chip row */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.fchip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink2); font-family: var(--display); font-weight: 600; font-size: 11.5px; cursor: pointer; transition: .12s; }
.fchip:hover { border-color: var(--locus); color: var(--locus-h); }
.fchip.on { background: var(--locus-soft); border-color: var(--locus-line); color: var(--locus-h); }
.fchip .material-icons-outlined { font-size: 14px; }

/* ---------------------------------------------------------------- sequence views */
.seq-block { font-family: var(--mono); font-size: 12.5px; line-height: 1.9; word-break: break-all; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; overflow-x: auto; }
.seq-block .b-A { color: var(--green); }
.seq-block .b-C { color: var(--blue); }
.seq-block .b-G { color: var(--amber-ink); }
.seq-block .b-T, .seq-block .b-U { color: var(--red-ink); }
.seq-block .b-N { color: var(--ink3); }
.seq-block .pos { color: var(--ink3); user-select: none; margin-right: 10px; }
.mono-block { font-family: var(--mono); font-size: 11.5px; background: var(--panel2); border: 1px solid var(--line2); border-radius: 8px; padding: 10px 12px; overflow-x: auto; white-space: pre; color: var(--ink2); }

/* ---------------------------------------------------------------- misc */
.lc-kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 7px; background: var(--panel2); color: var(--ink2); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 980px) { .two-col { grid-template-columns: 1fr; } }
.pill-count { font-family: var(--mono); font-size: 10.5px; padding: 1px 7px; border-radius: 999px; background: var(--panel2); color: var(--ink2); }
