.progress { margin-bottom: 3px; }
.tabular { font-variant-numeric: tabular-nums; }

/* --- Verdict colours: one set of tokens per level, used by the headline, badges and cards --- */
.verdict-low  { --v-bg: var(--bs-success-bg-subtle); --v-border: var(--bs-success-border-subtle); --v-text: var(--bs-success-text-emphasis); }
.verdict-mid  { --v-bg: var(--bs-warning-bg-subtle); --v-border: var(--bs-warning-border-subtle); --v-text: var(--bs-warning-text-emphasis); }
.verdict-high { --v-bg: var(--bs-danger-bg-subtle);  --v-border: var(--bs-danger-border-subtle);  --v-text: var(--bs-danger-text-emphasis); }
.verdict-none { --v-bg: var(--bs-tertiary-bg);       --v-border: var(--bs-border-color);          --v-text: var(--bs-secondary-color); }

.verdict {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--v-border);
    border-radius: .75rem;
    background: var(--v-bg);
}
.verdict:not(:has(.verdict-figure)) { display: block; }
.verdict-figure {
    flex: none;
    min-width: 4.5ch;
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1;
    color: var(--v-text);
    font-variant-numeric: tabular-nums;
}
.verdict-title { font-size: 1.125rem; font-weight: 600; color: var(--v-text); }
.verdict-detail { margin-top: .25rem; color: var(--bs-body-color); }

.verdict-badge {
    display: inline-block;
    padding: .2em .6em;
    border: 1px solid var(--v-border);
    border-radius: 999px;
    background: var(--v-bg);
    color: var(--v-text);
    font-size: .875rem;
    font-weight: 500;
    white-space: nowrap;
}

/* --- Check list --- */
.check-meta { font-size: .875rem; color: var(--bs-secondary-color); }
.check-row { display: flex; align-items: center; gap: 1rem; padding: .75rem 1rem; }
.check-row-main { flex: 1; min-width: 0; }
.check-row-name { font-weight: 500; }
.check-row-status { flex: none; display: flex; align-items: center; gap: .5rem; }
.progress-slim { width: 6rem; height: .375rem; margin: 0; }
.lock-icon { vertical-align: -1px; }

/* --- New Check --- */
.new-check > summary { list-style: none; }
.new-check > summary::-webkit-details-marker { display: none; }
.new-check[open] > summary { display: none; }
.rate-picker .btn { min-width: 3.75rem; font-variant-numeric: tabular-nums; }

/* --- Running Check --- */
.status-card {
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .75rem;
    background: var(--bs-tertiary-bg);
}
.status-card .progress { height: .5rem; margin: 0; }

/* --- Evidence --- */
.match { border-left: 3px solid var(--bs-border-color); }
.match[open] { border-left-color: var(--bs-primary); }
.match-header, .weak-matches > summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .25rem 1rem;
    cursor: pointer;
    list-style: none;
}
.match-header::-webkit-details-marker, .weak-matches > summary::-webkit-details-marker { display: none; }
.match-header::before, .weak-matches > summary::before {
    content: "▸";
    color: var(--bs-secondary-color);
    transition: transform .15s;
}
details[open] > .match-header::before, .weak-matches[open] > summary::before { transform: rotate(90deg); }
.match-title { font-weight: 600; }
.match-type { color: var(--bs-secondary-color); font-size: .875rem; }
.match-count { margin-left: auto; font-size: .875rem; font-variant-numeric: tabular-nums; }

.hit-page {
    display: grid;
    grid-template-columns: 6.5rem 1fr;
    gap: 1rem;
    padding: .875rem 0;
    border-bottom: 1px solid var(--bs-border-color-translucent);
}
.hit-page:last-child { border-bottom: 0; padding-bottom: 0; }
.hit-page-number { font-weight: 600; font-variant-numeric: tabular-nums; }
.page-button.htmx-request::after { content: " — загружаем…"; }
.page-images { margin-top: .5rem; }
.page-image { max-width: 100%; }
.hit-quote {
    margin: 0 0 .5rem;
    padding: .125rem 0 .125rem .875rem;
    border-left: 3px solid var(--bs-primary-border-subtle);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.0625rem;
    line-height: 1.5;
}

@media (max-width: 575.98px) {
    .verdict { flex-direction: column; align-items: flex-start; gap: .5rem; }
    .hit-page { grid-template-columns: 1fr; gap: .25rem; }
    .check-row { flex-direction: column; align-items: flex-start; gap: .375rem; }
}

/* --- Annotated text --- */
.source-number {
    display: inline-block;
    min-width: 1.5em;
    padding: 0 .35em;
    border-radius: .375rem;
    background: var(--bs-secondary-bg);
    color: var(--bs-secondary-color);
    font-size: .8125rem;
    font-weight: 600;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.text-legend { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; color: var(--bs-secondary-color); }
.text-legend > div { flex-basis: 100%; }
.annotated-text {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.0625rem;
    line-height: 1.7;
    max-width: 48rem;
}
.text-line { margin: 0 0 .5rem; white-space: pre-wrap; overflow-wrap: anywhere; }
mark.seg-hit {
    padding: .05em .1em;
    border-radius: .2em;
    background: var(--v-bg);
    box-shadow: inset 0 -2px 0 var(--v-border);
    color: inherit;
    cursor: pointer;
}
mark.seg-hit:hover, mark.seg-hit.is-open { box-shadow: inset 0 -2px 0 var(--v-text); }
.seg-refs {
    margin-left: .1em;
    color: var(--v-text);
    font-family: var(--bs-body-font-family);
    font-size: .65em;
    font-weight: 600;
}
.seg-clean {
    text-decoration: underline dotted var(--bs-success-border-subtle);
    text-decoration-thickness: 2px;
    text-underline-offset: .2em;
}
.text-legend .seg-hit { cursor: default; }
/* Showing one source: the other marks fade to plain text. */
.annotated-text.is-filtered mark.seg-hit:not(.is-shown) { background: none; box-shadow: none; }
.annotated-text.is-filtered mark.seg-hit:not(.is-shown) .seg-refs { color: var(--bs-secondary-color); }
mark.seg-hit.is-current { outline: 2px solid var(--v-text); outline-offset: 1px; }
.source-filter {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: .5rem .75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .5rem;
    background: var(--bs-body-bg);
}
.run-panel {
    margin: 0 0 .75rem;
    padding: .5rem .875rem;
    border-left: 3px solid var(--bs-primary);
    background: var(--bs-tertiary-bg);
    border-radius: 0 .5rem .5rem 0;
    font-family: var(--bs-body-font-family);
    font-size: .9375rem;
    line-height: 1.5;
}
.run-source { padding: .375rem 0; }
.run-source + .run-source { border-top: 1px solid var(--bs-border-color-translucent); }
.run-source-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .5rem; }
.run-source-page { margin-left: 2.25rem; color: var(--bs-secondary-color); }
