/* Same look as FPLC-ed. */
:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #ffffff;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --hairline: #e1e0d9;
  --border: rgba(11, 11, 11, 0.10);
  --accent: #2a78d6;
  --accent-ink: #ffffff;
  --error: #d03b3b;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted: #898781;
    --hairline: #2c2c2a;
    --border: rgba(255, 255, 255, 0.10);
    --accent: #3987e5;
    --error: #e66767;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text-primary);
  font: 15px/1.45 var(--font);
}
h1 { margin: 0; font-size: 2.4rem; line-height: 1.1; }
h2 { margin: 0 0 0.75rem; font-size: 1.05rem; }

.top { padding: 1.5rem 2rem 1rem; max-width: 1600px; margin: 0 auto; }
.lede { margin: 0.25rem 0 0; color: var(--text-secondary); }
.version { font-size: 0.85rem; font-weight: 400; color: var(--text-muted); margin-left: 0.4rem; }
main { max-width: 1600px; margin: 0 auto; padding: 0 2rem 2rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}

.drop {
  border: 2px dashed var(--hairline);
  border-radius: 12px;
  background: var(--surface);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s;
}
.drop:hover, .drop:focus-visible, .drop.over { border-color: var(--accent); outline: none; }
.drop.compact { padding: 0.9rem; }
.drop.compact .drop-sub { display: none; }
.drop-title { margin: 0; font-size: 1.15rem; font-weight: 600; }
.drop-sub { margin: 0.4rem 0 0; color: var(--text-secondary); }
.status { margin: 0.5rem 0 0; color: var(--text-secondary); min-height: 1.2em; }
.status.error { color: var(--error); }

button.link {
  background: none; border: 0; padding: 0; font: inherit;
  color: var(--accent); cursor: pointer; text-decoration: underline;
}
.btn {
  font: inherit;
  color: inherit;
  background: var(--page);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.panel { margin-top: 1.25rem; }
details.panel > summary { font-weight: 600; font-size: 1.05rem; cursor: pointer; }
details.panel[open] > summary { margin-bottom: 0.75rem; }
.panel-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 900px) { .panel-grid { grid-template-columns: 1fr; } }

.controls { display: flex; flex-direction: column; gap: 0.9rem; }
fieldset {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.9rem 0.8rem;
}
legend { font-weight: 600; padding: 0 0.25rem; }
.hint { margin: 0.4rem 0 0; color: var(--text-muted); font-size: 0.85rem; }

label.slider { display: block; margin: 0.35rem 0 0.6rem; font-size: 0.92rem; }
label.slider output { float: right; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
label.slider > input { display: block; width: 100%; margin-top: 0.2rem; }
.slider-row { display: flex; align-items: center; gap: 0.35rem; margin-top: 0.15rem; }
.slider-row input { flex: 1; min-width: 0; }

/* Sliders: an empty track (no fill from the left) and a round thumb. Edit sliders start
   in the middle, so they get a tick there. */
input[type="range"] { -webkit-appearance: none; appearance: none; background: transparent; height: 18px; margin: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--hairline); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--hairline); }
input[type="range"]::-moz-range-progress { background: transparent; }
input[type="range"].centred::-webkit-slider-runnable-track {
  background: linear-gradient(to right, transparent calc(50% - 1px), var(--text-muted) calc(50% - 1px),
              var(--text-muted) calc(50% + 1px), transparent calc(50% + 1px)), var(--hairline);
}
input[type="range"].centred::-moz-range-track {
  background: linear-gradient(to right, transparent calc(50% - 1px), var(--text-muted) calc(50% - 1px),
              var(--text-muted) calc(50% + 1px), transparent calc(50% + 1px)), var(--hairline);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--accent); cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--accent); cursor: pointer;
}
input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.icon { flex: none; display: inline-flex; line-height: 0; }
.icon .before { fill: none; stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: 2 1.5; }
.icon .after { fill: color-mix(in srgb, var(--accent) 18%, transparent); stroke: var(--accent); stroke-width: 1.4; stroke-linejoin: round; }
.icon .frame { stroke: var(--text-muted); stroke-width: 1; }
label.row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin: 0.3rem 0 0.6rem; }
select {
  font: inherit; color: inherit; background: var(--page);
  border: 1px solid var(--border); border-radius: 6px; padding: 0.2rem 0.3rem;
}
input[type="number"] {
  font: inherit; color: inherit; background: var(--page);
  border: 1px solid var(--border); border-radius: 6px; padding: 0.25rem 0.4rem; width: 5rem;
}
.buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ladder-cards { display: flex; flex-direction: column; gap: 0.6rem; margin: 0.3rem 0 0.6rem; }
.ladder-card { border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem 0.6rem; background: var(--page); }
.ladder-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.35rem; }
.ladder-type { width: 100%; }
.ladder-note:empty { display: none; }
.ladder-card .ladder-note { color: var(--error); }

.view { min-width: 0; }
canvas.gel { display: block; width: 100%; height: auto; margin: 0 auto; border-radius: 6px; touch-action: none; }
/* Editor display box: fixed to the original image's shape; the edited image (which grows
   when rotated or skewed) is scaled down to fit inside it, never cut off. */
.stage {
  aspect-ratio: var(--ar, 2 / 1);
  margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: var(--page); border: 1px solid var(--border); border-radius: 6px; overflow: hidden;
}
.stage canvas { display: block; max-width: 100%; max-height: 100%; min-width: 0; min-height: 0; touch-action: none; }

