.hint-x { color: #0984e3; font-weight: 700; }
.hint-o { color: #d63031; font-weight: 700; }
.chain-search-stats {
    margin: 12px 0;
    border-radius: 12px;
    background: var(--card-bg);
    color: var(--text);
    font-size: 13px;
    line-height: 1.5;
    text-align: left;
    overflow-wrap: anywhere;
}
.chain-search-stats summary { cursor: pointer; padding: 12px; font-weight: 600; }
.chain-search-stats summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.chain-search-content { padding: 0 12px 12px; }
.chain-search-content p { margin: 0 0 10px; }
.chain-search-content table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.chain-search-content caption { text-align: left; padding: 8px 0; font-weight: 600; }
.chain-search-content th, .chain-search-content td { padding: 8px 4px; text-align: left; vertical-align: top; }
.chain-search-content thead th { border-bottom: 1px solid var(--muted); }
.chain-search-content th[scope="row"] { width: 40%; font-weight: 400; }
.chain-search-content td:not([colspan]) { white-space: nowrap; font-size: 12px; }
.chain-search-content small { display: block; white-space: normal; }
.chain-search-selected { background: var(--lk-surfacevariant); }
.chain-search-heading { padding-top: 12px; font-weight: 600; }
.chain-search-instruction { font-size: 12px; }
.chain-search-columns, .chain-search-candidate > summary {
    display: grid;
    grid-template-columns: 16px minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    padding: 12px 8px;
    font-variant-numeric: tabular-nums;
}
.chain-search-columns { border-bottom: 1px solid var(--muted); font-weight: 600; }
.chain-search-candidate { border-bottom: 1px solid var(--muted); }
.chain-search-candidate > summary { font-weight: 400; list-style: none; }
.chain-search-candidate > summary::-webkit-details-marker { display: none; }
.chain-search-candidate > summary > svg { width: 16px; height: 20px; }
.chain-search-candidate[open] > summary > svg { transform: rotate(90deg); }
.chain-search-candidate > summary > span:nth-last-child(-n+2) { font-size: 12px; }
.chain-search-candidate-meta { display: block; padding-top: 4px; font-size: 12px; }
.chain-search-candidate-body { padding: 0 8px 12px; }
.chain-search-candidate-body table + table { margin-top: 12px; }
.chain-search-candidate-body tbody tr + tr { border-top: 1px solid var(--lk-surfacevariant); }
.chain-search-content .chain-search-measures th { width: 75%; }
.chain-search-content .chain-search-measures td { text-align: right; }
.chain-search-content .chain-search-rules td,
.chain-search-content .chain-search-rules thead th:not(:first-child),
.chain-search-content .chain-search-forks td { text-align: center; }
.chain-search-content .chain-search-checks td:first-of-type { white-space: normal; }
.chain-search-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.s5-forced-value { color: #00b894; font-weight: 700; }
.hint pre.s5-pre {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.82em;
    line-height: 1.55;
    margin: 6px 0 8px;
    white-space: pre;
    overflow-x: auto;
    color: inherit;
}
.s5-invalid { opacity: 0.45; }
.s5-completion-table {
    max-width: 100%;
    margin: 8px 0 10px;
    overflow-x: auto;
}
.s5-completion-heading {
    margin-bottom: 8px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.82em;
}
.s5-completion-candidates {
    display: grid;
    gap: 4px;
    margin-top: 9px;
    width: max-content;
}
.s5-completion-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    width: max-content;
}
.s5-completion-current { align-items: flex-start; }
.s5-completion-row .s5-proof-snapshot {
    max-width: none;
    padding: 0;
    overflow: visible;
}
.s5-completion-status,
.s5-completion-axis {
    padding-bottom: 4px;
    white-space: nowrap;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.78em;
}
.s5-completion-current .s5-completion-axis {
    padding-top: 0;
    padding-bottom: 0;
    line-height: 10px;
}
.s5-completion-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.s5-completion-status-icon {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
}
.s5-human-proof {
    margin-top: 10px;
    padding: 9px 10px;
    border-left: 3px solid #00b894;
    background: color-mix(in srgb, #00b894 10%, transparent);
    line-height: 1.45;
}
.s5-human-proof ol {
    margin: 6px 0 6px 20px;
    padding: 0;
}
.s5-human-proof li { margin: 3px 0; }
.s5-nested-branch-title { font-weight: 700; }
.s5-human-proof .s5-nested-chain {
    margin: 6px 0 8px 18px;
    padding-left: 14px;
}
.s5-human-proof .s5-nested-chain > li { margin: 7px 0; }
.s5-human-conclusion { font-weight: 700; }
.s5-human-proof--fallback { opacity: 0.72; }
.s5-proof-snapshot {
    max-width: 100%;
    overflow-x: auto;
    padding: 8px 2px 3px;
}
.region-proof-line { display: flex; align-items: flex-end; gap: 8px; max-width: 100%; }
.region-proof-line > .s5-proof-snapshot { min-width: 0; }
.region-proof-remaining { display: flex; gap: 4px; flex-shrink: 0; margin-bottom: 3px; line-height: 24px; font-variant-numeric: tabular-nums; }
.s5-proof-grid {
    display: grid;
    grid-template-columns: repeat(var(--s5-proof-columns), 24px);
    gap: 3px;
    width: max-content;
    align-items: center;
}
.s5-proof-index {
    color: var(--muted);
    font-family: 'Courier New', Courier, monospace;
    font-size: 10px;
    line-height: 1;
    text-align: center;
}
.s5-proof-cell {
    position: relative;
    display: flex;
    width: 24px;
    height: 24px;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--cell-border);
    border-radius: 3px;
    background: var(--cell-bg);
}
.s5-proof-cell.x { color: #0984e3; }
.s5-proof-cell.o { color: #d63031; }
.s5-proof-cell .cell-sym { width: 64%; height: 64%; }
.s5-proof-cell--given {
    border-color: #a8b4d8;
    background: #d8dff5;
    box-shadow: inset 0 1px 4px rgba(70, 80, 160, 0.10);
}
.s5-proof-cell--forced {
    color: #00b894 !important;
    border-color: #00b894;
    background: var(--cell-hint-target-bg);
    box-shadow: 0 0 5px rgba(0, 184, 148, 0.35);
}
.s5-proof-cell--derived {
    border-color: #d6a72f;
    background: var(--hint-cell-bg);
    box-shadow: inset 0 0 0 1px rgba(253, 203, 110, 0.72);
}
.s5-proof-cell--tested {
    outline: 2px solid #00b894;
    outline-offset: 1px;
}
.s5-proof-cell--tested::before {
    content: '';
    position: absolute;
    top: -7px;
    left: 50%;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #00b894;
    transform: translateX(-50%);
}
.s5-proof-cell--contradiction {
    border-color: #e11d48;
    background: #ffe1e8;
    box-shadow: inset 0 -3px 0 rgba(225,29,72,0.28);
}
