/* LabConsole styles. Ported from round 3 (inputs/sketches/round3/src/console.css).
   Theming is only through the --lc-* custom properties below (documented in API.md). Defaults sit in :where(:root),
   which has no specificity, so any rule a variant writes (on :root, body or a container) wins.
   Independent concept study by Mason Capalongo. Not affiliated with or endorsed by Colossal Biosciences. */
:where(:root) {
  --lc-ground: #e8e9f1;        /* what the console sits on */
  --lc-surface: #f3f3f8;       /* the results list */
  --lc-ink: #1e2440;           /* main text */
  --lc-muted: #474e6e;         /* secondary text and the answer during its first 360 ms: keep at 4.5:1 or more on ground and surface */
  --lc-link: var(--lc-ink);
  --lc-focus: var(--lc-ink);   /* focus outlines */
  --lc-line: var(--lc-muted);  /* the blank's underline */
  --lc-line-focus: var(--lc-ink);
  --lc-active-bg: var(--lc-ground);  /* highlighted match in the list */
  --lc-mark-ink: #1e2440;      /* own DNA solid, stripes and dots: the strongest mark color, highest contrast on the ground */
  --lc-mark-plate: #c9cbda;    /* base plate of every kind except "likely tells it apart" (quiet) */
  --lc-mark-b1: #8a5a12;       /* base plate of "likely tells it apart": lower contrast than --lc-mark-ink, never louder */
  --lc-font-ui: "Schibsted Grotesk Variable", "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --lc-font-sci: "Newsreader Variable", "Newsreader", Georgia, "Times New Roman", serif;
  --lc-size-sentence: 22px;    /* "If ___ is found:" and the ruled sentence */
  --lc-size-sentence-phone: 20px;
  --lc-size-name: 17px;
  --lc-size-body: 15px;
  --lc-size-small: 13px;       /* never set below 13px */
  --lc-weight-sentence: 500;
  --lc-large-scale: 4;         /* large mark: 1 mark unit = 4 px (20 x 136 px) */
  --lc-large-scale-phone: 5;
  --lc-gap: 24px;
  --lc-radius: 0px;
  --lc-shadow: 0 8px 28px rgba(20, 24, 48, 0.16);
  --lc-results-max-h: 340px;
  --lc-rise-z: 60;
  --lc-seq-a: var(--lc-ink);   /* base letters in the sequence strip: all one tone by default (no meaning in hue) */
  --lc-seq-c: var(--lc-ink);
  --lc-seq-g: var(--lc-ink);
  --lc-seq-t: var(--lc-ink);
}

