/* Colours. Both dark blocks must stay identical; theme.test.js checks it. Screen only, so printing stays light. */
:root {
    color-scheme: light;
    --bg-primary: #f5f6f8;
    --bg-secondary: #ffffff;
    --border: #e1e5eb;
    --border-dark: #c6cdd7;
    --text: #1b2330;
    --text-muted: #5e6878;
    --text-dim: #7f8a9a;
    --accent: #24508f;
    --on-accent: #ffffff;
    --input-border: #7f8a9a;
    --input-border-hover: #5e6878;
    --focus: #24508f;
    --danger: #b91c1c;

    --accent-tint: #e8eef7;
    --accent-ink: #1c4378;
    --accent-line: #c9d6ea;
    --accent-hover-line: #9db3d6;
    --accent-wash: #f0f4fa;
    --accent-strong: #1c4378;
    --row-hover: #eef2f8;

    --ok-tint: #e3f5ee;
    --ok-ink: #085041;
    --ok-line: #9fe1cb;
    --ok-badge-tint: #d9f2e8;
    --ok-badge-ink: #0f6b4f;
    --ok-wash: #f6fbf9;
    --here: #127a55;
    --good: #15803d;
    --warn: #b45309;
    --bad: #b91c1c;

    --tint-blue: #e6f1fb;
    --ink-blue: #0c447c;
    --tint-amber: #faeeda;
    --ink-amber: #633806;
    --tint-teal: #e1f5ee;
    --ink-teal: #085041;
    --tint-gray: #f0f3f7;
    --ink-gray: #2e3846;
    --sec-gray: #5e6878;

    --pair-wc: #139068;
    --pair-gu: #b7791f;
    --pair-nc: #7f77dd;
    --pair-mod: #26215c;
    --on-pair-mod: #ffffff;
    --pair-sym: #4c3fb5;
    --strand: #64748b;
    --seq-band: #fde68a;
    --seq-partner: #fecdd3;
    --ntc-nan-line: #7f8a9a;
    --ntc-edge: #858a93;
    --swatch-edge: rgba(0, 0, 0, 0.25);

    /* Both strands step up on dark, or the deep one sits at 1.1:1 against the card. */
    --mark-deep: #0f2a47;
    --mark-light: #3f7fc8;

    --icon-filter: invert(1);
    --shadow-rgb: 15 23 42;
    --backdrop: rgba(15, 23, 42, 0.55);
}

@media screen {
    :root[data-theme="dark"] {
        color-scheme: dark;
        --bg-primary: #11161d;
        --bg-secondary: #18202a;
        --border: #253041;
        --border-dark: #34425a;
        --text: #e3e8ef;
        --text-muted: #b0bac8;
        --text-dim: #8a96a8;
        --accent: #86a9e2;
        --on-accent: #0d1520;
        --input-border: #66758b;
        --input-border-hover: #8a96a8;
        --focus: #86a9e2;
        --danger: #f09595;

        --accent-tint: #1c2a40;
        --accent-ink: #a3bfec;
        --accent-line: #2a3d5c;
        --accent-hover-line: #4a6a9e;
        --accent-wash: #1a2536;
        --accent-strong: #4a6a9e;
        --row-hover: #1f2934;

        --ok-tint: #04342c;
        --ok-ink: #9fe1cb;
        --ok-line: #0f6e56;
        --ok-badge-tint: #085041;
        --ok-badge-ink: #9fe1cb;
        --ok-wash: #16231f;
        --here: #5dcaa5;
        --good: #97c459;
        --warn: #ef9f27;
        --bad: #f09595;

        --tint-blue: #1a2536;
        --ink-blue: #85b7eb;
        --tint-amber: #33291a;
        --ink-amber: #fac775;
        --tint-teal: #15302a;
        --ink-teal: #9fe1cb;
        --tint-gray: #1f2934;
        --ink-gray: #c9d1dc;
        --sec-gray: #8a96a8;

        --pair-wc: #1d9e75;
        --pair-gu: #e0a030;
        --pair-nc: #afa9ec;
        --pair-mod: #cecbf6;
        --on-pair-mod: #26215c;
        --pair-sym: #afa9ec;
        --strand: #7c889a;
        --seq-band: #633806;
        --seq-partner: #4b1528;
        --ntc-nan-line: #7c889a;
        --ntc-edge: #7c889a;
        --swatch-edge: rgba(227, 232, 239, 0.35);

        --mark-deep: #4f7fc2;
        --mark-light: #a3cbef;

        --icon-filter: none;
        --shadow-rgb: 0 0 0;
        --backdrop: rgba(0, 0, 0, 0.65);
    }
}

@media screen and (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg-primary: #11161d;
        --bg-secondary: #18202a;
        --border: #253041;
        --border-dark: #34425a;
        --text: #e3e8ef;
        --text-muted: #b0bac8;
        --text-dim: #8a96a8;
        --accent: #86a9e2;
        --on-accent: #0d1520;
        --input-border: #66758b;
        --input-border-hover: #8a96a8;
        --focus: #86a9e2;
        --danger: #f09595;

        --accent-tint: #1c2a40;
        --accent-ink: #a3bfec;
        --accent-line: #2a3d5c;
        --accent-hover-line: #4a6a9e;
        --accent-wash: #1a2536;
        --accent-strong: #4a6a9e;
        --row-hover: #1f2934;

        --ok-tint: #04342c;
        --ok-ink: #9fe1cb;
        --ok-line: #0f6e56;
        --ok-badge-tint: #085041;
        --ok-badge-ink: #9fe1cb;
        --ok-wash: #16231f;
        --here: #5dcaa5;
        --good: #97c459;
        --warn: #ef9f27;
        --bad: #f09595;

        --tint-blue: #1a2536;
        --ink-blue: #85b7eb;
        --tint-amber: #33291a;
        --ink-amber: #fac775;
        --tint-teal: #15302a;
        --ink-teal: #9fe1cb;
        --tint-gray: #1f2934;
        --ink-gray: #c9d1dc;
        --sec-gray: #8a96a8;

        --pair-wc: #1d9e75;
        --pair-gu: #e0a030;
        --pair-nc: #afa9ec;
        --pair-mod: #cecbf6;
        --on-pair-mod: #26215c;
        --pair-sym: #afa9ec;
        --strand: #7c889a;
        --seq-band: #633806;
        --seq-partner: #4b1528;
        --ntc-nan-line: #7c889a;
        --ntc-edge: #7c889a;
        --swatch-edge: rgba(227, 232, 239, 0.35);

        --mark-deep: #4f7fc2;
        --mark-light: #a3cbef;

        --icon-filter: none;
        --shadow-rgb: 0 0 0;
        --backdrop: rgba(0, 0, 0, 0.65);
    }
}

/* IBM Plex Sans and Mono, self-hosted (SIL Open Font License, license.txt there). */
@font-face {
    font-family: "IBM Plex Sans";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("/assets/fonts/IBMPlexSans-Regular.woff2") format("woff2");
}
@font-face {
    font-family: "IBM Plex Sans";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("/assets/fonts/IBMPlexSans-Medium.woff2") format("woff2");
}
@font-face {
    font-family: "IBM Plex Sans";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("/assets/fonts/IBMPlexSans-SemiBold.woff2") format("woff2");
}
@font-face {
    font-family: "IBM Plex Sans";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("/assets/fonts/IBMPlexSans-Bold.woff2") format("woff2");
}
@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("/assets/fonts/IBMPlexMono-Regular.woff2") format("woff2");
}
@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("/assets/fonts/IBMPlexMono-Medium.woff2") format("woff2");
}
@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("/assets/fonts/IBMPlexMono-SemiBold.woff2") format("woff2");
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "IBM Plex Sans", system-ui, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text);
}

.interface {
    display: flex;
    height: calc(100vh - var(--footer-h));
    width: 100%;

    /* The rail's logo cell matches this height. */
    --topbar-h: 60px;

    --railcell-h: 60px;
}

.interface:has(.top_search) { --topbar-h: 78px; }

.query_panel {
    width: 450px;
    flex-shrink: 0;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border);
    
    
    display: flex;
    flex-direction: column;
}

.results_area {
    position: relative;   /* the page buttons float over its list */
    flex-grow: 1;
    background-color: var(--bg-primary);

    display: flex;
    flex-direction: column;
}

/* -----------------------headers------------------------------- */

.query_panel_header {
    height: 60px;
    flex-shrink: 0;
    padding-left: 24px;
    border-bottom: 1px solid var(--border);
    
    display: flex;
    align-items: center;
    
}

.results_area_header {
    height: 60px;
    flex-shrink: 0;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-dark);
    
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.query_panel_header h1,
.results_area_header h1{
    font-size: 16px;
    font-weight: 600;
}

/* -----------------------bodies------------------------------- */

.query_panel_body,
.results_area_body {
    flex-grow: 1;
    overflow-y: auto;

    /* A container query: a media query cannot see the filter panel. */
    container-type: inline-size;
    container-name: results;
}

/* <---------------------------rail-----------------------------> */

.rail {
    width: 60px;
    flex-shrink: 0;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border);

    display: flex;
    flex-direction: column;
}

.rail-logo,
.rail-item {
    height: var(--railcell-h);
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: background-color 0.2s;
}

.rail-logo:hover,
.rail-item:hover {
    background-color: var(--border);
}

.rail-item.active {
    background-color: var(--border);
}

.rail-logo {
    height: var(--topbar-h);
    flex-direction: column;
    gap: 4px;
}

.rail-logo svg {
    display: block;
    width: 48px;
    height: auto;
}

.mark_deep { fill: var(--mark-deep); }
.mark_light { fill: var(--mark-light); }
.mark_word { fill: var(--mark-deep); }

.rail-item img {
    display: block;
    width: 24px;
    height: auto;
    filter: var(--icon-filter);
}

.rail-theme {
    width: 100%;
    margin-top: auto;
    padding: 0;
    border: 0;
    border-top: 1px solid var(--border);
    background: none;
    color: var(--text-muted);
    cursor: pointer;
}

.rail-theme[hidden] { display: none; }
.rail-theme svg { display: none; width: 22px; height: 22px; }
.rail-theme[data-choice="auto"] .theme_auto,
.rail-theme[data-choice="light"] .theme_light,
.rail-theme[data-choice="dark"] .theme_dark { display: block; }
.rail-theme:hover { color: var(--text); }

.rail-item img.icon-narrow {
    width: 20px;
}

/* <-------------------categories------------------> */

.category {
    border-bottom: 1px solid var(--border);
}

.category_header {
    height: 59px;
    padding: 0 24px;
    cursor: pointer;
    user-select: none;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.category_header:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }

.category_title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.category_dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--dot);
}

