/* Sequence tools: the Listings, Editor, Fragments, Align and Query tools tabs under the results. One white card with chip-style
   tabs, cards for lists and monospace labels, as in the rest of the page. Every color and size comes from the
   tokens in style.css, which loads first. Light mode only. */

.tools-card { overflow: clip; border-color: var(--line-faint); }
.tools-tabs { margin: 14px 18px 8px; }
@media (min-width: 768px) {
  .tools-tabs { margin: 18px 24px 8px; }
}
.tools-panel { display: grid; gap: 18px; min-width: 0; padding: 18px; border-top: 1px solid var(--line-faint); }
@media (min-width: 768px) {
  .tools-panel { padding: 22px 24px 24px; }
}
.tools-panel > .btn { justify-self: start; }
.tools-heading { font-size: 16px; line-height: 1.35; font-weight: 600; letter-spacing: -0.005em; color: var(--brand-ink); }
.tools-subheading { font: 400 12px/1.25 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand-link); }
.tools-pager { margin-top: 4px; }

/* Listings: the import box and the check box side by side, the check report, the listing cards, then the open
   listing. */
.listing-starts { display: grid; gap: 14px; }
@media (min-width: 900px) { .listing-starts { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.listing-import, .listing-check { display: grid; gap: 12px; padding: 16px; border: 1px dashed var(--line-2); border-radius: var(--radius); background: var(--well); }
.listing-import > .btn { justify-self: start; }
.listing-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.listing-chosen { font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.listing-progress { width: 100%; height: 6px; overflow: hidden; border: 0; border-radius: 6px; background: var(--run-tint); appearance: none; accent-color: var(--run); }
.listing-progress::-webkit-progress-bar { border-radius: 6px; background: var(--run-tint); }
.listing-progress::-webkit-progress-value { border-radius: 6px; background: var(--run); }
.listing-progress::-moz-progress-bar { border-radius: 6px; background: var(--run); }
#listing-progress-text:empty { display: none; }
/* A ready listing's line of facts wraps whole at every width, where other card text stops at two lines, so no fact
   is cut off on a phone or with wider text spacing (WCAG 1.4.10, 1.4.12). */
.listing-card .card-text.mono { display: block; overflow: visible; font-size: 12px; line-height: 18px; }

.listing-view { display: grid; gap: 14px; padding-top: 18px; border-top: 1px solid var(--line-faint); scroll-margin-top: 16px; }
.listing-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.listing-heading { display: grid; flex: 1 1 320px; gap: 8px; min-width: 0; }
.listing-title { font-size: 20px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; color: var(--brand-ink); overflow-wrap: anywhere; }
.listing-title:focus { outline: none; }
.listing-about { overflow-wrap: anywhere; }
.listing-facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.listing-facts li { padding: 3px 10px; border-radius: 999px; background: var(--chip); font-size: 12px; line-height: 18px; color: var(--ink-2); }
.listing-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.listing-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.listing-pick-count { margin-left: auto; font-size: 12.5px; color: var(--ink-2); }
/* The scroll box holds the hidden column names too, so they never widen the page. */
.listing-view .table-scroll { position: relative; }
.listing-table td { vertical-align: middle; }
.listing-preview { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.listing-organism { min-width: 8rem; font-size: 13.5px; color: var(--ink-2); }
.listing-row-actions { white-space: nowrap; text-align: right; }
.listing-row-actions .btn { margin-block: -8px; padding: 0 10px; }

.listing-search { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft); }
.listing-search > .btn { justify-self: start; }
@media (max-width: 559px) {
  .listing-search > .btn, .listing-import > .btn { justify-self: stretch; }
}
.listing-plan { display: grid; gap: 8px; }
.listing-plan .flag { margin: 0; }
.listing-plan-line { font-size: 14.5px; }
.listing-plan-line strong { font-weight: 600; }
.listing-groups, .listing-runs { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.listing-groups li, .listing-run {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-width: 0; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--card); font-size: 13.5px; overflow-wrap: anywhere;
}
.listing-groups .mono { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand-link); }
.listing-runs:empty { display: none; }
.listing-run-end { margin-left: auto; }
.listing-run-end .btn { margin-block: -6px; }

/* The listing check report: the verdict, its counts, the filters, then the problems. */
#check-state:empty, #check-more:empty, #check-empty:empty { display: none; }
.check-result { display: grid; gap: 14px; padding-top: 18px; border-top: 1px solid var(--line-faint); scroll-margin-top: 16px; }
.check-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.check-title { flex: 1 1 260px; min-width: 0; font-size: 20px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; color: var(--brand-ink); overflow-wrap: anywhere; }
.check-title:focus { outline: none; }
.check-verdict { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--soft); font-size: 14.5px; font-weight: 500; overflow-wrap: anywhere; }
.check-verdict[data-tone="good"] { border-color: var(--ok-tint); background: var(--ok-tint); color: var(--ok); }
.check-verdict[data-tone="warn"] { border-color: var(--warn-line); background: var(--warn-tint); color: var(--warn); }
.check-verdict[data-tone="bad"] { border-color: var(--bad-line); background: var(--bad-tint); color: var(--bad); }
.check-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 16px; }
.check-filters[hidden] { display: none; }
.check-severity { margin: 0; padding: 0; border: 0; }
.check-severity .chips { padding-block: 4px 0; }
.check-seq { width: 9rem; }
.check-filters > .btn { margin-left: auto; }
@media (max-width: 560px) {
  .check-filters > .btn { margin-left: 0; justify-self: stretch; width: 100%; }
}
.check-table { min-width: 640px; }
.check-message { overflow-wrap: anywhere; }
.check-badge { display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 999px; font-size: 12px; line-height: 18px; font-weight: 600; }
.check-badge[data-tone="bad"] { background: var(--bad-tint); color: var(--bad); }
.check-badge[data-tone="warn"] { background: var(--warn-tint); color: var(--warn); }
.check-rule-cell { min-width: 9rem; }
.check-rule { display: block; font-size: 13.5px; }
.check-paragraph { display: block; font-size: 12px; color: var(--ink-2); }
.check-listing { color: var(--ink-2); }