/* ---------- shared ---------- */
.lc { color: var(--lc-ink); font-family: var(--lc-font-ui); font-size: var(--lc-size-body); line-height: 1.47; }
.lc *, .lc *::before, .lc *::after { box-sizing: border-box; }
.lc p, .lc h2, .lc h3, .lc h4, .lc h5, .lc h6 { margin: 0; }
.lc [hidden] { display: none !important; }
.lc a { color: var(--lc-link); text-decoration-line: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.lc a:hover { text-decoration-thickness: 2px; }
.lc :focus-visible { outline: 2px solid var(--lc-focus); outline-offset: 2px; }
.lc-sci { font-family: var(--lc-font-sci); font-style: italic; font-weight: 400; }
.lc-vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.lc-mark .lc-ink { fill: var(--lc-mark-ink); }
.lc-mark .lc-plate { fill: var(--lc-mark-plate); }
.lc-mark .lc-b1 { fill: var(--lc-mark-b1); }
svg.lc-mark { display: inline-block; vertical-align: middle; overflow: visible; }

/* ---------- the sentence: the blank is the search box ---------- */
.lc-sentence { position: relative; }
.lc-if { font-size: var(--lc-size-sentence); line-height: 1.36; font-weight: var(--lc-weight-sentence); display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 0.3em; row-gap: 4px; }
.lc-blank { position: relative; display: inline-block; vertical-align: baseline; max-width: 100%; }
.lc-input { appearance: none; -webkit-appearance: none; border: 0; border-radius: 0; border-bottom: 2px solid var(--lc-line); background: transparent; margin: 0;
  font-family: var(--lc-font-sci); font-style: italic; font-weight: 400; font-size: var(--lc-size-sentence); line-height: 1.36; color: var(--lc-ink);
  padding: 0 4px; width: 12em; max-width: 100%; min-width: 0; }
.lc-input::placeholder { color: var(--lc-muted); opacity: 1; }
/* focus: the underline turns ink and thickens (inset, so nothing shifts) over a light tint of the ink */
.lc-input:focus, .lc-input:focus-visible { outline: none; border-bottom-color: var(--lc-line-focus); box-shadow: inset 0 -1px 0 var(--lc-line-focus); background: color-mix(in srgb, var(--lc-focus) 8%, transparent); }
.lc-ghost { position: absolute; left: 0; top: 0; padding: 0 4px; font-family: var(--lc-font-sci); font-style: italic; font-weight: 400; font-size: var(--lc-size-sentence); line-height: 1.36; white-space: pre; pointer-events: none; overflow: hidden; max-width: 100%; }
.lc-gt { visibility: hidden; }
.lc-gr { color: var(--lc-muted); }
/* the probe takes the sentence's font; it is 1 px wide so it never adds overflow, and its height follows the font size */
.lc-probe { position: absolute; left: 0; top: 0; width: 1px; overflow: hidden; visibility: hidden; white-space: nowrap; pointer-events: none; font: inherit; font-style: italic; }
.lc-mirror { position: absolute; left: 0; top: 0; visibility: hidden; white-space: pre; pointer-events: none; font-family: var(--lc-font-sci); font-style: italic; font-weight: 400; font-size: var(--lc-size-sentence); padding: 0 4px; }
.lc-clear { appearance: none; border: 0; background: transparent; color: var(--lc-muted); font-family: var(--lc-font-ui); font-size: var(--lc-size-small); line-height: 1.4; padding: 4px 8px; margin-left: 4px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; align-self: center; min-height: 32px; }
.lc-clear:hover { color: var(--lc-ink); }

/* results list: a dropdown under the sentence on desktop, in the flow under the sentence on phone */
.lc-results { position: absolute; left: 0; top: 100%; z-index: 30; min-width: min(420px, 100%); max-width: 100%; max-height: var(--lc-results-max-h); overflow-y: auto;
  background: var(--lc-surface); color: var(--lc-ink); border-radius: var(--lc-radius); box-shadow: var(--lc-shadow); padding: 4px 0; margin-top: 6px; }
.lc-opt { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; column-gap: 10px; align-items: center; padding: 6px 14px; cursor: pointer; font-size: var(--lc-size-body); line-height: 1.35; }
.lc-opt .lc-mark { width: 14px; height: 14px; }
.lc-opt-name { font-size: var(--lc-size-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-opt-fam { font-size: var(--lc-size-small); color: var(--lc-muted); white-space: nowrap; }
.lc-opt[aria-selected="true"] { background: var(--lc-active-bg); }
.lc-opt[aria-selected="true"] .lc-opt-name { font-weight: 600; }
.lc-opt:hover { background: var(--lc-active-bg); }
.lc-list-note { font-size: var(--lc-size-small); color: var(--lc-muted); padding: 8px 14px; }

.lc-sentence[data-lc-layout="phone"] .lc-if { font-size: var(--lc-size-sentence-phone); }
.lc-sentence[data-lc-layout="phone"] .lc-blank { flex: 0 1 auto; min-width: 5em; }
.lc-sentence[data-lc-layout="phone"] .lc-if-pre, .lc-sentence[data-lc-layout="phone"] .lc-if-suf, .lc-sentence[data-lc-layout="phone"] .lc-clear { flex: none; white-space: nowrap; }
.lc-sentence[data-lc-layout="phone"] .lc-clear { margin-left: 0; padding: 4px 2px 4px 6px; }
.lc-sentence[data-lc-layout="phone"] .lc-input, .lc-sentence[data-lc-layout="phone"] .lc-ghost, .lc-sentence[data-lc-layout="phone"] .lc-mirror { font-size: var(--lc-size-sentence-phone); }
.lc-sentence[data-lc-layout="phone"] .lc-results { position: static; min-width: 0; width: 100%; max-height: none; margin-top: 8px; }
.lc-sentence[data-lc-layout="phone"] .lc-opt { min-height: 44px; padding: 8px 12px; }
.lc-sentence[data-lc-layout="phone"] .lc-opt-fam { display: none; }

/* ---------- the answer ---------- */
.lc-ans { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--lc-gap); align-items: start; }
.lc-ans-mark { display: grid; grid-template-columns: auto auto; grid-template-areas: "title title" "legend legend" "mark labels"; column-gap: 10px; row-gap: 8px; align-items: start; justify-content: start; }
/* the legend takes the width of the mark and its labels and wraps inside it; it never widens the column */
.lc-mark-legend { grid-area: legend; width: 0; min-width: 100%; display: flex; flex-wrap: wrap; column-gap: 12px; row-gap: 2px; font-size: var(--lc-size-small); line-height: 1.4; color: var(--lc-ink); margin-top: -4px; }
.lc-ml-item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.lc-legend-cell { flex: none; }
.lc-mark-title { grid-area: title; font-size: var(--lc-size-small); line-height: 1.4; font-weight: 650; color: var(--lc-ink); }
.lc-ans-mark .lc-large { grid-area: mark; }
.lc-ans-mark .lc-glabels { grid-area: labels; }
.lc-large { display: block; overflow: visible; flex: none; }
.lc-large .lc-ul { fill: var(--lc-mark-ink); }
.lc-glabels { position: relative; width: 16em; font-size: var(--lc-size-small); line-height: 18px; flex: none; }
.lc-glabel { position: absolute; left: 0; white-space: nowrap; color: var(--lc-ink); }
.lc-glabel-plate { color: var(--lc-ink); }
.lc-ans-text { min-width: 0; }
.lc-ruled { font-size: var(--lc-size-sentence); line-height: 1.36; font-weight: var(--lc-weight-sentence); color: var(--lc-ink); max-width: 34em; }
.lc-ruled.lc-arriving { color: var(--lc-muted); }
.lc-ruled.lc-fading { color: color-mix(in srgb, var(--lc-ink) var(--lc-fx, 100%), var(--lc-muted)); }
.lc-ruled .lc-g { text-decoration-line: none; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: currentColor; }
.lc-ruled .lc-g.lc-ul-on { text-decoration-line: underline; }
.lc-name { margin-top: 12px; font-size: var(--lc-size-name); line-height: 1.4; }
.lc-pub { color: var(--lc-muted); }
.lc-classfam { font-size: var(--lc-size-body); }
.lc-country { margin-top: 6px; font-size: var(--lc-size-body); }
.lc-country-note { font-size: var(--lc-size-small); line-height: 1.4; color: var(--lc-muted); }
.lc-foot { margin-top: 10px; font-size: var(--lc-size-small); line-height: 1.4; color: var(--lc-muted); }
.lc-foot a { color: var(--lc-muted); }
.lc-answer[data-lc-layout="phone"] .lc-ans { grid-template-columns: minmax(0, 1fr); row-gap: 14px; }
.lc-answer[data-lc-layout="phone"] .lc-ans-mark { order: 2; }
.lc-answer[data-lc-layout="phone"] .lc-ans-text { display: contents; }
.lc-answer[data-lc-layout="phone"] .lc-ruled { order: 1; font-size: var(--lc-size-sentence-phone); }
.lc-answer[data-lc-layout="phone"] .lc-name, .lc-answer[data-lc-layout="phone"] .lc-classfam, .lc-answer[data-lc-layout="phone"] .lc-country,
.lc-answer[data-lc-layout="phone"] .lc-country-note, .lc-answer[data-lc-layout="phone"] .lc-seq, .lc-answer[data-lc-layout="phone"] .lc-foot { order: 4; margin-top: 0; }

/* the real sequence strip (kind A only, when data/sequences.js is loaded) */
.lc-seq { margin-top: 10px; max-width: 34em; }
.lc-seq-label { font-size: var(--lc-size-small); line-height: 1.4; color: var(--lc-muted); }
.lc-seq-bases { font-family: ui-monospace, "IBM Plex Mono", Menlo, Consolas, monospace; font-size: var(--lc-size-small); line-height: 1.5; letter-spacing: 0.06em; word-break: break-all; color: var(--lc-ink); }
.lc-b-A { color: var(--lc-seq-a); } .lc-b-C { color: var(--lc-seq-c); } .lc-b-G { color: var(--lc-seq-g); } .lc-b-T { color: var(--lc-seq-t); }

/* ---------- How sure is this? ---------- */
.lc-sure-title { font-size: var(--lc-size-body); line-height: 1.47; font-weight: 650; margin-bottom: 4px; }
.lc-note { font-size: var(--lc-size-body); line-height: 1.47; color: var(--lc-muted); }
.lc-note + .lc-note { margin-top: 8px; }
.lc-note.lc-on { color: var(--lc-ink); }
.lc-note.lc-fading { color: color-mix(in srgb, var(--lc-ink) var(--lc-fx, 0%), var(--lc-muted)); }
.lc-see { margin-top: 8px; font-size: var(--lc-size-body); }

/* ---------- legend and mark key helpers ---------- */
.lc-legend-title, .lc-markkey-title { font-size: var(--lc-size-body); font-weight: 650; margin-bottom: 6px; }
.lc-legend-list, .lc-markkey-list { list-style: none; margin: 0; padding: 0; display: grid; row-gap: 6px; }
.lc-legend-row, .lc-markkey-list li { display: grid; grid-template-columns: 18px minmax(0, 1fr); column-gap: 8px; align-items: center; font-size: var(--lc-size-small); line-height: 1.4; }
.lc-legend-row { grid-template-columns: 18px auto minmax(0, 1fr); }
.lc-legend-nocount .lc-legend-row { grid-template-columns: 18px minmax(0, 1fr); }
.lc-legend-n { font-variant-numeric: tabular-nums; font-weight: 650; }
.lc-markkey-order { font-size: var(--lc-size-small); line-height: 1.4; color: var(--lc-muted); margin-bottom: 8px; }

/* ---------- moving copies (outside the roots, so colors are copied onto them) ---------- */
.lc-rise { position: fixed; left: 0; top: 0; z-index: var(--lc-rise-z, 60); pointer-events: none; will-change: transform; }
.lc-rise svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; }
.lc-rise .lc-ink, .lc-xfade .lc-ink { fill: var(--lc-mark-ink); }
.lc-rise .lc-plate, .lc-xfade .lc-plate { fill: var(--lc-mark-plate); }
.lc-rise .lc-b1, .lc-xfade .lc-b1 { fill: var(--lc-mark-b1); }
.lc-xfade { pointer-events: none; z-index: var(--lc-rise-z, 60); }

@media (prefers-reduced-motion: reduce) { .lc * { transition: none !important; animation: none !important; } }