.category.demographics { --dot: #378add; }
.category.features     { --dot: #1d9e75; }
.category.components   { --dot: #ba7517; }

.category_title h2 {
    font-size: 14px;
    font-weight: 500;
}

.category_body {
    padding: 24px;
    padding-top: 16px;
    color: var(--text-muted);
}

.category.collapsed .category_body {
    display: none;
}

/* <---------------form field-------------> */

.field {
    width: 100%;
    margin-bottom: 16px;
}

.field label,
.group_label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 4px;
    padding-left: 4px;
}

.field input {
    width: 100%;
    padding: 8px;
    border-radius: 5px;

    font: inherit;
    font-size: 12px;

    background-color: transparent;
    color: inherit;
    border: 1px solid var(--input-border);
    outline: none;

    transition: border-color 0.2s;
}

.field input:hover {
    border-color: var(--input-border-hover);
}

.field input:focus {
    border-color: var(--focus);
}

/* <---------------pill buttons-------------> */

.pill_group {
    margin-bottom: 16px;
}

.pill_field {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.pill {
    padding: 4px 12px;
    border-radius: 999px;
    font: inherit;
    font-size: 12px;
    background-color: transparent;
    color: inherit;
    border: 1px solid var(--input-border);
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.pill:focus-visible,
.search:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.pill:hover {
    border-color: var(--input-border-hover);
}

.pill.selected {
    background-color: var(--ok-tint);
    color: var(--ok-ink);
    border-color: var(--ok-line);
}

.pill[hidden],
.revealed_field[hidden] { display: none; }
.pill_band:not(.selected) { display: none; }

.pill_more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    background: transparent;
    border: 1px dashed var(--input-border-hover);
    cursor: pointer;
}
.pill_more:hover { border-style: solid; }
.pill_more:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.revealed_field {
    margin: -6px 0 16px 6px;
    padding: 10px 0 2px 12px;
    border-left: 2px solid var(--ok-line);
}

/* <------------------range row-------------> */

.range_row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.range_row input {
    flex: 1;
    min-width: 0;
    padding: 8px;
    border-radius: 5px;
    font: inherit;
    font-size: 12px;
    background-color: transparent;
    color: inherit;
    border: 1px solid var(--input-border);
    outline: none;
    transition: border-color 0.2s;
}

.range_row input:hover {
    border-color: var(--input-border-hover);
}

.range_row input:focus {
    border-color: var(--focus);
}

.range_dash {
    width: 8px;
    height: 2px;
    flex-shrink: 0;
    border-radius: 999px;
    background-color: var(--text-muted);
}

input::placeholder {
    color: var(--text-dim);
}

/* <--------------search footer-----------------------------> */

.query_panel_footer {
    flex-shrink: 0;
    height: var(--railcell-h);
    padding: 0 24px;
    border-top: 1px solid var(--border);

    display: flex;
    align-items: center;
}

.search {
    width: 100%;
    padding: 8px 0;
    border-radius: 5px;
    font: inherit;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: transparent;
    color: var(--text-muted);
    border: 1px solid var(--input-border);
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.search:hover:not(:disabled) {
    border-color: var(--input-border-hover);
    background-color: var(--bg-primary);
}

.search:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* The one open/close arrow, turned by aria-expanded. .arrow_side for sideways panels. */
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }

.arrow,
details:not(.help, .entry_fasta) > summary::before {
    content: "";
    display: inline-block;
    flex: none;
    width: 14px;
    height: 14px;
    vertical-align: -2px;
    background: var(--accent);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: rotate 0.2s;
}

details:not(.help, .entry_fasta) > summary::before { margin-right: 6px; }

[aria-expanded="true"] > .arrow,
details[open]:not(.help, .entry_fasta) > summary::before { rotate: 90deg; }

[aria-expanded="true"] > .arrow_side { rotate: 180deg; }

@media (prefers-reduced-motion: reduce) {
    .arrow, details > summary::before { transition: none; }
}

.download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    background: var(--accent);
    color: var(--on-accent);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    list-style: none;
    transition: background-color 0.15s, border-color 0.15s;
}

.download::before {
    content: "";
    flex: none;
    width: 14px;
    height: 14px;
    background: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11M7 10l5 5 5-5M5 20h14'/%3E%3C/svg%3E") center / contain no-repeat;
}

.download:hover:not(:disabled) { background: var(--accent-ink); border-color: var(--accent-ink); }
.download:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.download:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.download_small { padding: 4px 9px; font-size: 12px; gap: 5px; }
.download_small::before { width: 13px; height: 13px; }

.download_quiet {
    background: none;
    border-color: var(--border-dark);
    color: var(--text-muted);
}

.download_quiet:hover:not(:disabled) {
    background: var(--accent-wash);
    border-color: var(--accent);
    color: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
    .download { transition: none; }
}

/* <---------------report page-------------> */

.report_downloads {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.report_group {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.report_group_title {
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 500;
}

.check_row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
}

.check_row input {
    width: 15px;
    height: 15px;
    accent-color: var(--accent);
    cursor: pointer;
}

.report_tabs {
    display: flex;
    gap: 4px;
    padding: 12px 24px 4px;
}

.report_why {
    padding: 0 24px 10px;
    border-bottom: 1px solid var(--border);
}

.report_tab {
    flex: 1;
    padding: 7px 4px;
    border-radius: 5px;
    font: inherit;
    font-size: 12px;
    color: var(--text-muted);
    background-color: transparent;
    border: 1px solid var(--input-border);
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.report_tab:hover { border-color: var(--input-border-hover); }

.report_tab[aria-selected="true"] {
    color: var(--on-accent);
    background-color: var(--accent);
    border-color: var(--accent);
}

.report_row_note {
    padding: 14px 24px 0;
    font-size: 12px;
    color: var(--text-dim);
}

.check_always {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-dim);
}

.check_row input:disabled { cursor: default; }

.report_summary {
    padding: 24px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-dim);
}

/* <---------------detail panel-------------> */

.detail_body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
}

.detail_field {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.detail_label {
    margin-bottom: 3px;
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.detail_value {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text);
    overflow-wrap: anywhere;
}

.detail_link {
    display: inline-block;
    margin-top: 16px;
    font-size: 13px;
    color: var(--accent);
}

.detail_link + .detail_link {
    margin-left: 18px;
}

.molecules_summary {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-dim);
}

.molecule_group {
    margin: 8px 0 4px;
}

.molecule_group summary {
    cursor: pointer;
    padding: 4px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.molecule_scroll {
    overflow-x: auto;
}

.molecule_table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text);
}

.molecule_table th {
    padding: 4px 8px 4px 0;
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    font-weight: normal;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-align: left;
    color: var(--text-dim);
}

.molecule_table td {
    padding: 6px 8px 6px 0;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    overflow-wrap: anywhere;
}

.molecule_table span[title] {
    text-decoration: underline dotted;
    cursor: help;
}

.molecule_table a:not(.download) {
    color: var(--accent);
}

.molecule_table .unmodelled {
    color: var(--text-dim);
    text-decoration: underline dotted;
}

.more_positions summary {
    cursor: pointer;
    color: var(--accent);
}

.molecule_sub {
    font-size: 12px;
    color: var(--text-dim);
}

.source_kind {
    font-weight: 600;
}

.published_value { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.published_value .cite_save { margin-left: 0; }
@media (max-width: 640px) {
    .published_value { position: relative; }
    .published_value .cite_save { position: static; }
}

.citation_actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.citation_actions .cite_save { margin-left: 0; }
.citation_actions .cite_save .entry_fasta_menu,
.published_value .cite_save .entry_fasta_menu { left: 0; right: auto; }
.citation_actions .detail_link { margin-top: 0; }
.cite_copy { flex: none; white-space: nowrap; }
.cite_copy svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.citation {
    padding: 10px 0 12px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    line-height: 1.5;
    color: var(--text);
    overflow-wrap: anywhere;
}

.citation_title {
    font-weight: 600;
}

.citation_authors,
.citation_source {
    color: var(--text-dim);
}

.citation_abstract { margin-top: 6px; }
.citation_abstract summary { cursor: pointer; color: var(--accent); font-size: 12px; }
.citation_abstract p { margin: 6px 0 0; white-space: pre-line; }

/* <---------------empty state-------------> */

.did_you_mean {
    max-width: 36em;
    margin: 0;
    padding: 0 16px;
    text-align: center;
    line-height: 1.6;
    color: var(--text);
}

.did_you_mean a,
.landing_count a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.empty_state,
.loading_state,
.error_state {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-dim);
    font-size: 14px;
}

.field_note {
    margin: 0;
    font-size: 11px;
    line-height: 1.5;
    color: var(--text-dim);
}

.error_text {
    color: var(--danger);
    max-width: 320px;
    text-align: center;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-dark);
    border-top-color: var(--text-dim);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* <---------------keyboard focus-------------> */

.pill:focus-visible,
.search:focus-visible,
.rail-item:focus-visible,
.rail-logo:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

/* Narrow windows stack the filters above the results. */
@media (max-width: 1023px) {
    .workspace_body {
        flex-direction: column;
    }

    .workspace_body > .query_panel {
        width: 100%;
        max-height: 50%;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .workspace_body > .results_area {
        flex-grow: 1;
        min-height: 0;
    }

    .query_panel {
        width: 320px;
    }
}

/* <---------------scrollbar-------------> */

.query_panel_body {
    scrollbar-width: thin;
    scrollbar-color: var(--input-border) transparent;
}

.query_panel_body::-webkit-scrollbar {
    width: 8px;
}

.query_panel_body::-webkit-scrollbar-thumb {
    background-color: var(--input-border);
    border-radius: 999px;
}

.query_panel_body::-webkit-scrollbar-track {
    background-color: transparent;
}

.results_range {
    font-size: 12px;
    color: var(--text-dim);
}

.results_count,
.results_tools {
    display: flex;
    align-items: center;
    gap: 16px;
}

.per_page_field {
    display: flex;
    align-items: center;
    gap: 6px;

    font-size: 12px;
    color: var(--text-dim);
}

.per_page_field input {
    width: 72px;
    padding: 6px 8px;
    border-radius: 5px;

    font: inherit;
    font-size: 12px;
    font-weight: 600;

    background-color: transparent;
    color: var(--text-muted);
    border: 1px solid var(--input-border);
    outline: none;
}

.per_page_field input:hover { border-color: var(--input-border-hover); }
.per_page_field input:focus { border-color: var(--focus); }

.sort_field {
    display: flex;
    align-items: center;
    gap: 8px;

    font-size: 12px;
}

.sort_field span {
    font-weight: 600;
    color: var(--text-muted);
}

.sort_field select {
    font-weight: 600;
    padding: 6px 22px 6px 10px;
    border-radius: 5px;

    font: inherit;
    font-size: 12px;

    background-color: transparent;
    color: var(--text-muted);
    border: 1px solid var(--input-border);
    outline: none;

    cursor: pointer;
}

.sort_field select:hover {
    border-color: var(--input-border-hover);
}

.sort_field select:focus {
    border-color: var(--focus);
}

/* The browser ignores a transparent background on options. */
.sort_field select option {
    background-color: var(--bg-secondary);
    color: var(--text-muted);
}

/* <---------------------results---------------------------> */

.result_row {
    display: flex;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-dark);
    cursor: pointer;
    transition: background-color 0.2s;
}

.result_row:hover {
    background-color: var(--bg-secondary);
}

.result_meta {
    width: 80px;
    flex-shrink: 0;
    margin-right: 16px;
}

.result_id {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.result_date,
.result_res {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.result_main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    min-width: 0;
}

.result_title {
    font-size: 14px;
    margin-right: 8px;
}

.result_method {
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 999px;
    background-color: var(--accent-tint);
    color: var(--accent-ink);
}

.hidden {
    display: none !important;
}

.pagination {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 14px;
    z-index: 5;
    pointer-events: none;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.pagination:empty { display: none; }

.results_area:has(.pagination:not(:empty)) .results_area_body {
    padding-bottom: 58px;
}

.page_num,
.page_arrow {
    pointer-events: auto;
    min-width: 30px;
    padding: 5px 9px;
    font: inherit;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
    background-color: color-mix(in srgb, var(--bg-secondary) 86%, transparent);
    backdrop-filter: blur(6px);
    box-shadow: 0 1px 4px rgb(var(--shadow-rgb) / 0.1);
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.page_num {
    font-size: 12px;
}

.page_arrow {
    font-size: 14px;
    line-height: 1;
}

.page_num:hover:not(.active),
.page_arrow:hover:not(:disabled) {
    border-color: var(--input-border-hover);
    color: var(--text);
}

.page_num.active {
    background-color: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
    font-weight: 600;
}

.page_arrow:disabled {
    opacity: 0.4;
    cursor: default;
}

.page_dots {
    font-size: 12px;
    color: var(--text-dim);
    padding: 0 2px;
    text-shadow: 0 0 4px var(--bg-primary);
}

.page_num:focus-visible,
.page_arrow:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

/* <---------------------landing---------------------------> */

.landing {
    flex-grow: 1;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;
}

.landing_inner {
    width: 100%;
    max-width: 1000px;
    margin-bottom: 8vh;

    text-align: center;
}

.landing_title {
    margin: 0;
}

.landing_wordmark {
    display: block;
    width: clamp(165px, 25.5vw, 270px);
    height: auto;
    margin: 0 auto;
}

.landing_tagline {
    margin-top: 6px;
    font-size: 16px;
    color: var(--text-muted);
}

.landing_search {
    max-width: 620px;
    margin: 32px auto 0;

    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.landing_field {
    position: relative;
    flex-grow: 1;
    display: flex;
    align-items: center;

    border-radius: 6px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--input-border);
}

.landing_field:hover { border-color: var(--input-border-hover); }
.landing_field:focus-within { border-color: var(--focus); }

.landing_search input {
    flex-grow: 1;
    min-width: 0;
    padding: 12px 14px;

    font: inherit;
    font-size: 14px;

    background: none;
    color: inherit;
    border: none;
    outline: none;
}

.landing_search > button[type="submit"] {
    padding: 12px 22px;
    border-radius: 6px;

    font: inherit;
    font-size: 14px;
    font-weight: 600;

    color: var(--on-accent);
    background-color: var(--accent);
    border: 1px solid var(--accent);

    cursor: pointer;
}

.landing_search > button[type="submit"]:hover {
    filter: brightness(1.08);
}

.landing_count {
    min-height: 18px;
    margin-top: 10px;

    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
}

.browse_lead {
    margin-top: 16px;
    font-size: 15px;
    color: var(--text-muted);
}

.browse {
    margin-top: 14px;
    display: grid;
    grid-template-columns: 1fr 1.25fr 1fr;
    grid-template-areas:
        "made     from method"
        "modified from bound";
    gap: 14px;
    text-align: left;
}
@media (min-width: 641px) and (max-width: 900px) {
    .browse {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "made     from"
            "modified from"
            "method   bound";
    }
}

.browse_card {
    display: flex;
    flex-direction: column;
    padding: 14px 14px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-primary);
}

.browse_foot {
    margin-top: auto;
    padding-top: 8px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-dim);
}

.browse_card h2 {
    font-size: 15px;
    font-weight: 600;
}

.browse_hint {
    margin: 2px 0 8px;
    font-size: 12.5px;
    color: var(--text-dim);
}

.browse_card ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.browse_row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 10px;
}