/* Editor */
.editor-origin:empty { display: none; }
.editor-origin { overflow-wrap: anywhere; }
.editor-check p { margin: 0; }
.editor-problems { display: grid; gap: 4px; margin: 0; padding-left: 30px; }
.editor-length { font-size: 14px; color: var(--ink-2); }
.editor-length strong { font-weight: 500; color: var(--ink); }
.editor-ops { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 24px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft); }
.editor-op { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; min-width: 0; }
.editor-op .field { width: 7rem; }
.editor-frames { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.editor-frame { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--card); }
.editor-frame-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.editor-frame-head .btn { margin: -6px 0 -6px auto; }
.editor-frame-text { font-size: 12.5px; line-height: 1.55; color: var(--ink); overflow-wrap: anywhere; word-break: break-all; }
.editor-foot { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 559px) {
  .editor-foot .btn { flex: 1 1 100%; }
}
.editor-fetch { border-color: var(--line-faint); box-shadow: none; }

/* Fragments */
.fragment-card .card-end { align-items: flex-start; }
.fragment-actions { display: flex; flex-wrap: wrap; margin: -8px -8px -8px 0; }
.card-end .fragment-actions .btn { margin: 0; padding: 0 10px; }
.fragment-history > summary {
  display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 13.5px; font-weight: 500;
  color: var(--brand-link); list-style: none; cursor: pointer;
}
.fragment-history > summary::-webkit-details-marker { display: none; }
.fragment-history > summary::before { content: '+'; width: 12px; font: 500 15px/1 var(--font-mono); }
.fragment-history[open] > summary::before { content: '\2212'; }
.fragment-steps { display: grid; gap: 6px; margin: 0; padding: 0 0 0 20px; font-size: 13px; }
.fragment-steps li { overflow-wrap: anywhere; }
.fragment-steps li > span + span { margin-left: 8px; }