.legend-key { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.9; margin: 0; }
.legend-key[hidden] { display: none; }
#show-profiles { align-self: flex-start; }
.key { display: inline-block; vertical-align: middle; margin: 0 0.3rem 0 0.6rem; }
.key:first-child { margin-left: 0; }
.key.profile { width: 18px; height: 2px; background: #2a78d6; }
.key.strip { width: 10px; height: 12px; background: rgba(42, 120, 214, 0.13); border: solid rgba(42, 120, 214, 0.5); border-width: 0 1px; }
.key.peak, .key.sat { width: 10px; height: 10px; border: 2px solid #d62a2a; border-radius: 50%; }
.key.sat { border-color: #000; }
.key.ladder { width: 10px; height: 10px; border-radius: 50%; background: #d62a2a; }
@media (prefers-color-scheme: dark) { .key.sat { border-color: #fff; } }
.key.shoulder { width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent;
                border-left: 9px solid #e8730c; }

#workspace[hidden] { display: none; }

#figure-card .buttons { margin-bottom: 0.5rem; }
canvas.figure { max-width: 100%; width: auto; border: 1px solid var(--border); border-radius: 4px; background: #fff; }

h3.sub { font-size: 0.95rem; margin: 1rem 0 0.4rem; }
.ladder-notes { display: flex; flex-direction: column; gap: 0.35rem; }
.ladder-note-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; flex-wrap: wrap; }
.ladder-note-row .ln-text { flex: 1; min-width: 14rem; }
.ladder-note-row .vol { display: flex; align-items: center; gap: 0.35rem; }
.unit-box { display: inline-flex; align-items: center; background: var(--page);
            border: 1px solid var(--border); border-radius: 6px; padding-right: 0.45rem; }
.unit-box:focus-within { outline: 2px solid var(--accent); outline-offset: -1px; }
.unit-box input, .ladder-notes .unit-box input, table.annot .unit-box input {
  border: 0; background: transparent; width: 4.5rem; outline: none; text-align: right; padding: 0.3rem 0.3rem; }
.unit-box .unit { color: var(--text-secondary); }
.lane-no { color: var(--text-secondary); white-space: nowrap; width: 4.5rem; flex: none; }
.annot-wrap { overflow-x: auto; }
table.annot { border-collapse: collapse; font-size: 0.9rem; user-select: none; }
table.annot th, table.annot td { padding: 0.15rem 0.35rem; text-align: left; vertical-align: middle; }
table.annot th { font-weight: 600; }
table.annot .lane-text { width: 18rem; }
.group-head { white-space: nowrap; }
.group-head .group-name { width: 8rem; }
.group-cell { width: 8.6rem; height: 1.7rem; border: 1px solid var(--border); background: var(--page); cursor: pointer; }
.group-cell.on { background: color-mix(in srgb, var(--accent) 35%, var(--page)); border-color: var(--accent); }
.ladder-notes input, table.annot input, #caption {
  font: inherit; color: inherit; background: var(--page);
  border: 1px solid var(--border); border-radius: 6px; padding: 0.3rem 0.45rem; min-width: 0;
}
.caption-label { display: block; font-weight: 600; margin: 0.9rem 0 0.3rem; }
#caption { display: block; width: 100%; resize: vertical; margin-bottom: 0.5rem; }
table.annot .lane-id { width: 5.5rem; resize: none; overflow: hidden; display: block; line-height: 1.3; font: inherit; color: inherit;
  background: var(--page); border: 1px solid var(--border); border-radius: 6px; padding: 0.3rem 0.45rem; }
.fig-show { font-size: 0.9rem; color: var(--text-secondary); margin: 0.4rem 0; display: flex; gap: 0.9rem; flex-wrap: wrap; }
.fig-show label { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--text-primary); }
details.sub-details { margin-top: 0.9rem; }
details.sub-details > summary { font-weight: 600; font-size: 0.95rem; cursor: pointer; }
details.sub-details[hidden] { display: none; }
table.band-table .band-name { font-weight: 600; white-space: nowrap; }
table.band-table .band-mw { white-space: nowrap; font-variant-numeric: tabular-nums; padding-right: 1rem; }
table.band-table .band-text { width: 22rem; }
table.annot .lane-text { width: 16rem; }
label.row.method-row { justify-content: flex-start; gap: 0.6rem; font-size: 0.9rem; }
.method-row[hidden], #antibody-box[hidden] { display: none; }
.method-row select, .method-row input, .antibody-row select, .antibody-row input {
  font: inherit; color: inherit; background: var(--page);
  border: 1px solid var(--border); border-radius: 6px; padding: 0.3rem 0.45rem;
}
#stain { width: 14rem; }
.antibodies { display: flex; flex-direction: column; gap: 0.4rem; margin: 0.3rem 0 0.5rem; }
.antibody-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.antibody-row .lane-no { width: 5.5rem; }
.antibody-row .ab-select { max-width: 32rem; }
.antibody-row .ab-text { width: 26rem; max-width: 100%; }
.antibody-row [hidden] { display: none; }
.ladder-sizes-label { display: block; margin: 0.4rem 0 0.2rem; font-size: 0.9rem; }
.ladder-sizes { display: block; width: 100%; box-sizing: border-box; margin-top: 0.2rem; resize: vertical; font: inherit; }