.browse_card a {
    color: var(--text);
    text-decoration: none;
}

.browse_link,
.browse_options a {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    column-gap: 8px;
    padding: 6px 0 7px;
    font-size: 14px;
}

.browse_name { min-width: 0; }
.browse_name small {
    display: block;
    font-size: 12px;
    color: var(--text-dim);
}

.browse_count {
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
}

.browse_bar {
    grid-column: 1 / -1;
    height: 3px;
    margin-top: 4px;
    border-radius: 2px;
    background: linear-gradient(to right, var(--accent) calc(var(--share) * 100%), var(--border) 0);
    opacity: 0.55;
}

.browse_card a:hover .browse_name { color: var(--accent); }
.browse_card a:hover .browse_bar { opacity: 1; }

.browse_answer {
    display: inline-flex;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    overflow: hidden;
}
.browse_card .browse_answer a {
    min-width: 38px;
    padding: 3px 8px;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    color: var(--text-muted);
    background: var(--bg-primary);
    cursor: pointer;
}
.browse_card .browse_answer a + a { border-left: 1px solid var(--input-border); }

.browse_yes .arrow { display: none; }

.picking .browse_yes {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.picking .browse_yes .arrow {
    display: inline-block;
    width: 11px;
    height: 11px;
    vertical-align: 0;
}

.browse_card .browse_yes[aria-pressed="true"] .arrow { background: var(--bg-primary); }
.browse_card .browse_yes:hover { color: var(--accent); background: var(--accent-wash); }
.browse_card .browse_no:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 9%, transparent); }
.browse_card .browse_yes[aria-pressed="true"] { color: var(--bg-primary); background: var(--accent); }
.browse_card .browse_no[aria-pressed="true"] { color: var(--bg-primary); background: var(--danger); }
.browse_card .browse_answer a:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }

.picking .browse_row:has(.browse_yes[aria-pressed="true"]) > .browse_link .browse_name { color: var(--accent); font-weight: 600; }
.picking .browse_row:has(.browse_no[aria-pressed="true"]) > .browse_link .browse_name { color: var(--danger); font-weight: 600; }

.browse_options {
    grid-column: 1 / -1;
    margin: 2px 0 6px 2px;
    padding-left: 12px;
    border-left: 2px solid var(--accent-wash);
}
.browse_options[hidden] { display: none; }
.browse_options_name {
    padding: 4px 0 2px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
}
.browse_options_name small {
    margin-left: 4px;
    font-weight: 400;
    color: var(--text-dim);
}
.browse_options a { font-size: 13.5px; padding: 5px 0 6px; }
.browse_options .browse_name small {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.browse_tick { display: none; }

.picking .browse_options a {
    grid-template-columns: minmax(0, 1fr) auto auto;
    margin: 0 -6px;
    padding-left: 6px;
    padding-right: 6px;
    border-radius: 6px;
    cursor: pointer;
}

.picking .browse_tick {
    display: block;
    align-self: center;
    width: 16px;
    height: 16px;
    box-sizing: border-box;
    border: 1.5px solid var(--input-border);
    border-radius: 4px;
}

.picking .browse_options a:hover .browse_tick { border-color: var(--accent); }
.picking .browse_options a[aria-checked="true"] { background: var(--accent-wash); }
.picking .browse_options a[aria-checked="true"] .browse_name { color: var(--accent); font-weight: 600; }
.picking .browse_options a[aria-checked="true"] .browse_bar { opacity: 1; }
.picking .browse_options a[aria-checked="true"] .browse_tick {
    border-color: var(--accent);
    background: var(--accent) no-repeat center / 12px
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}

.picking .browse_card a:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 1px;
}
.picking .browse_link { cursor: pointer; }

.picked .landing_count { visibility: hidden; }

.picked_line {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding-left: 14px;
    font-size: 13px;
    text-align: left;
}

.picked_line[hidden] { display: none; }