/* Align */
.aligner-missing { display: grid; gap: 8px; }
.aligner-missing:empty { display: none; }
.aligner-callout { max-width: none; font-size: 14px; overflow-wrap: anywhere; }
.aligner-callout strong { font-weight: 600; }
.aligner-list-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.aligner-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.aligner-item { display: flex; align-items: center; gap: 8px 12px; padding: 4px 4px 4px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--card); }
.aligner-item-text { display: flex; flex: 1; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; font-size: 14px; }
.aligner-item-text strong { font-weight: 500; overflow-wrap: anywhere; }
.aligner-number { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 6px; background: var(--chip); font-size: 12px; color: var(--ink-2); }
#aligner-note:empty { display: none; }
.aligner-output { display: grid; gap: 12px; min-width: 0; }
.aligner-output:empty { display: none; }
.aligner-status { font-size: 13px; }
.aligner-key { display: grid; gap: 6px; margin: 0; padding: 12px 14px; border-bottom: 1px solid var(--line); list-style: none; font-size: 13.5px; }
.aligner-key li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; overflow-wrap: anywhere; }
.aligner-code { max-height: 560px; }
.aligner-consensus { font-weight: 600; color: var(--brand-ink); background: var(--brand-tint); }
.aligner-none { padding: 14px; color: var(--ink-2); }
.aligner-rule { padding: 12px 14px 0; }
.aligner-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px 14px; }

/* Query tools: the tool chips, the base sequence, each tool's fields, what a tool read, its proposals and queries,
   then the saved query groups. Long letters and names wrap inside their boxes at every width. */
.qt-base { display: grid; gap: 12px; min-width: 0; margin: 0; padding: 16px; border: 1px dashed var(--line-2); border-radius: var(--radius); background: var(--well); }
.qt-base legend { padding: 0 4px; }
.qt-typed, .qt-tool { display: grid; gap: 12px; min-width: 0; }
.qt-row { display: flex; flex-wrap: wrap; gap: 12px; }
.qt-row > .field { flex: 1 1 160px; }
.qt-output { display: grid; gap: 12px; min-width: 0; }
.qt-output:empty { display: none; }
.qt-read, .qt-notes, .qt-problems, .qt-why { display: grid; gap: 4px; margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
.qt-notes, .qt-why { color: var(--ink-2); }
.qt-problems { color: var(--bad); }
.qt-proposals, .qt-queries { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.qt-proposal, .qt-queries li { display: grid; gap: 6px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--card); }
.qt-proposal-head { font-size: 14.5px; overflow-wrap: anywhere; }
.qt-proposal-head strong { font-weight: 600; }
.qt-query-name { font-weight: 500; overflow-wrap: anywhere; }
.qt-letters { margin: 0; font-size: 12.5px; line-height: 1.5; overflow-wrap: anywhere; word-break: break-all; }
.qt-pattern { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--soft); }
.qt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.qt-group .card-main { min-width: 0; }
/* A group's Search and Delete stay inside the card. The fragment cards pull their buttons 8 px past the right edge,
   which on a wide group card, where the date and the buttons share a line, makes the card's end wider than itself. */
.qt-group .fragment-actions { margin-right: 0; }
/* A group's open Search box takes the whole row, so its sets and its searches have the width of the list. */
.qt-group:has(.qt-search) { grid-column: 1 / -1; }
.qt-search { margin-top: 16px; }
/* A group's Hit by several queries box (multi-hits.mjs) takes the whole row too: each row names a publication or a
   sequence, how many of the group's queries hit it and which, then its facts. */
.qt-group:has(.qt-multi) { grid-column: 1 / -1; }
.qt-multi { margin-top: 16px; }
.qt-multi-summary { margin: 0; font-weight: 500; }
.qt-multi-notes { display: grid; gap: 6px; justify-items: start; }
.qt-multi-notes:empty, .qt-multi-more:empty { display: none; }
.qt-multi-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.qt-multi-row { display: grid; gap: 4px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--card); }
.qt-multi-head { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; margin: 0; overflow-wrap: anywhere; }
.qt-multi-name { font-weight: 600; }
a.qt-multi-name { display: inline-flex; align-items: center; min-height: 44px; }
.qt-multi-count { font-size: 13.5px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.qt-multi-names { margin: 0; font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
.qt-multi-row .card-meta { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 559px) {
  .qt-actions .btn { flex: 1 1 100%; }
}
