/* Fiber Analyzer — tokens ---------------------------------------------------- */
:root {
  color-scheme: light;
  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --ink: #14161f;
  --ink-2: #4a4f60;
  --muted: #7a8093;
  --faint: #a7abbb;
  --border: rgba(20, 22, 31, 0.09);
  --rule: rgba(20, 22, 31, 0.06);
  --accent: #4f5bd5;
  --accent-ink: #ffffff;
  --accent-soft: rgba(79, 91, 213, 0.12);
  --danger: #d64545;
  --success: #2f9e5f;
  --shadow-card: 0 1px 2px rgba(20, 22, 31, 0.04), 0 14px 36px -20px rgba(20, 22, 31, 0.25);
  --shadow-pop: 0 12px 32px -12px rgba(20, 22, 31, 0.45);
  --glass: rgba(255, 255, 255, 0.78);
  --tooltip-bg: rgba(20, 22, 31, 0.92);
  --tooltip-ink: #f4f5f8;

  /* Chromatin entities: one hue each, in every panel. */
  /* Figure 1 colours: purple m6A, gray-green nucleosome calls, orange generated / blue observed fills. */
  --c-msp: #f6a04d;
  --c-msp-soft: rgba(246, 160, 77, 0.35);
  --c-nuc: #0a7869;
  --c-tf: #b23874;
  --c-m6a: #800080;
  --c-span: rgba(20, 22, 31, 0.1);
  --c-band: rgba(79, 91, 213, 0.06);
  --c-ref: #5b6472;
  --c-gene: #0d3b66;
  --c-obs: #5b8ff9;
  --fall-0: #ffffff;
  --fall-1: #ffffcd;
  --fall-2: #ffeda0;
  --fall-3: #fed977;
  --fall-4: #feb24c;
  --fall-5: #fd8c3c;
  --fall-6: #fc4e2a;
  --fall-7: #e2191c;
  --fall-8: #bd0026;
  --fall-9: #7d0025;
  --fall-10: #000000;
  --base-a: #2f9e5f;
  --base-c: #3b82c4;
  --base-g: #e0912a;
  --base-t: #d64545;
  --div-neg: #2a78d6;
  --div-mid: #eeeeee;
  --div-pos: #e34948;
  --nodata: #f0f1f4;

  /* Type follows tss.zhoulab.io (Tabler defaults): system stack, 14px/20px, labels and buttons 500, title 20px/600, chart text 12px. */
  --font: system-ui, -apple-system, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: Menlo, Consolas, "Liberation Mono", "Courier New", monospace;
  --gutter: 72px;
  --radius: 14px;
  --radius-sm: 8px;
  --ease: 160ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d0f15;
    --surface: #141722;
    --surface-2: #1a1e2b;
    --ink: #eceef6;
    --ink-2: #b6bbcd;
    --muted: #80869c;
    --faint: #5b617a;
    --border: rgba(255, 255, 255, 0.09);
    --rule: rgba(255, 255, 255, 0.06);
    --accent: #8d95ff;
    --accent-ink: #0d0f15;
    --accent-soft: rgba(141, 149, 255, 0.16);
    --danger: #ef6b6b;
    --success: #4cc27e;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.35), 0 18px 40px -22px rgba(0, 0, 0, 0.8);
    --shadow-pop: 0 12px 32px -12px rgba(0, 0, 0, 0.8);
    --glass: rgba(13, 15, 21, 0.72);
    --tooltip-bg: rgba(236, 238, 246, 0.94);
    --tooltip-ink: #14161f;
    --c-msp: #f6a04d;
    --c-msp-soft: rgba(246, 160, 77, 0.3);
    --c-nuc: #2f9a88;
    --c-tf: #e884be;
    --c-m6a: #c77dff;
    --c-span: rgba(236, 238, 246, 0.1);
    --c-band: rgba(141, 149, 255, 0.08);
    --c-ref: #aab0c4;
    --c-gene: #9ab8d8;
  --c-obs: #7fa9ff;
  --fall-0: #141722;
  --fall-1: #ffffcd;
  --fall-2: #ffeda0;
  --fall-3: #fed977;
  --fall-4: #feb24c;
  --fall-5: #fd8c3c;
  --fall-6: #fc4e2a;
  --fall-7: #e2191c;
  --fall-8: #bd0026;
  --fall-9: #7d0025;
  --fall-10: #000000;
    --base-a: #5ccf8a;
    --base-c: #6aa7ee;
    --base-g: #f0a84e;
    --base-t: #f07777;
    --div-neg: #4a8fe8;
    --div-mid: #2a2e3c;
    --div-pos: #ee6a6a;
    --nodata: #1b1f2c;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0f15;
  --surface: #141722;
  --surface-2: #1a1e2b;
  --ink: #eceef6;
  --ink-2: #b6bbcd;
  --muted: #80869c;
  --faint: #5b617a;
  --border: rgba(255, 255, 255, 0.09);
  --rule: rgba(255, 255, 255, 0.06);
  --accent: #8d95ff;
  --accent-ink: #0d0f15;
  --accent-soft: rgba(141, 149, 255, 0.16);
  --danger: #ef6b6b;
  --success: #4cc27e;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.35), 0 18px 40px -22px rgba(0, 0, 0, 0.8);
  --shadow-pop: 0 12px 32px -12px rgba(0, 0, 0, 0.8);
  --glass: rgba(13, 15, 21, 0.72);
  --tooltip-bg: rgba(236, 238, 246, 0.94);
  --tooltip-ink: #14161f;
  --c-msp: #f6a04d;
  --c-msp-soft: rgba(246, 160, 77, 0.3);
  --c-nuc: #2f9a88;
  --c-tf: #e884be;
  --c-m6a: #c77dff;
  --c-span: rgba(236, 238, 246, 0.1);
  --c-band: rgba(141, 149, 255, 0.08);
  --c-ref: #aab0c4;
  --c-gene: #9ab8d8;
  --c-obs: #7fa9ff;
  --fall-0: #141722;
  --fall-1: #ffffcd;
  --fall-2: #ffeda0;
  --fall-3: #fed977;
  --fall-4: #feb24c;
  --fall-5: #fd8c3c;
  --fall-6: #fc4e2a;
  --fall-7: #e2191c;
  --fall-8: #bd0026;
  --fall-9: #7d0025;
  --fall-10: #000000;
  --base-a: #5ccf8a;
  --base-c: #6aa7ee;
  --base-g: #f0a84e;
  --base-t: #f07777;
  --div-neg: #4a8fe8;
  --div-mid: #2a2e3c;
  --div-pos: #ee6a6a;
  --nodata: #1b1f2c;
}