.pick_what {
    margin: 0;
    min-width: 0;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pick_what::first-letter { text-transform: uppercase; }

.pick_count {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    pointer-events: none;
}

.picked .landing_search input {
    padding-left: 8px;
    padding-right: 116px;
    min-width: 4ch;
}

.pick_clear {
    padding: 2px 10px;
    border: 1px solid var(--border-dark);
    border-radius: 999px;
    background: none;
    color: var(--text-muted);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.pick_clear:hover { background: var(--accent-wash); color: var(--accent); }
.pick_clear:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.landing_advanced { margin-top: 34px; }

.landing_advanced::before {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M4 7h10M18 7h2M4 17h4M12 17h8'/%3E%3Ccircle cx='16' cy='7' r='2.2'/%3E%3Ccircle cx='10' cy='17' r='2.2'/%3E%3C/svg%3E");
}

/* <---------------------top search---------------------------> */

.workspace {
    flex-grow: 1;
    min-width: 0;

    display: flex;
    flex-direction: column;
    height: 100%;
}

.workspace_body {
    flex-grow: 1;
    min-height: 0;

    display: flex;
}

.top_search {
    flex-shrink: 0;
    /* --topbar-h is what the rail matches: change the variable, not this line. */
    min-height: var(--topbar-h);
    padding: 8px 24px;
    border-bottom: 1px solid var(--border);

    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: auto auto;
    row-gap: 4px;
    align-content: center;
    align-items: center;
}

.top_search_box {
    grid-column: 2;
    grid-row: 1;

    display: flex;
    gap: 8px;
}

.top_search_count {
    grid-column: 2;
    grid-row: 2;
    min-height: 16px;
    margin: 0;
    line-height: 16px;

    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
}

.top_search_count:empty { visibility: hidden; }

.link_button {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.match_switch {
    grid-column: 1;
    grid-row: 1 / span 2;
    justify-self: start;

    display: flex;
    border: 1px solid var(--input-border);
    border-radius: 5px;
    overflow: hidden;
}

.match_switch button {
    padding: 8px 14px;

    font: inherit;
    font-size: 12px;
    font-weight: 600;

    color: var(--text-muted);
    background-color: transparent;
    border: none;

    cursor: pointer;
}

.match_switch button + button {
    border-left: 1px solid var(--input-border);
}

.match_switch button:hover {
    color: var(--text);
}

.match_switch button[aria-pressed="true"] {
    color: var(--on-accent);
    background-color: var(--accent);
}

.top_search input {
    width: 520px;
    max-width: 100%;
    padding: 10px 14px;
    border-radius: 6px;

    font: inherit;
    font-size: 14px;

    background-color: var(--bg-secondary);
    color: inherit;
    border: 1px solid var(--input-border);
    outline: none;
}

.top_search input:hover {
    border-color: var(--input-border-hover);
}

.top_search input:focus {
    border-color: var(--focus);
}

/* Scoped to the box: a bare .top_search button also styled the toggles. */
.top_search_box button {
    padding: 10px 20px;
    border-radius: 6px;

    font: inherit;
    font-size: 14px;
    font-weight: 600;

    color: var(--on-accent);
    background-color: var(--accent);
    border: 1px solid var(--accent);

    cursor: pointer;
}

.top_search_box button:hover {
    filter: brightness(1.08);
}

.workspace_body > .query_panel,
.workspace_body > .results_area {
    height: auto;
}

/* <---------------------drawer handle---------------------------> */

/* visibility waits for the slide, so fields leave the tab order only once hidden. */
.workspace_body > .query_panel {
    transition: margin-left 0.32s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s;
}

.workspace_body > .query_panel.folded {
    margin-left: -450px;
    visibility: hidden;
    transition: margin-left 0.32s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s 0.32s;
}

@media (min-width: 1024px) {
    .workspace_body { overflow: hidden; }
}

.panel_edge {
    position: relative;
    z-index: 5;
    flex: 0 0 0;
}

.panel_handle {
    position: absolute;
    top: 50%;
    left: -13px;
    transform: translateY(-50%);
    width: 26px;
    height: 68px;
    padding: 0;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    color: var(--text);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-dark);
    border-radius: 8px;
    cursor: pointer;

    transition: left 0.32s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.2s, border-color 0.2s;
}

.panel_handle:hover { background-color: var(--accent-wash); border-color: var(--accent); }
.panel_handle:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.folded + .panel_edge .panel_handle { left: 0; }

.handle_count {
    position: absolute;
    top: -9px;
    right: -9px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;

    display: none;
    font-size: 11px;
    font-weight: 600;
    line-height: 16px;
    color: var(--accent-ink);
    background-color: var(--accent-tint);
    border: 1px solid var(--accent-line);
}

.folded + .panel_edge .handle_count:not(:empty) { display: block; }

@media (max-width: 1023px) {
    .workspace_body > .query_panel {
        overflow: hidden;
        transition: max-height 0.32s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s;
    }

    .workspace_body > .query_panel.folded {
        margin-left: 0;
        max-height: 0;
        border-bottom: 0;
        transition: max-height 0.32s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s 0.32s;
    }

    .workspace_body .panel_handle {
        top: -14px;
        left: 50%;
        transform: translateX(-50%);
        width: 76px;
        height: 28px;
        flex-direction: row;
        transition: top 0.32s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.2s;
    }

    .workspace_body .panel_handle .arrow { rotate: 90deg; }
    .workspace_body .panel_handle[aria-expanded="true"] .arrow { rotate: -90deg; }

    .workspace_body .folded + .panel_edge .panel_handle { top: 0; left: 50%; }

}

@media (prefers-reduced-motion: reduce) {
    .workspace_body > .query_panel,
    .workspace_body > .query_panel.folded,
    .panel_handle { transition: none; }
}

.landing_count {
    min-height: 18px;
    margin-top: 10px;

    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
}

/* <---------------------result cards---------------------------> */

/* minmax(0, 1fr): a long entity name has no break and would widen the row. */
.results_list.as_cards {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding: 16px;
}

.result_card {
    padding: 20px;
    border-radius: 10px;

    background-color: var(--bg-secondary);
    border: 1px solid var(--border);

    display: grid;
    grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
    grid-template-areas: "picture head" "picture facts" "picture rest";
    grid-template-rows: auto auto 1fr;
    gap: 0 28px;
    align-items: start;

    cursor: pointer;
    transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}

.result_card:hover {
    border-color: var(--input-border-hover);
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgb(var(--shadow-rgb) / 0.06),
                0 8px 24px rgb(var(--shadow-rgb) / 0.12);
}

@media (prefers-reduced-motion: reduce) {
    .result_card {
        transition: none;
    }

    .result_card:hover {
        transform: none;
    }
}

.card_picture,
.grid_tile_picture {
    display: block;
    aspect-ratio: 2 / 1;
    background: var(--bg-primary);
    border: 1px dashed var(--input-border);
    border-radius: 10px;
}
.card_picture {
    grid-area: picture;
    align-self: start;
}
.card_id a { color: inherit; text-decoration: none; }
.card_id a:hover { color: var(--accent); }

.card_head { grid-area: head; min-width: 0; }

.card_id {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 8px;
    font-size: 24px;
    font-weight: 800;
}
.card_badge {
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-ink);
    background: var(--accent-tint);
}
.card_title {
    margin: 0 0 16px;
    font-size: 15.5px;
    font-weight: 600;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.card_facts {
    grid-area: facts;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 14px 20px;
    margin: 0;
}
.card_facts dt,
.card_label {
    font-size: 10.5px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-dim);
}
.card_facts dd { margin: 2px 0 0; font-weight: 700; }
.card_facts small { font-weight: 400; color: var(--text-muted); }

.card_rest .card_field { flex: 0 1 auto; min-width: 90px; max-width: 260px; }
.card_rest {
    grid-area: rest;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px 24px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.card_value {
    margin-top: 2px;
    font-size: 13px;
    overflow-wrap: anywhere;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@container results (max-width: 1099px) {
    .result_card {
        grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
        grid-template-areas: "picture head" "picture facts" "rest rest";
        grid-template-rows: auto 1fr auto;
        gap: 0 22px;
    }
    .card_facts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 16px; }
}

@container results (max-width: 759px) {
    .result_card {
        grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
        grid-template-areas: "picture head" "facts facts" "rest rest";
        grid-template-rows: auto;
        gap: 0 18px;
    }
    .card_id { font-size: 20px; }
    .card_title { font-size: 14.5px; margin-bottom: 0; }
    .card_facts { margin-top: 16px; }
    .card_rest { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .card_rest .card_field { max-width: none; }
}

.card_when, .card_brief { display: none; }

@container results (max-width: 489px) {
    .result_card {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "head" "picture" "brief" "rest";
        grid-template-rows: auto;
        gap: 0;
    }
    .card_head { display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 8px; }
    .card_id { font-size: 18px; }
    .card_when { display: block; grid-column: 2; grid-row: 1; justify-self: end; margin: 0; font-size: 12px; color: var(--text-muted); white-space: nowrap; }
    .card_title {
        grid-column: 1 / -1;
        margin: 4px 0 10px;
        font-size: 14px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .card_picture { aspect-ratio: auto; height: 110px; }
    .card_facts { display: none; }
    .card_brief { display: block; grid-area: brief; min-width: 0; }
    .card_nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 10px 0 6px; text-align: center; }
    .card_nums b { display: block; font-size: 16px; color: var(--text); }
    .card_nums span { font-size: 11px; color: var(--text-muted); }
    .card_cite { margin: 0; font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .card_chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 0; }
    .card_chip { padding: 1px 7px; font-size: 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-primary); }
    .card_chip_dim { color: var(--text-muted); }
    .card_actions { display: flex; justify-content: flex-end; margin-top: 10px; padding-top: 6px; border-top: 1px solid var(--border); }
    .card_more { margin-left: auto; padding: 6px 4px; font: inherit; font-size: 13px; color: var(--text-muted); background: none; border: 0; cursor: pointer; }
    .card_rest { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 10px; }
    .result_card:not(.show_more) .card_rest:not(:has(.searched)) { display: none; }
    .result_card:not(.show_more) .card_field:not(.searched) { display: none; }
}

.view_switch {
    display: flex;
    border: 1px solid var(--input-border);
    border-radius: 5px;
    overflow: hidden;
}

.view_switch button {
    padding: 6px 14px;

    font: inherit;
    font-size: 12px;
    font-weight: 600;

    color: var(--text-muted);
    background-color: transparent;
    border: none;

    cursor: pointer;
}

.view_switch button + button {
    border-left: 1px solid var(--input-border);
}

.view_switch button:hover {
    color: var(--text);
}

.view_switch button[aria-pressed="true"] {
    color: var(--on-accent);
    background-color: var(--accent);
}

/* <---------------------report preview---------------------------> */

.preview_scroll {
    overflow: auto;

    border: 1px solid var(--border);
    border-radius: 6px;
    background-color: var(--bg-secondary);
}

/* max-content, not 100%, or extra columns squeeze instead of scrolling. */
.preview_table {
    border-collapse: collapse;
    width: max-content;
    min-width: 100%;
    font-size: 12px;
}

.preview_table thead th {
    position: sticky;
    top: 0;

    padding: 10px 12px;
    text-align: left;
    white-space: nowrap;

    color: var(--text-muted);
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-dark);

    z-index: 1;
}

.preview_table td {
    padding: 9px 12px;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}

.preview_table td {
    min-width: 90px;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview_table tbody tr:hover td {
    background-color: var(--bg-primary);
}

.preview_note {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-dim);
}

/* min-height: 0, or a flex item will not shrink below its content. */
.report_body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.report_preview {
    flex: 1;
    min-height: 0;

    display: flex;
    flex-direction: column;
}

.report_body .preview_scroll {
    flex: 1;
    min-height: 0;
}

.interface > .query_panel:has(#report_fields) {
    transition: margin-left 0.32s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s;
}
.interface > .query_panel.folded:has(#report_fields) {
    margin-left: -450px;
    visibility: hidden;
    transition: margin-left 0.32s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s 0.32s;
}
.interface > .query_panel.folded + .panel_edge { flex-basis: 26px; }

@media (max-width: 1023px) {
    .interface > .query_panel.folded:has(#report_fields) { margin-left: -320px; }
}

@media (prefers-reduced-motion: reduce) {
    .interface > .query_panel:has(#report_fields),
    .interface > .query_panel.folded:has(#report_fields) { transition: none; }
}

@media (min-width: 641px) {
    .fields_toggle { display: none; }
    .interface:has(#report_fields) { overflow: hidden; }
    .interface:has(#report_fields) > .rail { position: relative; z-index: 6; }
}

.fields_toggle {
    margin-left: auto;
    padding: 6px;
    border-radius: 5px;

    background-color: transparent;
    border: 0;
    line-height: 0;

    cursor: pointer;
}

.fields_toggle:hover { background-color: var(--accent-wash); }

.source_legend {
    margin: 2px 0 8px;
    font-size: 12px;
    color: var(--text-dim);
}

.source_table td {
    vertical-align: top;
}

.source_table tr.segment_continues td {
    border-bottom: none;
}

.pair_bar {
    display: flex;
    height: 22px;
    margin: 4px 0 6px;
    border-radius: 4px;
    overflow: hidden;
    font-size: 12px;
}
.pair_bar > span {
    display: flex;
    align-items: center;
    padding-left: 8px;
    white-space: nowrap;
    overflow: hidden;
}
.pair_bar_label { padding-left: 0.3em; }
@media (max-width: 600px) { .pair_bar_label { display: none; } }
.pair_au { background: #5dcaa5; color: #04342c; }
.pair_gc { background: #0f7a58; color: #eeedfe; }
.pair_gu { background: #e0a030; color: #412402; }
.pair_nc { background: #7f77dd; color: #eeedfe; }
.pair_legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 12px;
    color: var(--text-muted);
}
.pair_legend i {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 5px;
    border-radius: 2px;
}
.pair_caption {
    margin: 14px 0 6px;
    font-size: 12px;
    color: var(--text-dim);
}
.pair_families {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
}
.pair_families > span {
    padding: 2px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-secondary);
    cursor: help;
}
.pair_chains, .pair_links { margin: 12px 0 0; font-size: 13px; }
.pair_list { font-size: 13px; }
.pair_links { padding-left: 18px; }
.pair_list { margin-top: 12px; }
.pair_list summary { cursor: pointer; color: var(--accent); }
.pair_list .molecule_table { width: auto; min-width: 380px; }
.pair_list .molecule_table td, .pair_list .molecule_table th { padding-right: 32px; }

.molecule_table tr:has(+ .sequence_row) td { border-bottom: none; }
.sequence_row td { padding-top: 0; }
.sequence summary { cursor: pointer; color: var(--accent); font-size: 12px; }
.sequence_body {
    margin: 6px 0;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-primary);
    font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.8;
    overflow-x: auto;
    max-height: 420px;
    overflow-y: auto;
}
.sequence_body > div { white-space: pre; }
.sequence_num {
    display: inline-block;
    width: 5ch;
    margin-right: 1.5ch;
    text-align: right;
    color: var(--text-dim);
    user-select: none;
}
.sequence_modified {
    background: #cecbf6;
    color: #26215c;
    font-weight: 600;
    text-decoration: none;
    border-radius: 2px;
    cursor: help;
}
.sequence_unmodelled {
    color: var(--text-dim);
    text-decoration: underline dotted;
    cursor: help;
}
.sequence_foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    font-size: 12px;
    color: var(--text-dim);
}
.sequence_foot .sequence_modified, .sequence_foot .sequence_unmodelled {
    font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
    padding: 0 2px;
}
.sequence_actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.sequence_copy {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--accent);
    font-size: 12px;
    text-decoration: none;
    cursor: pointer;
}
.sequence_copy:hover { border-color: var(--border-dark); }
.sequence_actions svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.sequence_copy .icon_done, .sequence_copy.copied .icon_copy { display: none; }
.sequence_copy.copied .icon_done { display: inline; color: var(--focus); }

.entry_fasta { margin-left: auto; position: relative; }
.entry_fasta_menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 5;
    min-width: 230px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-secondary);
    box-shadow: 0 4px 12px rgb(var(--shadow-rgb) / 0.08);
}
.entry_fasta_menu a {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 10px;
    color: var(--text);
    font-size: 13px;
    text-decoration: none;
}
.entry_fasta_menu a + a { border-top: 1px solid var(--border); }
.entry_fasta_menu a:hover { background: var(--bg-primary); }
.entry_fasta_menu span { color: var(--text-dim); }

.suggest_field { position: relative; }
.suggest_list {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 10;
    margin: 2px 0 0;
    padding: 4px 0;
    max-height: 240px;
    overflow-y: auto;
    list-style: none;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--bg-secondary);
    box-shadow: 0 4px 12px rgb(var(--shadow-rgb) / 0.08);
    font-size: 12px;
}
.suggest_list li {
    display: grid;
    grid-template-columns: 3.5em minmax(0, 1fr) auto;
    gap: 8px;
    align-items: baseline;
    padding: 5px 8px;
    cursor: pointer;
}
.suggest_list li:hover, .suggest_list li[aria-selected="true"] { background: var(--bg-primary); }
#source_organism_options li,
#expression_host_options li { grid-template-columns: minmax(0, max-content) minmax(0, 1fr) auto; }
#source_organism_options b,
#expression_host_options b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest_list b { font-weight: 600; color: var(--accent); }
.suggest_list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest_list small { color: var(--text-dim); }
.suggest_list em { font-style: normal; color: var(--text-muted); }

.landing_search, .top_search_box { position: relative; }
.box_suggest {
    position: absolute;
    z-index: 30;
    margin: 0;
    padding: 4px 0;
    max-height: min(420px, 60vh);
    overflow-y: auto;
    list-style: none;
    text-align: left;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-secondary);
    box-shadow: 0 8px 24px rgb(var(--shadow-rgb) / 0.12);
    font-size: 13px;
}
.box_suggest_group {
    padding: 8px 12px 2px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-dim);
}
.box_suggest li[role="option"] {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 6px 12px;
    cursor: pointer;
}
.box_suggest li[role="option"]:hover,
.box_suggest li[aria-selected="true"] { background: var(--bg-primary); }
.box_suggest li[aria-selected="true"] { box-shadow: inset 3px 0 0 var(--accent); }
.box_suggest_name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.box_suggest_name mark { background: none; color: inherit; font-weight: 700; }
.box_suggest_also { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); font-size: 12px; }
.box_suggest small {
    margin-left: auto;
    flex-shrink: 0;
    color: var(--text-dim);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}
.box_suggest_near {
    padding: 8px 12px 2px;
    font-size: 12px;
    color: var(--text-muted);
}
.box_suggest_foot {
    margin-top: 4px;
    padding: 6px 12px 4px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-dim);
}
@media (hover: none) {
    .box_suggest li[role="option"] { min-height: 44px; align-items: center; }
}

.pair_head { display: flex; align-items: center; gap: 8px; }

.more_rows_toggle {
    border: none;
    background: none;
    padding: 4px 0;
    color: var(--accent);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}
.more_rows_toggle:hover { text-decoration: underline; }

.pill_count { margin-left: 2px; opacity: 0.6; font-variant-numeric: tabular-nums; }

/* <---------------------------phones-----------------------------> */

