/* Variant calling practical — layout using the original practical's theme.
   Shared controls come from app.css; the terminal theme comes from genomics.css. */
:root {
  --bg: #eef1f5;
  --panel: #ffffff;
  --panel-2: #f7f8fa;
  --panel-3: #eef1f5;
  --ink: #18212f;
  --ink-2: #384355;
  --muted: #647086;
  --line: #e0e5ec;
  --line-2: #cbd3de;
  --accent: #0b6b8a;
  --accent-2: #0a5a74;
  --accent-soft: #e2f1f6;
  --accent-ink: #ffffff;
  --good: #16794a;
  --bad: #b3261e;
  --warn: #8a5a00;
  --radius: 10px;
  --radius-s: 7px;
  --header-h: 52px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  /* Compatibility aliases for existing comparison and modal components. */
  --green: var(--accent);
  --paper: var(--bg);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button, a, label.import { touch-action: manipulation; }
button, .button {
  cursor: pointer;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-s);
  padding: 0.38em 0.8em;
  background: #fff;
  color: var(--ink);
  font-weight: 550;
  line-height: 1.3;
  transition: background 0.12s, border-color 0.12s;
}
button:hover, .button:hover { background: var(--panel-2); border-color: #b6c0ce; }
button:disabled { opacity: 0.55; cursor: wait; }
button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, a:focus-visible, summary:focus-visible,
label.import:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); }
a:hover { color: var(--accent-2); }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.quiet { font-size: 13px; }
.text-button { border: 0; background: transparent; padding: 0; color: var(--accent); font-size: 13px; text-align: left; }
.text-button:hover { background: transparent; color: var(--accent-2); text-decoration: underline; }
.small { font-size: 12px; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* Header and two-pane work area. */
.masthead {
  min-height: var(--header-h);
  padding: 7px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #10263a;
  color: #eaf2f8;
  border-bottom: 1px solid #0a1a28;
}
.masthead .brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: #eaf2f8; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-title { font-size: 16px; line-height: 1.25; font-weight: 700; }
.brand-sub { font-size: 12px; color: #9fb6c8; line-height: 1.4; }
.brand-light { font-weight: 500; }
.brand-icon { display: grid; place-items: center; width: 30px; height: 30px; background: #17344d; color: #3fb7a0; border-radius: 7px; }
.top-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.masthead button { background: #1c3a52; border-color: #2b5170; color: #eaf2f8; font-size: 13px; }
.masthead button:hover { background: #24496a; border-color: #3b647e; }
.masthead :focus-visible { outline-color: #8bd0ea; }
.edition, .local-badge { font-size: 12px; color: #9fb6c8; }
.eyebrow, .empty-glyph { display: none; }
main { display: grid; grid-template-columns: 330px minmax(0, 1fr); min-height: calc(100vh - var(--header-h)); margin: 0 auto; }
.brief { min-width: 0; padding: 20px 22px 28px; background: var(--panel); border-right: 1px solid var(--line); }
h1 { font: 700 24px/1.25 var(--font); margin: 0 0 12px; }
.intro { margin: 0 0 22px; font-size: 14px; color: var(--ink-2); line-height: 1.6; }
.field-label, .section-label { display: block; margin: 0 0 8px; color: var(--ink); font-size: 15px; line-height: 1.4; font-weight: 650; }
select, input[type=number] { min-width: 0; border: 1px solid var(--line-2); border-radius: 6px; padding: 6px 8px; background: #fff; }
#datasetSelect { width: 100%; margin: 0 0 10px; font-size: 13px; }
.dataset-info { font-size: 12px; line-height: 1.65; color: var(--muted); }
.dataset-info b { color: var(--ink-2); font-weight: 600; }
.dataset-stats { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0; }
.chip { display: inline-block; border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 7px; background: var(--panel-2); color: var(--ink-2); font-size: 11px; cursor: default; }
.dataset-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.dataset-actions .quiet { font-size: 12px; }
.import { display: inline-block; }
.brief-rule { border-top: 1px solid var(--line); margin: 20px 0; }
.question { margin: 8px 0; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.prompts { padding-left: 20px; margin: 10px 0 14px; font-size: 13px; color: var(--ink-2); }
.prompts li { margin: 7px 0; }
.note-label { display: block; margin: 8px 0 6px; color: var(--ink-2); font-size: 12px; }
textarea { border: 1px solid var(--line-2); border-radius: var(--radius-s); resize: vertical; padding: 8px 10px; background: var(--panel-2); color: var(--ink); line-height: 1.5; }
#notebook { width: 100%; min-height: 110px; font-size: 13px; }
.source-note { margin-top: 20px; font-size: 11px; color: var(--muted); line-height: 1.65; }
.workspace { min-width: 0; padding: 12px 14px 0; display: flex; flex-direction: column; background: var(--bg); }
.workspace-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 2px; margin-bottom: 10px; }
.workspace-top h2 { margin: 0; font-size: 18px; line-height: 1.35; font-weight: 650; }
#busyStatus { color: var(--muted); font-size: 12px; text-align: right; }
.tabs { display: flex; align-items: end; gap: 2px; padding: 6px 8px 0; background: var(--bg); border-bottom: 1px solid var(--line); }
.tabs button { position: relative; top: 1px; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; padding: 7px 14px 8px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; }
.tabs button:hover { background: rgba(255,255,255,.65); color: var(--ink); }
.tabs button.active { border-color: var(--line); background: #fff; color: var(--ink); }
.tabs button span { display: none; }
.panel { display: flex; flex-direction: column; min-width: 0; flex: 1; padding: 12px; background: #fff; border: 1px solid var(--line); border-top: 0; }
.panel[hidden] { display: none; }
.command-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; font-size: 13px; }
.command-strip b { display: block; font-size: 13px; font-weight: 600; }
.command-strip span { font-size: 12px; color: var(--muted); }
#termRoot { height: 430px; min-height: 330px; flex: 1; overflow: hidden; border: 1px solid #253241; border-radius: 7px; }
/* No terminal colour overrides: keep the original navy theme in genomics.css. */
.recipe { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--panel-2); }
.recipe summary { padding: 9px 12px; font-size: 13px; font-weight: 600; cursor: pointer; }
.recipe summary span { margin-left: 8px; font-size: 11px; font-weight: 400; color: var(--muted); }
.recipe textarea { display: block; width: calc(100% - 24px); min-height: 210px; margin: 0 12px 10px; padding: 9px 10px; background: #fff; font: 12px/1.5 var(--mono); white-space: pre; overflow: auto; }
.recipe-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; padding: 0 12px 11px; }
.recipe-footer select { font-size: 12px; }
.recipe-footer .primary { margin-left: auto; font-size: 12px; }
.runtime-note { padding-top: 10px; font-size: 11px; color: var(--muted); }
.workspace-footer { display: flex; justify-content: space-between; gap: 12px; padding: 10px 2px 12px; color: var(--muted); font-size: 11px; }

/* Comparison and instructions use the original practical's prose and tables. */
.light-panel { padding: 18px 22px 24px; }
.section-heading h3, .guide h3 { margin: 0 0 10px; font-size: 21px; line-height: 1.3; font-weight: 650; }
.section-heading p, .guide > p { max-width: 85ch; margin: 8px 0 16px; color: var(--ink-2); font-size: 14px; line-height: 1.6; }
.compare-controls { display: grid; grid-template-columns: 1fr 1fr 125px; gap: 12px; align-items: end; border-top: 1px solid var(--line); padding: 16px 0 12px; }
.compare-controls label { color: var(--ink-2); font-size: 12px; font-weight: 600; }
.compare-controls select, .compare-controls input[type=number] { display: block; width: 100%; margin-top: 5px; font-size: 12px; }
.compare-controls .checkbox { display: flex; align-items: center; align-self: center; gap: 6px; }
.compare-controls .primary { font-size: 12px; }
.empty-state { max-width: 520px; margin: 26px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--panel-2); text-align: left; }
.empty-state h4 { margin: 0 0 7px; font-size: 15px; font-weight: 650; }
.empty-state p { margin: 7px 0 12px; color: var(--ink-2); font-size: 13px; line-height: 1.6; }
.guide { max-width: 1000px; }
.guide-grid { display: block; margin: 20px 0; }
.guide-grid section { margin: 20px 0; }
.guide h4 { margin: 20px 0 7px; color: var(--ink); font-size: 16px; font-weight: 650; }
.guide-grid p, .guide details p { margin: 7px 0 12px; max-width: 85ch; color: var(--ink-2); font-size: 14px; line-height: 1.65; }
.guide details { border-top: 1px solid var(--line); padding: 13px 0; }
.guide summary { font-weight: 650; font-size: 14px; cursor: pointer; }
.guide pre { padding: 11px 13px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-s); overflow: auto; font: 12px/1.5 var(--mono); }
.guide table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 12px; }
#capabilityTable { max-width: 100%; overflow-x: auto; }
.guide th, .guide td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.guide th { background: var(--panel-2); font-weight: 650; color: var(--ink-2); }
.comparison-result { min-width: 0; overflow: auto; }
.comparison-result table { width: 100%; border-collapse: collapse; font: 12px/1.5 var(--mono); }
.comparison-result th, .comparison-result td { padding: 7px 8px; text-align: left; border-bottom: 1px solid var(--line); }
.comparison-result th { background: var(--panel-2); }
.comparison-result button, .comparison-result select { font-size: 12px; }
.comparison-result [role=alert] { color: var(--warn); }

/* Keep the Galaxy forms consistent even though their component injects CSS. */
#galaxyRoot.galaxy-lab { border-color: var(--line); border-radius: var(--radius-s); color: var(--ink); font-family: var(--font); }
#galaxyRoot .gl-tools, #galaxyRoot .gl-history { background: var(--panel-2); border-color: var(--line); }
#galaxyRoot .gl-workspace { background: #fff; padding: 20px; }
#galaxyRoot .gl-eyebrow { display: none; }
#galaxyRoot .gl-heading { margin-bottom: 10px; font-size: 21px; font-weight: 650; letter-spacing: normal; }
#galaxyRoot .gl-column-title { font-size: 14px; }
#galaxyRoot .gl-group-title { color: var(--ink-2); font-size: 12px; font-weight: 650; text-transform: none; letter-spacing: normal; }
#galaxyRoot .gl-tool { color: var(--ink); }
#galaxyRoot .gl-tool:hover { background: var(--panel-3); }
#galaxyRoot .gl-tool[aria-pressed="true"] { color: var(--accent-2); border-color: #bfdfe9; background: var(--accent-soft); }
#galaxyRoot .gl-tool strong { font-size: 12px; }
#galaxyRoot .gl-tool small { font-size: 11px; color: var(--muted); }
#galaxyRoot .gl-description { color: var(--ink-2); font-size: 13px; line-height: 1.6; }
#galaxyRoot .gl-field { font-size: 12px; color: var(--ink-2); }
#galaxyRoot .gl-field input, #galaxyRoot .gl-field select, #galaxyRoot .gl-field textarea { padding: 7px 8px; color: var(--ink); border-color: var(--line-2); font-size: 12px; }
#galaxyRoot .gl-hint, #galaxyRoot .gl-status, #galaxyRoot .gl-empty { color: var(--muted); font-size: 11px; }
#galaxyRoot .gl-command-block { border-color: var(--line); background: var(--panel-2); }
#galaxyRoot .gl-command-top { border-color: var(--line); color: var(--muted); font-size: 11px; text-transform: lowercase; }
#galaxyRoot .gl-command-top > span { display: block; }
#galaxyRoot .gl-command-top > span::first-letter { text-transform: uppercase; }
#galaxyRoot .gl-command { color: var(--ink-2); font-size: 12px; }
#galaxyRoot .gl-small-button { color: var(--ink); border-color: var(--line-2); font-size: 11px; text-transform: none; }
#galaxyRoot .gl-run { padding: 7px 12px; border: 1px solid var(--accent); border-radius: var(--radius-s); background: var(--accent); color: white; font-weight: 600; font-size: 13px; }
#galaxyRoot .gl-run:hover { background: var(--accent-2); border-color: var(--accent-2); }
#galaxyRoot .gl-job { border-color: var(--line); border-left-color: var(--line-2); color: var(--ink-2); }
#galaxyRoot .gl-job[aria-pressed="true"] { background: var(--accent-soft); }
#galaxyRoot .gl-job[data-status="success"] { border-left-color: var(--good); }
#galaxyRoot .gl-job[data-status="error"] { border-left-color: var(--bad); }
#galaxyRoot .gl-job[data-status="running"] { border-left-color: var(--accent); }
#galaxyRoot .gl-job strong { font-size: 12px; }
#galaxyRoot .gl-job small { font-size: 11px; color: var(--muted); }
#galaxyRoot .gl-file-list, #galaxyRoot .gl-job-detail { border-color: var(--line); }
#galaxyRoot .gl-file { color: var(--accent); font-size: 11px; }
#galaxyRoot .gl-file:hover { background: var(--accent-soft); }
#galaxyRoot .gl-job-detail .gl-log { background: var(--panel-2); font-size: 11px; }
#galaxyRoot .gl-error { color: var(--bad); }
#galaxyRoot button:focus-visible, #galaxyRoot input:focus-visible,
#galaxyRoot select:focus-visible, #galaxyRoot textarea:focus-visible,
#galaxyRoot summary:focus-visible { outline-color: var(--accent); }

.notice { position: fixed; right: 20px; bottom: 20px; max-width: min(500px, calc(100vw - 40px)); z-index: 100; padding: 12px 16px; border: 1px solid #bfdfe9; border-radius: var(--radius); background: var(--accent-soft); color: var(--ink); box-shadow: 0 4px 20px rgba(16,24,40,.15); font-size: 13px; }
.notice.error { background: #fdeceb; border-color: #edc5c3; }
.error-message { color: var(--bad); padding: 12px; border: 1px solid #edc5c3; border-radius: var(--radius-s); background: #fdeceb; }
.spinner { display: inline-block; width: 13px; height: 13px; border: 2px solid #9fb6c8; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon { width: 16px; height: 16px; vertical-align: middle; }
.modal-backdrop { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; background: rgba(15,23,32,.45); }
.modal-backdrop .modal { width: min(850px, 100%); max-height: 85vh; overflow: auto; padding: 20px; background: #fff; border-radius: var(--radius); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal table { width: 100%; border-collapse: collapse; font-size: 13px; }
.modal td, .modal th { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; }
code { font-family: var(--mono); font-size: .92em; overflow-wrap: anywhere; }

@media (min-width: 1500px) {
  main { grid-template-columns: 370px minmax(0, 1fr); }
  .brief { padding: 22px 26px 30px; }
  .workspace { padding: 14px 18px 0; }
  #termRoot { height: 480px; }
}
@media (max-width: 1100px) {
  main { grid-template-columns: 285px minmax(0, 1fr); }
  .brief { padding: 18px; }
  .workspace { padding: 12px 10px 0; }
  .compare-controls { grid-template-columns: 1fr 1fr; }
  .command-strip span { display: none; }
  #galaxyRoot.galaxy-lab { grid-template-columns: 145px minmax(0, 1fr); }
  #galaxyRoot .gl-workspace { padding: 18px 14px; }
  #galaxyRoot .gl-history { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); }
  #galaxyRoot .gl-history-jobs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #galaxyRoot .gl-job { margin: 0; }
}
@media (max-width: 760px) {
  .masthead { padding: 8px 12px; flex-wrap: wrap; gap: 8px 12px; }
  .brand-title { font-size: 15px; }
  .brand-sub { font-size: 11px; }
  .masthead button { font-size: 12px; }
  main { display: block; }
  .brief { border-right: 0; border-bottom: 1px solid var(--line); padding: 20px; }
  .brief h1 { font-size: 23px; }
  .workspace { padding: 12px 10px 0; }
  .workspace-top { align-items: start; }
  .workspace-top h2 { font-size: 17px; }
  #busyStatus { font-size: 11px; }
  .tabs { gap: 0; padding-left: 4px; padding-right: 4px; }
  .tabs button { flex: 1; padding: 7px 8px; font-size: 13px; }
  .panel { padding: 10px; }
  .light-panel { padding: 16px; }
  .compare-controls { grid-template-columns: 1fr; }
  .recipe summary span { display: none; }
  .recipe-footer .primary { margin-left: 0; }
  .command-strip { align-items: start; }
  .command-strip b, .command-strip .quiet { font-size: 12px; }
  #termRoot { height: 430px; min-height: 330px; }
  .term-title { max-width: 160px; }
  .term-status { max-width: 140px; white-space: normal; }
  .term-screen { padding: 10px 10px 16px; font-size: 12px; }
  .term-input { font-size: 12px; }
  .term-files { width: 160px; }
  .workspace-footer { flex-wrap: wrap; font-size: 10px; }
  .empty-state { margin: 20px 0; }
}
@media (max-width: 500px) {
  #galaxyRoot.galaxy-lab { grid-template-columns: minmax(0, 1fr); }
  #galaxyRoot .gl-history-jobs { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
  .masthead .brand { gap: 7px; }
  .brand-mark { width: 27px; height: 27px; }
  .top-actions { margin-left: 34px; }
  .command-strip { flex-wrap: wrap; gap: 8px; }
  .recipe-footer select, .recipe-footer .primary { width: 100%; }
  .term-title { max-width: 105px; }
  .term-status { max-width: 85px; font-size: 10px; }
  .term-files { width: 140px; }
  #galaxyRoot .gl-workspace { padding: 16px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  button, .button { transition: none; }
  .spinner { animation-duration: 1.8s; }
}