/* Base ----------------------------------------------------------------------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 20px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); font-size: 14px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: no-preference) {
  .btn, .seg-btn, input, select, textarea, .card, .check { transition: background-color var(--ease), border-color var(--ease), color var(--ease), box-shadow var(--ease), transform var(--ease); }
}

/* Header ---------------------------------------------------------------------- */
.navbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.navbar-inner { display: flex; align-items: center; gap: 12px; height: 58px; padding: 0 24px; }
.logo { width: 38px; height: 38px; border-radius: 9px; }
.brand { font-weight: 600; font-size: 20px; letter-spacing: normal; }
.brand-sep { color: var(--faint); font-weight: 300; }
.brand-sub { color: var(--muted); font-size: 14px; }
.nav-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.home { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; border-radius: 8px; }
.home:hover .brand { color: var(--accent); }

/* Layout ---------------------------------------------------------------------- */
.page { display: grid; grid-template-columns: 276px minmax(0, 1fr); gap: 20px; padding: 20px 24px 40px; align-items: start; }
.side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 80px; max-height: calc(100vh - 96px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 2px 4px 10px 2px; margin: -2px -4px -10px -2px; }
.results { min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-card); }
.form { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span:first-child { font-size: 14px; font-weight: 500; color: var(--ink); }
input[type="text"], input[type="number"], select, textarea {
  width: 100%; padding: 8px 11px; height: 36px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--ink);
}
textarea { height: auto; resize: vertical; font-family: var(--mono); font-size: 14px; line-height: 20px; }
input:hover, select:hover, textarea:hover { border-color: rgba(127, 127, 140, 0.35); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
input.invalid, textarea.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(214, 69, 69, 0.14); }
select { appearance: none; -webkit-appearance: none; padding-right: 30px;
  background: var(--surface-2) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%237a8093' stroke-width='1.6' stroke-linecap='round'/></svg>") no-repeat right 11px center; }
.check { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14px; color: var(--ink-2); padding: 2px 0; }
.check:hover { color: var(--ink); }
.check input { accent-color: var(--accent); margin: 0; width: 15px; height: 15px; }
.sw { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.sw-m6a { background: var(--c-m6a); }
.sw-msp { background: var(--c-msp); }
.sw-nuc { background: var(--c-nuc); }
.sw-tf { background: var(--c-tf); }
.actions { display: flex; align-items: center; gap: 10px; padding-top: 2px; }
.status { color: var(--muted); font-size: 14px; display: inline-flex; align-items: center; gap: 8px; }
.status.busy::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--accent-soft); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
.status.error { color: var(--danger); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Buttons ---------------------------------------------------------------------- */
.btn {
  height: 34px; padding: 0 13px; font-weight: 500;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  cursor: pointer; white-space: nowrap; font-size: 14px;
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
}
.btn:hover { background: var(--surface-2); border-color: rgba(127, 127, 140, 0.35); }
.btn:active { transform: translateY(0.5px); }
.btn-primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); font-weight: 500; box-shadow: 0 6px 16px -8px var(--accent); }
.btn-primary:hover { filter: brightness(1.06); background: var(--accent); }
.btn-primary:disabled { opacity: 0.55; cursor: default; filter: none; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 14px; }
.btn.icon { width: 34px; padding: 0; justify-content: center; }
.btn-group { display: inline-flex; margin-left: auto; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.seg-btn { height: 28px; padding: 0 14px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-2); cursor: pointer; font-size: 14px; font-weight: 500; }
.seg-btn:hover { color: var(--ink); }
.seg-btn[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(20, 22, 31, 0.12), 0 0 0 1px var(--border); }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; flex: none; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); cursor: help; }