/* Phones scroll the page as one document, so the browser bar can hide. */
@media (max-width: 640px) {
    .interface {
        flex-direction: column;
        height: auto;
        min-height: calc(100dvh - var(--footer-h));
    }

    .workspace { height: auto; }

    .query_panel_body,
    .results_area_body { overflow: visible; }

    .rail {
        position: sticky;
        top: 0;
        z-index: 20;

        width: 100%;
        height: 48px;
        flex-direction: row;
        align-items: center;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .rail-icons { display: contents; }

    .rail-logo,
    .rail-item {
        width: 48px;
        height: 48px;
        border-bottom: 0;
    }

    .rail-logo {
        width: auto;
        margin-right: auto;
        padding: 0 10px;
        flex-direction: row;
        gap: 8px;
    }

    .rail-logo svg { width: 30px; height: 30px; }

    .rail-item { order: 2; }
    .rail-theme { order: 3; margin-top: 0; border-top: 0; }
}

@media (max-width: 1023px) {
    .top_search {
        height: auto;
        padding: 10px 16px;
        grid-template-columns: auto 1fr;
        gap: 8px;
    }

    .top_search_box { grid-column: 1 / -1; grid-row: 1; }
    .top_search_count { grid-column: 1 / -1; grid-row: 2; }
    .top_search_count:empty { display: none; }
    .match_switch   { grid-column: 1; grid-row: 3; }

    .top_search input {
        flex: 1;
        min-width: 0;
        width: auto;
        font-size: 16px; /* below 16px iOS zooms the page on focus */
    }

    .workspace .results_area_header {
        height: auto;
        padding: 12px 16px;

        display: grid;
        grid-template-columns: auto 1fr auto;
        gap: 8px;
        align-items: center;
    }

    .workspace .results_count,
    .workspace .results_tools { display: contents; }

    .workspace .results_area_header h1 { grid-column: 1 / 3; grid-row: 1; }
    .results_range  { grid-column: 3; grid-row: 1; justify-self: end; }
    .view_switch    { grid-column: 1; grid-row: 2; }
    .sort_field     { grid-column: 2; grid-row: 2; min-width: 0; }
    .per_page_field { grid-column: 3; grid-row: 2; }

}

@media (max-width: 640px) {
    .match_switch button,
    .top_search_box button { min-height: 44px; }

    .workspace_body > .query_panel { max-height: 60dvh; }
    #query_form .query_panel_body { overflow-y: auto; }
    .query_panel_header { height: 52px; padding: 0 16px; }

    .category_header { padding: 0 16px; }
    .category_body { padding: 12px 16px 16px; }

    .pill { min-height: 36px; padding: 6px 14px; font-size: 13px; }

    .field input,
    .range_row input { font-size: 16px; padding: 10px; }

    .query_panel_footer { height: auto; padding: 12px 16px; }
    .query_panel_footer .search,
    .query_panel_footer .download { width: 100%; min-height: 48px; font-size: 15px; }

    .sort_field span,
    .per_page_field span { display: none; }

    .sort_field select { width: 100%; }

    .view_switch button,
    .sort_field select,
    .per_page_field input { min-height: 40px; font-size: 14px; }

    .per_page_field input { width: 64px; }

    .results_list.as_cards { gap: 8px; padding: 12px; }

    .result_card { padding: 14px; }
    .result_card:hover { transform: none; }

    .result_row { padding: 12px; }

    .pagination { bottom: 10px; gap: 4px; }

    .page_num,
    .page_arrow { min-width: 34px; min-height: 40px; padding: 5px 6px; font-size: 14px; }
}

/* <---------------------how the box was read---------------------> */

.search_note {
    flex-shrink: 0;
    margin: 0;
    padding: 8px 24px;
    border-bottom: 1px solid var(--border);

    font-size: 13px;
    line-height: 1.6;
    color: var(--text-muted);
}

.note_tag {
    display: inline-block;
    margin-right: 4px;
    padding: 0 8px;
    border-radius: 999px;

    font-size: 12px;
    font-weight: 600;
    color: var(--accent-ink);
    background-color: var(--accent-tint);
    border: 1px solid var(--accent-line);
}

@media (max-width: 1023px) {
    .search_note { padding: 8px 16px; }
}

/* <---------------------filters in use---------------------------> */

.active_filters {
    flex-shrink: 0;
    padding: 8px 24px;
    border-bottom: 1px solid var(--border);

    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.active_filters:empty,
.workspace:has(#query_form:not(.folded)) .active_filters { display: none; }

.filter_chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 4px 6px 4px 12px;
    border-radius: 999px;

    font: inherit;
    font-size: 12px;
    color: var(--accent-ink);
    background-color: var(--accent-tint);
    border: 1px solid var(--accent-line);
    cursor: pointer;
}

.filter_chip span {
    font-size: 16px;
    line-height: 1;
    opacity: 0.7;
}

.filter_chip:hover { border-color: var(--accent-hover-line); }
.filter_chip:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

@media (max-width: 640px) {
    .active_filters { padding: 8px 12px; }
    .filter_chip { min-height: 36px; font-size: 13px; }
}

@media (max-width: 640px) {
    .detail_body { padding: 16px; }

    .molecule_scroll { -webkit-overflow-scrolling: touch; }
    .molecule_table { min-width: 520px; }
    .pair_list .molecule_table { min-width: 420px; }

    .sequence_copy, .download_small { min-height: 36px; padding-inline: 10px; }

    .molecule_group summary,
    .sequence summary,
    .pair_list summary,
    .more_rows_toggle { padding-block: 8px; }
}

@media (max-width: 640px) {
    .interface > .results_area:has(.report_body),
    .interface > .query_panel:has(#report_fields) { display: contents; }

    .interface > .query_panel.folded:has(#report_fields) { margin-left: 0; visibility: visible; }
    .query_panel.folded > #report_fields { display: none; }
    .interface > .panel_edge { display: none; }

    .interface:has(.report_body) .results_area_header { order: 1; padding: 0 16px; }
    .report_tabs   { order: 2; padding: 8px 16px; background-color: var(--bg-secondary); }
    .report_tab    { min-height: 40px; font-size: 13px; }
    .report_why    { order: 2; padding: 0 16px 8px; background-color: var(--bg-secondary); }
    #report_fields { order: 3; flex: none; }
    .report_body   { order: 4; overflow: visible; padding: 12px 16px 16px; }
    #report_fields + .query_panel_footer { order: 5; }
    .report_row_note { padding: 12px 16px 0; }

    .query_panel_header:has(+ .report_tabs) { display: none; }

    .query_panel:has(#report_fields) > .query_panel_footer {
        display: block;
        position: sticky;
        bottom: var(--footer-h);
        padding: 12px 16px;
        background-color: var(--bg-secondary);
        border-top: 1px solid var(--border);
    }

    .query_panel_footer #export_button,
    .query_panel_footer #zip_button { width: 100%; min-height: 48px; }

    #report_fields { background-color: var(--bg-secondary); border-bottom: 1px solid var(--border); }
    .report_group { padding: 14px 16px; }
    .check_row { min-height: 36px; }

    .fields_toggle {
        display: flex;
        align-items: center;
        gap: 6px;
        min-height: 40px;
        padding: 0 10px;
        line-height: normal;
        font: inherit;
        font-size: 13px;
        color: var(--text-muted);
    }

    .fields_toggle::before { content: "Fields"; }
    .fields_toggle[aria-expanded="true"] > .arrow_side { rotate: 90deg; }

    .report_body .preview_scroll { max-height: 70vh; }
}

@media (max-width: 640px) {
    .landing { padding: 16px; align-items: flex-start; }
    .landing_inner { margin: 12vh 0 0; }
    .landing_wordmark { width: min(56vw, 225px); }

    .landing_search { flex-direction: column; align-items: stretch; }
    .landing_search input { font-size: 16px; }
    .landing_search > button[type="submit"] { min-height: 48px; }

    .landing_advanced { padding: 10px 16px; }

    .browse_lead { margin-top: 12px; }
    .browse {
        grid-template-columns: 1fr;
        grid-template-areas: "made" "from" "method" "modified" "bound";
    }
    .browse_link, .browse_options a { padding: 9px 0 10px; font-size: 15px; }
    .picking .browse_options a { padding: 9px 6px 10px; }
    .browse_card .browse_answer a { min-width: 46px; padding: 7px 10px; font-size: 14px; }

    .empty_state .detail_link { padding: 10px 4px; font-size: 15px; }
}

/* <---------------structure page sections-------------> */
.group_views,
.group_overview    { --sec: #378add; --tint: var(--tint-blue); --ink: var(--ink-blue); }
.group_composition { --sec: #ba7517; --tint: var(--tint-amber); --ink: var(--ink-amber); }
.group_structure   { --sec: #1d9e75; --tint: var(--tint-teal); --ink: var(--ink-teal); }
.group_references  { --sec: var(--sec-gray); --tint: var(--tint-gray); --ink: var(--ink-gray); }

.structure_page {
    display: grid;
    grid-template-columns: 180px 0 minmax(0, 1fr);
    align-items: start;
}
.structure_page.nav_folded { grid-template-columns: 0 26px minmax(0, 1fr); }

.structure_page .detail_body {
    max-width: 1100px;
    padding-top: 16px;
}

.section_nav {
    position: sticky;
    top: 0;
    max-height: calc(100vh - 60px - var(--footer-h));
    overflow-y: auto;
    padding: 12px 0 24px;
    border-right: 1px solid var(--border);
    background: var(--bg-secondary);
    min-height: calc(100vh - 60px - var(--footer-h));
}

.nav_group_label {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 12px 16px 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.nav_group_label::before,
.nav_item::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sec);
    flex-shrink: 0;
}

.nav_item::before { display: none; }

@media (min-width: 1024px) {
    .nav_item.nav_solo {
        margin-top: 6px;
        padding-left: 16px;
        font-size: 11px;
        font-weight: 600;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        color: var(--text-muted);
    }

    .nav_item.nav_solo::before { display: block; }
}

.nav_item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px 6px 31px;
    font-size: 13px;
    color: var(--text);
    text-decoration: none;
}

.nav_item:hover { background: var(--bg-primary); }

.nav_item[aria-current="true"] {
    background: var(--tint);
    color: var(--ink);
    font-weight: 600;
    box-shadow: inset -3px 0 0 var(--sec);
}

.nav_item.empty { color: var(--text-dim); }

.nav_edge {
    position: sticky;
    top: 0;
    z-index: 5;
    height: calc(100vh - 60px - var(--footer-h));
}

.structure_page { transition: grid-template-columns 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); }
.section_nav { transition: visibility 0s; }
.nav_folded .section_nav {
    visibility: hidden;
    transition: visibility 0s 0.32s;
}
.nav_folded .nav_handle { left: 0; }

@media (prefers-reduced-motion: reduce) {
    .structure_page,
    .section_nav { transition: none; }
}

.page_section:first-of-type { margin-top: 0; }

.structure_lead .detail_value {
    font-size: 15px;
    line-height: 1.45;
}

.page_section {
    margin-top: 32px;
    scroll-margin-top: 12px;
}

.section_band {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 -20px 10px;
    padding: 8px 20px;
    background: var(--tint);
    border-left: 4px solid var(--sec);
    color: var(--ink);
}

.band_group {
    display: block;
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0.8;
}

.section_band h2 {
    font-size: 16px;
    font-weight: 600;
}

.band_tools {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.band_fold {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--ink);
    cursor: pointer;
}

.help > summary {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1.5px solid var(--accent);
    border-radius: 50%;
    background: var(--accent-wash);
    color: var(--accent);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    list-style: none;
    transition: background 0.15s, color 0.15s;
}

.help > summary:hover { background: var(--accent-tint); }
.help[open] > summary { background: var(--accent); color: var(--on-accent); }

.help > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
    .help > summary { transition: none; }
}

.band_fold:hover { background: var(--accent-wash); }

.band_swap { display: none; }

.band_swap::before {
    width: 15px;
    height: 10px;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 16' fill='none' stroke='black' stroke-width='1.8'%3E%3Crect x='0.9' y='0.9' width='7' height='14.2' rx='1.8'/%3E%3Crect x='11' y='0.9' width='12.1' height='14.2' rx='1.8' fill='black'/%3E%3C/svg%3E");
}

.band_swap[aria-pressed="true"]::before {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 16' fill='none' stroke='black' stroke-width='1.8'%3E%3Crect x='0.9' y='0.9' width='12.1' height='14.2' rx='1.8' fill='black'/%3E%3Crect x='16.1' y='0.9' width='7' height='14.2' rx='1.8'/%3E%3C/svg%3E");
}

.help { position: relative; }

.help p {
    position: absolute;
    right: 0;
    top: 32px;
    z-index: 5;
    width: min(320px, 80vw);
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-secondary);
    box-shadow: 0 4px 16px rgb(var(--shadow-rgb) / 0.08);
    font-size: 13px;
    line-height: 1.5;
    color: var(--text);
}

.page_section .molecule_group > summary {
    padding-left: 8px;
    border-left: 3px solid var(--sec);
}

.jump_to {
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--text-dim);
}

.jump_to a { color: var(--accent); }

.page_section [id], .page_section .in_place { scroll-margin-top: 12px; }

.section_none {
    font-size: 13px;
    color: var(--text-dim);
}

.page_section.empty .section_band { opacity: 0.7; }

.link_list {
    list-style: none;
    font-size: 13px;
    line-height: 2;
}

.link_list a { color: var(--accent); }
.link_files { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }

@media (max-width: 1023px) {
    .structure_page { display: block; }

    .section_nav {
        z-index: 10;
        display: flex;
        gap: 6px;
        min-height: 0;
        padding: 8px 16px;
        overflow-x: auto;
        overflow-y: hidden;
        border-right: none;
        border-bottom: 1px solid var(--border);
        scrollbar-width: none;
    }

    .nav_group { display: contents; }
    .nav_group_label { display: none; }
    .nav_edge { display: none; }
    .nav_folded .section_nav { visibility: visible; }

    .nav_item {
        flex-shrink: 0;
        padding: 5px 10px;
        border: 1px solid var(--border);
        border-radius: 999px;
        white-space: nowrap;
        font-size: 12px;
    }

    .nav_item::before { display: block; width: 6px; height: 6px; }

    .nav_item[aria-current="true"] {
        border-color: var(--sec);
        box-shadow: none;
    }

    .page_section,
    .page_section [id],
    .page_section .in_place { scroll-margin-top: 60px; }
}

@media (max-width: 640px) {
    .section_nav { top: 48px; }

    .section_band { margin-inline: -16px; padding-inline: 16px; }

    .page_section,
    .page_section [id],
    .page_section .in_place { scroll-margin-top: 104px; }

    .band_fold, .help > summary { width: 34px; height: 34px; }
}

/* <---------------landing: stats line and footer-------------> */
.landing_page {
    flex-grow: 1;
    min-width: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.landing_stats {
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-dim);
}

.landing_stats b {
    font-weight: 600;
    color: var(--text-muted);
}

:root { --footer-h: 44px; }

.site_footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    height: var(--footer-h);
    box-sizing: border-box;

    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-primary);
    font-size: 13px;
    color: var(--text-muted);
}

.site_footer_links {
    display: flex;
    gap: 18px;
    margin: 0 auto;
}

.site_footer_links a {
    color: var(--accent);
    text-decoration: none;
}

.site_footer_links a:hover { text-decoration: underline; }

.site_footer_support {
    display: flex;
    align-items: center;
    gap: 8px;
}

.support_tile {
    display: grid;
    place-items: center;
    padding: 3px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-secondary);
}

.support_tile img {
    display: block;
    height: 18px;
    width: auto;
    filter: var(--icon-filter);
}

@media (max-width: 640px) {
    :root { --footer-h: 48px; }
    body { padding-bottom: var(--footer-h); }

    /* Not a scroller, or the tick bar would stick inside a box that never scrolls. */
    .landing_page { flex-grow: 1; overflow-y: visible; }

    .site_footer { padding: 0 12px; gap: 8px; }
    .site_footer_copy,
    .site_footer_support_label { display: none; }
    .site_footer_links { margin: 0 auto 0 0; gap: 14px; }
    .site_footer_links a { padding: 12px 2px; }
}

.arc_picture {
    margin: 0 0 16px;
    padding: 10px 10px 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.arc_picture svg { display: block; width: 100%; height: auto; }
.arc_views {
    display: inline-flex;
    flex-wrap: wrap;
    max-width: 100%;
    margin: 0 0 8px;
    gap: 1px;                              /* the rules between cells, also when they wrap */
    background: var(--input-border);
    border: 1px solid var(--input-border);
    border-radius: 5px;
    overflow: hidden;
}
.arc_views a {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    flex: 1 0 auto;
    text-align: center;
    color: var(--text-muted);
    background: var(--bg-secondary);
    text-decoration: none;
}
.arc_views a:hover { color: var(--text); }
.arc_views a[aria-current="true"] { color: var(--on-accent); background-color: var(--accent); }
.arc_strand { stroke: var(--strand); stroke-width: 2.2; stroke-linecap: round; }
.arc_copy   { stroke-dasharray: 4 2.5; }
.arc_lines path { fill: none; }
.arc_lines path:hover { stroke-width: 2.6; }
path.arc_dot { fill: var(--pair-mod); }
path.arc_wc { stroke: var(--pair-wc); }
path.arc_gu { stroke: var(--pair-gu); }
path.arc_nc { stroke: var(--pair-nc); }
.arc_name { font-size: 9px; fill: var(--text-muted); }
.arc_end  { text-anchor: end; }
.arc_mid  { text-anchor: middle; font-weight: 600; }
.arc_picture figcaption {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}
.arc_key { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.arc_key i {
    display: inline-block;
    width: 14px;
    height: 3px;
    margin: 0 5px 2px 0;
    vertical-align: middle;
    border-radius: 2px;
}
.arc_key i.arc_wc { background: var(--pair-wc); }
.arc_key i.arc_gu { background: var(--pair-gu); }
.arc_key i.arc_nc { background: var(--pair-nc); }
.arc_key i.arc_mod { width: 7px; height: 7px; border-radius: 50%; background: var(--pair-mod); }

.arc_zoom {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: zoom-in;
}
.arc_picture:has(.arc_zoom:hover) { border-color: var(--accent-hover-line); }
.arc_full {
    margin-left: 10px;
    padding: 1px 8px;
    font: inherit;
    color: var(--text);
    background: var(--bg-secondary);
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    cursor: pointer;
}
.arc_viewer {
    width: calc(100vw - 32px);
    height: calc(100vh - 32px);
    max-width: none;
    max-height: none;
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 12px;
    overflow: hidden;
}
.arc_viewer::backdrop { background: var(--backdrop); }
@media (max-width: 820px) {
    .arc_viewer { width: 100vw; height: 100dvh; border-radius: 0; }
}
.arc_viewer.in_place {
    position: static;
    display: block;
    width: 100%;
    height: min(86vh, 960px);
    margin: 12px 0 20px;
    border: 1px solid var(--border-dark);
    border-radius: 12px;
}
@media (max-width: 820px) {
    .arc_viewer.in_place { height: 86dvh; border-radius: 10px; }
}
.seqmap_dialog.in_place, .ss_dialog.in_place { height: auto; max-height: min(86vh, 960px); }
.seqmap_dialog.in_place .av_box, .ss_dialog.in_place .av_box { height: auto; max-height: inherit; }
.av_box { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: 100%; background: var(--bg-secondary); }
.av_top {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}
.av_top strong { font-size: 18px; }
.av_title {
    flex: 1;
    min-width: 0;
    font-size: 13.5px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.av_top button, .av_zoom button {
    padding: 3px 10px;
    font: inherit;
    font-size: 13px;
    color: var(--text);
    background: var(--bg-secondary);
    border: 1px solid var(--border-dark);
    border-radius: 7px;
    cursor: pointer;
}
.av_main { display: grid; grid-template-columns: minmax(0, 1fr) 400px; min-height: 0; }
@media (max-width: 820px) {
    .av_main { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; overflow: auto; }
}
.av_stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--border); }
@media (max-width: 820px) {
    .av_stage { min-height: 70dvh; border-right: 0; }
}

.av_summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-primary);
}
.av_summary div { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); }
.av_summary b { display: block; font-size: 17px; letter-spacing: 0; text-transform: none; color: var(--text); }
.av_summary small { font-size: 12px; font-weight: 400; color: var(--text-muted); }

.av_zoom { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 16px 0; font-size: 12px; color: var(--text-muted); }
.av_svg { flex: 1; width: 100%; min-width: 0; min-height: 0; overflow: hidden; cursor: grab; touch-action: none; }
.av_svg.av_drag { cursor: grabbing; }
.av_svg .arc_lines path { fill: none; vector-effect: non-scaling-stroke; transition: opacity .1s; }
.av_svg .arc_strand { stroke-width: 3; }
.av_svg.av_dim .arc_lines path, .av_svg.av_dim .av_sym { opacity: .14; }
.av_svg.av_dim .arc_lines path.av_on, .av_svg.av_dim .av_sym.av_on { opacity: 1; }
.av_svg.av_dim .arc_lines path.av_on { stroke-width: 3.2; }
.av_sym { color: var(--pair-sym); pointer-events: none; }
.av_mod { fill: var(--pair-mod); }
.av_end { fill: #f43f5e; }
.av_letter { font: 600 10.5px ui-monospace, SFMono-Regular, Menlo, monospace; fill: var(--ink-gray); text-anchor: middle; }
.av_letter_mod { fill: var(--on-pair-mod); }
.av_tick { stroke: var(--border-dark); }
.av_ticklabel { font-size: 11px; fill: var(--text-dim); text-anchor: middle; }
.av_label { font-size: 13px; fill: var(--text-muted); }
.av_right { text-anchor: end; }
.av_name { text-anchor: middle; font-weight: 600; }

.av_info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 84px;
    padding: 10px 16px 12px;
    border-top: 1px solid var(--border);
    background: var(--bg-primary);
}
.av_info .av_k { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); }
.av_info b { font-size: 16px; }
.av_info span { font-size: 13px; color: var(--text-muted); }
.av_glyph { color: var(--ink-gray); vertical-align: -1px; }

.av_side { display: flex; flex-direction: column; min-height: 0; font-size: 13px; }
.av_sec { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.av_side h4 {
    margin: 0 0 8px;
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-dim);
}
.av_fams { display: flex; flex-wrap: wrap; gap: 6px; }
.av_fam {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px 3px 4px;
    font: inherit;
    font-size: 12.5px;
    color: var(--text);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
}
.av_fam em { font-style: normal; color: var(--text-muted); }
.av_fam[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-wash); }
.av_legend { display: flex; flex-wrap: wrap; gap: 2px 12px; margin: 8px 0 0; font-size: 11.5px; color: var(--text-muted); }
.av_copynote { margin: 6px 0 0; font-size: 12px; color: var(--text-muted); }

.av_list { flex: 1; min-height: 0; overflow: auto; }
@media (max-width: 820px) {
    .av_side { min-height: auto; }
    .av_list { flex: none; max-height: 60dvh; }
}
.av_list table { width: 100%; border-collapse: collapse; font-size: 13px; }
.av_list th {
    position: sticky;
    top: 0;
    padding: 8px 10px;
    text-align: left;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-dim);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}
.av_list td { padding: 5px 10px; white-space: nowrap; border-bottom: 1px solid var(--bg-primary); }
.av_list td:first-child { color: var(--text-dim); }
.av_list tbody tr { cursor: pointer; }
.av_list tbody tr:hover, .av_list tbody tr.av_row_on { background: var(--row-hover); }
.av_modres { color: var(--pair-mod); font-weight: 700; }
.av_sw { display: inline-block; width: 12px; height: 3px; margin-right: 6px; vertical-align: middle; border-radius: 2px; }
.av_sw.arc_wc { background: var(--pair-wc); }
.av_sw.arc_gu { background: var(--pair-gu); }
.av_sw.arc_nc { background: var(--pair-nc); }
.av_table { padding: 8px 14px; font-size: 12.5px; border-top: 1px solid var(--border); }

.results_list.as_grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    padding: 16px;
}
@container results (max-width: 489px) {
    .results_list.as_grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 12px; }
}
.grid_tile {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    color: inherit;
    text-decoration: none;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.grid_tile:hover {
    border-color: var(--input-border-hover);
    box-shadow: 0 2px 4px rgb(var(--shadow-rgb) / 0.06), 0 8px 24px rgb(var(--shadow-rgb) / 0.12);
}
.grid_tile:hover b { color: var(--accent); }
.grid_tile_picture { border-radius: 6px; }
.grid_tile_text { display: flex; flex-direction: column; gap: 2px; }
.grid_tile_text b { font-size: 15px; }
.grid_tile_title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.9em;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--text-muted);
}
.grid_tile_facts { font-size: 11.5px; color: var(--text-dim); }
@media (prefers-reduced-motion: reduce) { .grid_tile { transition: none; } }