/* Results card ----------------------------------------------------------------- */
.card-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.results-head { align-items: center; gap: 10px; }
.head-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.head-line { display: flex; align-items: center; gap: 10px; min-width: 0; }
.head-note { font-size: 12px; line-height: 1.35; white-space: normal; }
.head-note[hidden] { display: none; }
#nav-help { flex: none; width: 26px; height: 26px; padding: 0; font-weight: 600; color: var(--muted); cursor: help; }
.card-head .btn-group { flex: none; }
.card-head .muted { flex: none; }
.card-title { font-weight: 500; font-size: 14px; white-space: nowrap; }
.note { color: var(--muted); font-size: 14px; margin: 10px 2px 0; }

.panels { position: relative; cursor: crosshair; user-select: none; outline: none; border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; }
.panels.panning { cursor: grabbing; }
.panel { position: relative; display: grid; grid-template-columns: var(--gutter) 1fr; border-top: 1px solid var(--rule); }
.panel-ruler { border-top: 0; background: var(--surface-2); }
.panel-head { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 10px 16px 4px 16px; min-height: 28px; }
.panel-title { font-size: 14px; font-weight: 500; color: var(--ink); }
.gutter { position: relative; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 12px; color: var(--muted); }
.gutter .ylab { position: absolute; right: 8px; transform: translateY(-50%); }
.gutter .glabel { position: absolute; left: 12px; top: 4px; font-family: var(--font); font-size: 12px; color: var(--faint); }
.gutter .gname { position: absolute; left: 12px; right: 6px; transform: translateY(-50%); font-family: var(--font); font-size: 12px; color: var(--muted); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gutter .gname b { display: block; font-weight: 600; color: var(--ink); }
.plot { display: block; width: 100%; }
.overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.legend .key { display: inline-flex; align-items: center; gap: 6px; }
.legend .line { width: 14px; height: 0; border-top: 2px solid; border-radius: 1px; }
.legend .area { width: 14px; height: 8px; border-radius: 2px; }
.colorbar { margin-left: auto; display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.colorbar .bar { width: 100px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--div-neg), var(--div-mid), var(--div-pos)); }