/* <---------------structure page: sequence map-------------> */
.seqmap { font-size: 12px; color: var(--text-muted); }
.seqmap_wait { padding: 12px 0; }
.seqmap_tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.seqmap_chips { display: flex; flex-wrap: wrap; gap: 4px; }
.seqmap_chip {
    padding: 2px 10px;
    font: inherit;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border: 1px solid var(--border-dark);
    border-radius: 999px;
    cursor: pointer;
}
.seqmap_chip[aria-pressed="true"] { color: #fff; background: #1d9e75; border-color: #1d9e75; }
.seqmap_partner { border-style: dashed; border-color: #1d9e75; }
.seqmap_scroll {
    display: flex;
    overflow-x: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.seqmap_labels {
    position: sticky;
    left: 0;
    z-index: 1;
    flex: none;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
}
.seqmap_svg { flex: none; display: block; cursor: crosshair; }
.seqmap_label { font: 600 10px ui-monospace, "SFMono-Regular", Menlo, monospace; fill: var(--text-muted); }
.seqmap_over { opacity: 0.7; font-style: italic; }
.seqmap_ruler text { font-size: 9px; fill: var(--text-dim); }
.seqmap_ruler line { stroke: var(--text-dim); }
.seqmap_strand { font-weight: 700; fill: var(--text) !important; }
.seqmap_sep { stroke: var(--border-dark); stroke-dasharray: 3 3; }
.seqmap_base { stroke: var(--border); }
.seqmap_seq { font: 600 12px ui-monospace, "SFMono-Regular", Menlo, monospace; text-anchor: middle; fill: var(--text); }
.seqmap_mod { fill: var(--pair-mod); font-weight: 800; color: var(--pair-mod); }
.seqmap_gone { fill: var(--text-dim); font-weight: 400; font-style: italic; }
.seqmap_dots, .seqmap_marks { font: 600 12px ui-monospace, "SFMono-Regular", Menlo, monospace; text-anchor: middle; }
.seqmap_dots { fill: var(--border-dark); }
.seqmap_band { fill: var(--seq-band); opacity: 0.45; }
.seqmap_partner_band { fill: var(--seq-partner); }
.seqmap_ring { fill: none; stroke: #f43f5e; stroke-width: 1.6; }
.seqmap_pinned .seqmap_band { opacity: 0.7; }
.seqmap_info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 14px;
    min-height: 34px;
    margin-top: 6px;
    padding: 6px 10px;
    color: var(--text);
    background: var(--bg-primary);
    border-radius: 8px;
}
.seqmap_info svg, .seqmap_key svg { vertical-align: -2px; }
.seqmap_hint, .seqmap_none { color: var(--text-dim); }
.seqmap_res { font-size: 13px; }
.seqmap_pair i, .seqmap_key i { display: inline-block; width: 10px; height: 3px; margin: 0 5px 3px 0; vertical-align: middle; border-radius: 2px; }
.seqmap_pair em { color: var(--text-muted); }
.seqmap_key { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 8px; }
.seqmap_key_title { flex-basis: 100%; font-weight: 600; color: var(--text); }
.seqmap_key_title em { font-weight: 400; color: var(--text-muted); }
.seqmap_group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.seqmap_group b { font-weight: 600; color: var(--text-muted); }
.seqmap_group span { display: inline-flex; align-items: center; gap: 3px; }
.seqmap_key .ntc_class_swatch { width: 12px; height: 12px; margin: 0 3px 0 0; border-radius: 2px;
                                box-shadow: inset 0 0 0 1px var(--swatch-edge); }
.seqmap_key_note { flex-basis: 100%; font-size: 12px; color: var(--text-muted); }

.seqmap_buttons { display: inline-flex; gap: 6px; }
.seqmap_full {
    padding: 2px 10px;
    font: inherit;
    color: var(--text);
    background: var(--bg-secondary);
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    cursor: pointer;
}
.seqmap_full:hover { border-color: var(--accent); }
.seqmap_jump {
    padding: 0 4px;
    font: inherit;
    font-weight: 700;
    color: var(--accent);
    background: none;
    border: 0;
    border-bottom: 1px dashed currentColor;
    cursor: pointer;
}
.seqmap_line { fill: var(--text-dim); }
.seqmap_line_gone { fill: var(--border); }
.seqmap_line_mod { fill: var(--pair-mod); }
.seqmap_nan_thin { fill: var(--border-dark); }
.smd_zoom { display: inline-flex; gap: 4px; }
.smd_zoom button, .smd_quick button, .smd_go {
    padding: 3px 10px;
    font: inherit;
    font-size: 13px;
    color: var(--text);
    background: var(--bg-secondary);
    border: 1px solid var(--border-dark);
    border-radius: 7px;
    cursor: pointer;
}
.smd_main { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 0; }
.smd_side { padding: 12px 14px; overflow: auto; border-right: 1px solid var(--border); font-size: 13px; }
.smd_side h4 { margin-bottom: 8px; font-size: 13px; }
.smd_quick { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.smd_quick button { font-size: 12px; padding: 2px 8px; }
.smd_strands { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.smd_strands li { display: grid; grid-template-columns: 1fr auto; gap: 0 6px; align-items: center; }
.smd_strands label { font-weight: 600; cursor: pointer; }
.smd_meta { grid-column: 1; padding-left: 22px; font-size: 11.5px; color: var(--text-muted); }
.smd_go { grid-row: 1 / span 2; grid-column: 2; font-size: 12px; padding: 1px 8px; }
.smd_note { margin-top: 12px; font-size: 12px; color: var(--text-muted); }
.smd_stage { display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 0; padding: 12px 14px; overflow: auto; }
.smd_overview { display: block; flex: none; width: 100%; height: 34px; cursor: pointer; touch-action: none; }
.smd_band { fill: var(--border); }
.smd_band_alt { fill: var(--border-dark); }
.smd_view { fill: rgba(37, 99, 235, .12); stroke: var(--accent); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.smd_names { flex: none; position: relative; height: 14px; margin-top: -4px; font-size: 11px; font-weight: 600; color: var(--text-muted); }
.smd_names span { position: absolute; top: 0; white-space: nowrap; }
.smd_map .seqmap_scroll { overscroll-behavior-x: contain; }
@media (max-width: 820px) {
    .smd_main { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
    .smd_side { max-height: 30dvh; border-right: 0; border-bottom: 1px solid var(--border); }
    .seqmap_dialog .av_top { flex-wrap: wrap; gap: 6px; }
    .seqmap_dialog .av_title { flex-basis: 100%; order: 5; }
}

/* ---- Same sequence in other entries ---------------------------------------- */
.sameseq { font-size: 13px; color: var(--text-muted); }
.ss_group + .ss_group { margin-top: 28px; }
.ss_lead { margin-bottom: 10px; color: var(--text); }
.ss_table_wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-secondary); }
.ss_table { width: 100%; border-collapse: collapse; }
.ss_table th, .ss_table td { padding: 8px 10px; text-align: left; vertical-align: top; border-top: 1px solid var(--border); }
.ss_table thead th { border-top: 0; font-size: 11.5px; font-weight: 600; color: var(--text-muted); background: var(--bg-primary); white-space: nowrap; }
.ss_table tbody:first-of-type tr:first-child > * { border-top: 0; }
.ss_table tbody + tbody tr:first-child > * { border-top: 1px solid var(--border-dark); }
.ss_id { white-space: nowrap; font-weight: 400; }
.ss_id a { color: var(--accent); text-decoration: none; }
.ss_id a:hover { text-decoration: underline; }
.ss_here { display: block; margin-top: 2px; font-size: 11px; color: var(--here); font-weight: 600; }
.ss_title { max-width: 360px; color: var(--text); }
.ss_title span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ss_res { white-space: nowrap; color: var(--text); }
.ss_chain { white-space: nowrap; color: var(--text); }
.ss_chain .ss_dim { display: block; font-size: 11.5px; }
.ss_dim { color: var(--text-dim); }
.ss_label { font-size: 11px; color: var(--text-dim); }
.ss_best { padding: 1px 7px; font-size: 11px; font-weight: 600; color: var(--ok-badge-ink); background: var(--ok-badge-tint); border-radius: 999px; }
.ss_ref { background: var(--ok-wash); }
.ss_self { color: var(--text-dim); font-style: italic; }
.ss_verdict { display: inline-flex; gap: 6px; align-items: baseline; color: var(--text); }
.ss_verdict b, .ss_icon { font-weight: 700; }
.ss_v_same b, .ss_v_same .ss_icon { color: var(--good); }
.ss_v_same_fold b, .ss_v_same_fold .ss_icon { color: var(--accent); }
.ss_v_different_fold b, .ss_v_different_fold .ss_icon { color: var(--warn); }
.ss_v_no_pairs b, .ss_v_no_pairs .ss_icon { color: var(--text-dim); }
.ss_act { text-align: right; }
.ss_go, .ss_run, .ss_full, .ss_swap, .ss_show {
    padding: 4px 12px;
    font: inherit;
    font-size: 13px;
    color: var(--text);
    background: var(--bg-secondary);
    border: 1px solid var(--border-dark);
    border-radius: 7px;
    cursor: pointer;
    white-space: nowrap;
}
.ss_go:hover, .ss_run:hover, .ss_full:hover, .ss_swap:hover, .ss_show:hover { border-color: var(--accent); }
.ss_go[aria-pressed="true"] { color: #fff; background: #1d9e75; border-color: #1d9e75; }
.ss_run { color: #fff; background: #1d9e75; border-color: #1d9e75; }
.ss_run:hover { background: #17845f; border-color: #17845f; }
.ss_show { margin-top: 8px; }

.ss_compare { margin-top: 14px; scroll-margin-top: 80px; }
.ss_bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.ss_bar_title { font-weight: 600; color: var(--text); margin-right: 4px; }
.ss_pick { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.ss_pick select {
    min-width: 0;
    max-width: 260px;
    padding: 4px 22px 4px 10px;
    font: inherit;
    color: var(--text);
    background: var(--bg-secondary);
    border: 1px solid var(--input-border);
    border-radius: 7px;
}
.ss_ab {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    flex: none;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    border-radius: 5px;
}
.ss_ab_a { background: #475569; }
.ss_ab_b { background: #94a3b8; }
.ss_full { margin-left: auto; }

.ss_panel { margin-top: 12px; }
.ss_head { margin-bottom: 8px; }
.ss_big { display: flex; gap: 8px; align-items: baseline; font-size: 17px; font-weight: 600; color: var(--text); }
.ss_icon { font-size: 18px; }
.ss_facts { margin-top: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; color: var(--text-muted); }
.ss_facts .ss_ab { margin-left: 2px; }
.ss_dot { color: var(--text-dim); }
.ss_how { margin: 8px 0 10px; }
.ss_swatch { padding: 0 3px; font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; border-radius: 3px; }
.ss_swatch.ss_na { color: var(--text-dim); }
.ss_only_a { fill: rgba(220, 38, 38, .2); background: rgba(220, 38, 38, .2); }
.ss_only_b { fill: rgba(22, 163, 74, .22); background: rgba(22, 163, 74, .22); }
.seqmap_key i.ss_only_a, .seqmap_key i.ss_only_b { height: 10px; margin-bottom: 0; }
.ss_table .visually_hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ss_na_text { fill: var(--text-dim); }
.ss_gap { fill: #f59e0b; }
.ss_band { fill: rgba(37, 99, 235, .12); }
.ss_lab_mark { fill: #dc2626; }
.ss_mark { cursor: pointer; }
.ss_mark circle { fill: #dc2626; }
.ss_mark text { font-size: 9.5px; font-weight: 700; fill: #fff; pointer-events: none; }
.ss_mark.ss_on circle { fill: var(--accent-strong); }
.ss_chart { min-width: 0; }
.ss_key { margin-top: 8px; }

.ss_list_box { margin-top: 12px; }
.ss_list { list-style: none; display: grid; gap: 2px; }
.ss_list button {
    display: flex;
    gap: 10px;
    width: 100%;
    padding: 6px 8px;
    font: inherit;
    text-align: left;
    color: var(--text);
    background: none;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
}
.ss_list button:hover { background: var(--bg-primary); }
.ss_list button.ss_on { background: var(--accent-wash); border-color: var(--accent-line); }
.ss_n {
    display: inline-grid;
    place-items: center;
    flex: none;
    min-width: 20px;
    height: 20px;
    padding: 0 4px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: #dc2626;
    border-radius: 999px;
}
.ss_on .ss_n { background: var(--accent-strong); }
.ss_said { min-width: 0; }
.ss_detail { display: block; margin-top: 1px; font-size: 12px; color: var(--text-dim); overflow-wrap: anywhere; }
.ss_note { margin-top: 8px; color: var(--text-muted); }

.ss_dialog .ss_dialog_body { min-height: 0; overflow: auto; padding: 12px 16px 16px; }
.ss_dialog .ss_compare { margin-top: 0; }
.ss_dialog .ss_stage { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.ss_dialog .ss_list_box { margin-top: 0; max-height: calc(100dvh - 260px); overflow: auto; padding-right: 4px; }
.ss_dialog .ss_scroll { overscroll-behavior-x: contain; }

@media (max-width: 1023px) {
    .ss_dialog .ss_stage { grid-template-columns: minmax(0, 1fr); }
    .ss_dialog .ss_list_box { max-height: none; }
}

@media (max-width: 640px) {
    .ss_table_wrap { overflow: visible; border: 0; background: none; }
    .ss_table, .ss_table tbody, .ss_table tr, .ss_table th, .ss_table td { display: block; }
    .ss_table thead { display: none; }
    .ss_table tbody {
        margin-bottom: 10px;
        background: var(--bg-secondary);
        border: 1px solid var(--border);
        border-radius: 10px;
        overflow: hidden;
    }
    .ss_table tbody + tbody tr:first-child > *, .ss_table th, .ss_table td { border-top: 0; }
    .ss_table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px 12px; }
    .ss_table tr + tr { border-top: 1px dashed var(--border); }
    .ss_table th, .ss_table td { padding: 0; }
    .ss_id { grid-column: 1; display: flex !important; gap: 8px; align-items: baseline; font-size: 15px; }
    .ss_here { display: inline; margin: 0; }
    .ss_res { grid-column: 2; grid-row: 1; text-align: right; }
    .ss_title { grid-column: 1 / -1; max-width: none; margin-bottom: 6px; color: var(--text-muted); }
    .ss_chain { grid-column: 1; white-space: normal; }
    .ss_vs { grid-column: 1; }
    .ss_act { grid-column: 2; grid-row: span 2; align-self: center; }
    .ss_ref { background: var(--ok-wash); }
    .ss_bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
    .ss_bar_title { grid-column: 1 / -1; }
    .ss_pick { grid-column: 1; }
    .ss_pick select { flex: 1; max-width: none; width: 100%; }
    .ss_swap { grid-column: 2; grid-row: 2 / span 2; align-self: center; }
    .ss_run { grid-column: 1; }
    .ss_full { grid-column: 2; margin: 0; }
    .ss_big { font-size: 16px; }
    .ss_dialog .ss_dialog_body { padding: 10px; }
}
.ss_info { flex-direction: column; align-items: flex-start; gap: 3px; min-height: 62px; }
.ss_hpairs { display: flex; flex-direction: column; gap: 1px; }
.ss_hpair.ss_w_a { color: var(--bad); }
.ss_hpair.ss_w_b { color: var(--good); }
.ss_hpair.ss_w_n { color: var(--text-dim); }
.ss_hdiff { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; color: var(--bad); font-size: 12px; }
.ss_gone_text { color: var(--warn); }
.ss_svg { cursor: crosshair; }

.guide { font-size: 13px; }
.guide > summary { cursor: pointer; color: var(--accent); font-size: 13px; width: max-content; margin-bottom: 4px; }
.guide > summary:hover { text-decoration: underline; }
.guide > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.guide_body { margin: 8px 0 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 6px;
              background: var(--bg-secondary); color: var(--text-muted); line-height: 1.55; }
.guide_body p { margin: 0 0 8px; }
.guide_body p:last-child { margin-bottom: 0; }
.guide_source { font-size: 12px; }
.cana_key { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 4px 16px; margin: 8px 0 10px; }
.cana_key > span { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text); }
.cana_key code { min-width: 30px; font-size: 11px; color: var(--text-muted); }
.cana_swatch { display: inline-block; flex: none; width: 12px; height: 14px; border-radius: 2px;
               box-shadow: inset 0 0 0 1px var(--swatch-edge); }
.ntc_bar { stroke: var(--ntc-edge); stroke-width: 0.6px; }

.ntc_family_name { margin: 12px 0 2px; font-size: 12px; color: var(--text-muted); }
.ntc_line { display: grid; grid-template-columns: minmax(0, 220px) 40px minmax(0, 1fr); gap: 4px 10px;
            align-items: start; padding: 3px 0; font-size: 13px; }
.ntc_chip .cana_swatch { width: 10px; height: 11px; margin: 0 4px -1px 0; }
.ntc_name b { font-weight: 600; }
.ntc_name code { font-size: 11px; color: var(--text-muted); }
.ntc_count { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-muted); }
.ntc_chip { display: inline-block; margin: 0 4px 4px 0; padding: 1px 7px; font-size: 12px; border: 1px solid var(--border);
            border-radius: 4px; background: var(--bg-secondary); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
    .ntc_line { grid-template-columns: minmax(0, 1fr) auto; }
    .ntc_chips { grid-column: 1 / -1; }
}

.map_guide { display: block; width: 100%; max-width: 680px; height: auto; margin: 0 0 6px; }
.map_guide text { font-size: 12px; }
.map_guide .mg_mono { font: 14px ui-monospace, "SFMono-Regular", Menlo, monospace; text-anchor: middle; }
.map_guide .mg_mono:not([style]) { fill: var(--text); }
.map_guide .mg_dot { fill: var(--text-muted); }
.map_guide .mg_ruler { text-anchor: middle; font-size: 11px; fill: var(--text-muted); }
.map_guide .mg_label { font: 600 12px ui-monospace, "SFMono-Regular", Menlo, monospace; }
.map_guide .mg_label:not([style]) { fill: var(--text-muted); }
.map_guide .mg_over { opacity: 0.7; font-style: italic; }
.map_guide .mg_note { fill: var(--text-muted); }
.guide_rules { margin: 0; padding-left: 20px; }
.guide_rules li { margin: 0 0 4px; }
.guide_rules b { color: var(--text); font-weight: 600; }
.mg_caption { margin: 4px 0 10px; color: var(--text-muted); font-size: 0.9em; text-align: center; }

/* ---- Views: 1D, 2D and 3D tiles over one panel each ---------------------- */
.view_tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}
.view_tile {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 10px;
    align-items: center;
    padding: 8px 12px;
    font: inherit;
    text-align: left;
    color: var(--text);
    background: var(--bg-secondary);
    border: 1px solid var(--border-dark);
    border-radius: 8px;
    cursor: pointer;
}
.view_tile:hover { border-color: var(--accent-hover-line); background: var(--accent-wash); }
.view_tile[aria-selected="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-wash); }
.view_tile:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.view_glyph {
    grid-row: 1 / 3;
    width: 40px;
    height: 20px;
    fill: none;
    stroke: var(--text-muted);
    stroke-width: 2;
    stroke-linecap: round;
}
.view_glyph .view_pair { stroke: var(--pair-wc); }
.view_name { font-weight: 600; }
.view_what { font-size: 12px; color: var(--text-muted); }
@media (max-width: 640px) {
    .view_tile { grid-template-columns: 1fr; padding: 8px; text-align: center; justify-items: center; }
    .view_glyph { grid-row: auto; }
    .view_what { display: none; }
}
.lbn_text {
    display: flex;
    font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.lbn_names, .lbn_lines { margin: 0; padding: 10px 0; font: inherit; }
.lbn_names { flex: none; padding-left: 12px; }
.lbn_lines { flex: 1 1 auto; min-width: 0; padding-right: 12px; overflow-x: auto; border-radius: 0 8px 8px 0; }
.lbn_lines:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.lbn_note, .lbn_more { margin: 6px 0 0; font-size: 13px; color: var(--text-muted); }
.view_slot {
    display: grid;
    justify-items: center;
    gap: 8px;
    min-height: 220px;
    align-content: center;
    padding: 20px 16px;
    text-align: center;
    color: var(--text-muted);
    background: var(--bg-primary);
    border: 1px dashed var(--border);
    border-radius: 8px;
}
.view_slot p { margin: 0; max-width: 46ch; font-size: 14px; }
.view_slot_glyph { width: 72px; height: 36px; fill: none; stroke: var(--text-muted); stroke-width: 2; stroke-linecap: round; }
.view_slot_glyph .view_pair { stroke: var(--pair-wc); }
/* 60px header, 16px gap, 44px band, 10px, 16px foot. */
#views > .section_body:has(#view-3d:not([hidden])) {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 146px - var(--footer-h));
    min-height: 420px;
}
@media (max-width: 1023px) {
    #views > .section_body:has(#view-3d:not([hidden])) {
        height: calc(100vh - 191px - var(--footer-h));
    }
}

#views > .section_body:has(#view-3d:not([hidden])) .views,
#views > .section_body:has(#view-3d:not([hidden])) > .views > #view-3d {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.view_3d {
    position: relative;
    flex: 1;
    height: min(70vh, 620px);
    min-height: 240px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-primary);
}
#views > .section_body:has(#view-3d:not([hidden])) .view_3d { height: auto; }
.view_3d .view_slot { position: absolute; inset: 0; border: 0; border-radius: 0; }
.view_3d_start {
    padding: 7px 14px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    background: var(--accent);
    color: var(--on-accent);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.view_3d_start:hover { filter: brightness(1.08); }
.view_3d_start:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.view_3d[data-mounted] .view_3d_start { display: none; }
.view_3d_frame { position: relative; z-index: 1; display: block; width: 100%; height: 100%; border: 0; background: transparent; }
.view_3d:not(.view_3d_ready) .view_3d_frame { opacity: 0; }

.lbn_lines { position: relative; isolation: isolate; cursor: crosshair; }
.lbn_band { position: absolute; top: 0; bottom: 0; z-index: -1; background: var(--accent-wash); box-shadow: inset 0 0 0 1px var(--accent); pointer-events: none; }
.lbn_partner { box-shadow: inset 0 0 0 1px var(--pair-wc); }
.lbn_info { margin: 6px 0 0; min-height: 1.5em; font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
.lbn_find { color: var(--accent); }

.pair_hint { margin: 8px 0 6px; font-size: 13px; color: var(--text-muted); }
.pair_show { color: var(--accent); text-decoration: none; }
.pair_show:hover { text-decoration: underline; }
.pair_table tr.pair_on td { background: var(--accent-wash); }

@media (min-width: 1360px) {
    .structure_page .detail_body {
        --viewer: clamp(360px, 27vw, 560px);
        display: grid;
        grid-template-columns: minmax(0, 1fr) var(--viewer);
        grid-template-rows: repeat(var(--rows), auto) 1fr;
        column-gap: 40px;
        align-content: start;
        max-width: calc(1100px + 40px + var(--viewer));
        overflow: visible;
    }
    .band_swap { display: inline-flex; }
    .structure_page.views_wide .detail_body {
        grid-template-columns: var(--viewer) minmax(0, 1fr);
    }
    .structure_page .detail_body > .page_section { grid-column: 1; }
    .structure_page .detail_body > #views {
        grid-column: 2;
        grid-row: 1 / -1;
        align-self: start;
        position: sticky;
        top: 16px;
        margin-top: 0;
    }
    /* 100vh less header, footer, gaps and the band. */
    .structure_page #views > .section_body {
        max-height: calc(100vh - 146px - var(--footer-h));
        overflow-y: auto;
    }
    .structure_page #views + .page_section { margin-top: 0; }
    .structure_page #views .section_band { margin: 0 0 10px; }
    #views .view_tiles { position: relative; padding-bottom: 22px; margin-bottom: 8px; }
    #views .view_tile { grid-template-columns: auto auto; justify-content: center; padding: 8px; }
    #views .view_glyph { grid-row: auto; }
    #views .view_what { display: none; }
    #views .view_tile[aria-selected="true"] .view_what { display: block; position: absolute; left: 0; bottom: 0; font-size: 13px; }
    .section_nav .group_views { display: none; }
}