/* Loading shimmer */
.results.loading .panels::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 20%, rgba(127, 127, 160, 0.12) 50%, transparent 80%);
  background-size: 250% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.results.loading .plot { opacity: 0.55; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@media (prefers-reduced-motion: reduce) { .results.loading .panels::after, .status.busy::before { animation: none; } }

/* SVG chrome ------------------------------------------------------------------- */
svg text { fill: var(--muted); font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
svg text.base { font-size: 12px; fill: var(--ink); text-anchor: middle; }
svg text.base.alt { fill: var(--danger); font-weight: 700; }
svg .grid { stroke: var(--rule); stroke-width: 1; shape-rendering: crispEdges; }
svg .axis, svg .tick, svg .zero { stroke: var(--border); stroke-width: 1; shape-rendering: crispEdges; }
svg .variant { fill: var(--danger); }
svg .gene-line { stroke: var(--c-gene); stroke-width: 1; shape-rendering: crispEdges; }
svg .gene-chevron { fill: none; stroke: var(--c-gene); stroke-width: 1; }
svg .gene-exon { fill: var(--c-gene); rx: 1; }
svg text.gene-label { font-family: var(--font); font-size: 12px; font-style: italic; fill: var(--ink-2); }
svg .area-acc { fill: var(--c-msp-soft); }
svg .line-acc { stroke: var(--c-msp); stroke-width: 1.6; fill: none; stroke-linejoin: round; }
svg .line-other { stroke: var(--c-ref); stroke-width: 1.5; fill: none; stroke-linejoin: round; }
svg .line-nuc { stroke: var(--c-nuc); stroke-width: 1.4; fill: none; stroke-linejoin: round; }
svg .line-tf { stroke: var(--c-tf); stroke-width: 1.4; fill: none; stroke-linejoin: round; }
svg .area-delta-pos { fill: var(--div-pos); opacity: 0.35; }
svg .area-delta-neg { fill: var(--div-neg); opacity: 0.35; }
svg .line-delta { stroke: var(--ink); stroke-width: 1; fill: none; stroke-linejoin: round; opacity: 0.6; }
svg .crosshair { stroke: var(--ink); stroke-width: 1; shape-rendering: crispEdges; opacity: 0.5; }
svg .guide { stroke: var(--accent); stroke-width: 1; shape-rendering: crispEdges; opacity: 0.55; }
svg .variant-line { stroke: var(--danger); stroke-width: 1; shape-rendering: crispEdges; opacity: 0.6; }
svg .brush { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1; }
svg .row-hi { fill: var(--accent); opacity: 0.14; }
svg .cell-hi { fill: none; stroke: var(--ink); stroke-width: 1.5; }
svg .pos-label { fill: var(--surface); stroke: var(--border); }
svg text.pos-text { fill: var(--ink); font-size: 12px; }

/* Tooltip ---------------------------------------------------------------------- */
.tooltip {
  position: fixed; z-index: 50; pointer-events: none;
  background: var(--tooltip-bg); color: var(--tooltip-ink);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  padding: 8px 11px; border-radius: 10px; font-size: 12px; line-height: 1.45; max-width: 360px;
  box-shadow: var(--shadow-pop); border: 1px solid rgba(127, 127, 140, 0.18);
}
.tooltip .t-head { font-weight: 600; margin-bottom: 4px; }
.tooltip .t-row { display: flex; align-items: baseline; gap: 8px; }
.tooltip .t-row .k { display: inline-block; width: 12px; height: 0; border-top: 2px solid; flex: none; transform: translateY(-3px); border-radius: 1px; }
.tooltip .t-row .v { font-weight: 600; min-width: 46px; }
.tooltip .t-row .l { opacity: 0.75; font-family: var(--font); }
.tooltip .t-sub { opacity: 0.7; margin-top: 4px; font-size: 12px; }

@media (max-width: 960px) {
  .page { grid-template-columns: 1fr; }
  .form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; align-items: start; }
  .form > .field:has(textarea), .form > .seqstr-full, .form > .actions, .form > .job { grid-column: 1 / -1; }
  .side { position: static; max-height: none; overflow: visible; padding: 0; margin: 0; }
}

/* Job status and observed data ------------------------------------------------- */
.sw-obs { background: var(--c-obs); }
.job { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.job-row { display: flex; align-items: center; gap: 10px; white-space: nowrap; min-width: 0; }
.job-row #job-meta { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.btn-link { border: 0; background: transparent; padding: 0; font: inherit; font-size: 12px; color: var(--muted); cursor: pointer; }
.btn-link:hover { color: var(--danger); }
.job-state { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.job-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.job-state.queued::before { background: var(--faint); box-shadow: 0 0 0 3px rgba(127,127,140,0.18); }
.job-state.running::before { background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
.job-state.done::before { background: var(--success); }
.job-state.failed::before, .job-state.cancelled::before { background: var(--danger); }
.job-row .btn, .job-row .btn-link { margin-left: auto; flex: none; }
.job-log { margin: 0; padding: 8px 10px; max-height: 96px; overflow: auto; font-size: 11px; line-height: 1.4; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; white-space: pre-wrap; word-break: break-all; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .job-state.running::before { animation: none; } }
#observed-field select { margin-top: 2px; }
.legend .line.dashed { border-top-style: dashed; }
svg .line-obs { stroke: var(--c-obs); stroke-width: 1.5; fill: none; stroke-linejoin: round; stroke-dasharray: 4 3; }
svg .line-obs-tf { stroke: var(--c-obs); stroke-width: 1.2; fill: none; stroke-linejoin: round; stroke-dasharray: 2 3; opacity: 0.8; }

.empty { padding: 72px 24px; text-align: center; color: var(--muted); font-size: 14px; }

/* Figure 1 colour scale for co-accessibility and FiberHMM sub-label ------------- */
.colorbar.fall .bar { background: linear-gradient(90deg, var(--fall-0) 0%, var(--fall-1) 16%, var(--fall-2) 36%, var(--fall-3) 58%, var(--fall-4) 79%, var(--fall-5) 100%); border: 1px solid var(--border); }
.sublabel { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* Selection and navigation ------------------------------------------------------- */
svg .brush { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1; }
svg .brush-edge { stroke: var(--accent); stroke-width: 1.5; shape-rendering: crispEdges; }
svg .brush-label-bg { fill: var(--accent); }
svg text.brush-label { fill: var(--accent-ink); font-size: 12px; font-weight: 500; font-family: var(--mono); }
.panels.selecting { cursor: col-resize; }
.panels.pan-ready { cursor: grab; }
.btn:disabled { opacity: 0.45; cursor: default; }

/* Seqstr input ----------------------------------------------------------------- */
#seqstr, #variants { font-family: var(--mono); font-size: 12.5px; line-height: 1.45; }
.fmt-link { color: var(--accent); text-decoration: none; font-weight: 500; margin-left: 4px; }
.fmt-link:hover { text-decoration: underline; }
.seqstr-full { font-size: 11px; color: var(--muted); word-break: break-all; line-height: 1.4; min-height: 0; }
.seqstr-full:empty { display: none; }

/* "Try my luck": a random pre-sampled promoter window */
.btn.lucky::before { content: "✦ "; color: var(--accent); }

/* Review round: colourbar label, TSS arrows on the gene track */
.colorbar .cb-label { font-style: italic; margin-right: 4px; color: var(--muted); }
svg .gene-tss { stroke: var(--ink-2); stroke-width: 1.2; fill: none; }

/* Sequence track: one colour per base, letters when zoomed in */
.panel-seq { border-top: 0; background: var(--surface-2); }
.panel-seq .gutter .seq-row { position: absolute; left: 12px; transform: translateY(-50%); font-family: var(--font); font-size: 12px; color: var(--faint); white-space: nowrap; }

/* Phones: one compact nav row. The subtitle and the wordmark give way (the logo still
   links home), and the buttons tighten so nothing wraps or pushes the page sideways. */
@media (max-width: 640px) {
  .navbar-inner { gap: 8px; padding: 0 16px; }
  .brand-sep, .brand-sub, .home .brand { display: none; }
  .logo { width: 32px; height: 32px; }
  .nav-right { gap: 6px; }
  .nav-right .btn:not(.icon) { padding: 0 10px; font-size: 13px; }
  .page { padding: 16px 16px 32px; }
  .head-line { flex-wrap: wrap; row-gap: 4px; }
  .results-head { flex-wrap: wrap; row-gap: 10px; }
  .results-head .head-main { flex-basis: 100%; }
  .results-head #nav-help { margin-left: auto; }
  .results-head .btn-group { margin-left: 0; }
}
