/* Selection transparency (selection.js). Theme variables only, so light and dark both work. */

/* ---- screening funnel */
.sel-funnel { list-style: none; margin: 4px 0 12px; padding: 0; display: grid; gap: 4px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.sel-stage { display: grid; grid-template-columns: minmax(120px, 160px) minmax(80px, 1fr) 64px 64px; grid-template-areas: "label track count delta" ". rule rule rule"; align-items: center; gap: 0 10px; padding: 3px 0; border-bottom: 1px solid var(--grid); }
.sel-stage:last-child { border-bottom: 0; }
.sel-stage-label { grid-area: label; color: var(--text-2); font-weight: 500; }
.sel-track { grid-area: track; height: 12px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.sel-bar { display: block; height: 100%; width: 0; background: var(--series-1); border-radius: 3px; }
.sel-stage.final .sel-bar { background: var(--accent); }
.sel-stage[data-stage="pins"] .sel-bar { background: var(--series-1-soft); box-shadow: inset 0 0 0 1px var(--series-1); }
.sel-count { grid-area: count; text-align: right; font-weight: 600; }
.sel-delta { grid-area: delta; text-align: right; color: var(--critical); }
.sel-delta.up { color: var(--good); }
.sel-rule { grid-area: rule; line-height: 1.35; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .sel-stage { grid-template-columns: 1fr 52px 52px; grid-template-areas: "label count delta" "track track track" "rule rule rule"; }
}

.sel-notice { background: var(--warning-bg); color: var(--warning-ink); border-radius: 6px; padding: 8px 12px; margin: 0 0 10px; font-size: 12.5px; }
.sel-notice .link { color: inherit; font-weight: 600; text-decoration: underline; }

/* ---- reason log, near misses, filtered-out matches */
section[data-ext-card^="selection"] h4 { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin: 12px 0 6px; }
section[data-ext-card^="selection"] .ext-body > h4:first-child { margin-top: 2px; }
.sel-log-list { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.sel-log-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 4px 0; border-bottom: 1px solid var(--grid); }
.sel-log-list li:last-child { border-bottom: 0; }
.sel-note { color: var(--text-2); font-style: italic; overflow-wrap: anywhere; }
.sel-table td.wide { white-space: normal; min-width: 220px; max-width: 460px; }
.sel-table .btn.small { white-space: nowrap; }

.sel-chip.sel-good { border-color: var(--good); color: var(--good); }
.sel-chip.sel-bad { border-color: var(--critical); color: var(--critical); }
.sel-chip.sel-warn { border-color: var(--warning-ink); color: var(--warning-ink); background: var(--warning-bg); }
.sel-chip.sel-info { border-color: var(--info-ink); color: var(--info-ink); background: var(--info-bg); }
.sel-chip.sel-pin { border-color: var(--series-1); color: var(--link); }
.sel-chip.sel-muted { color: var(--muted); }

/* ---- methodology */
.sel-method p { margin: 0 0 8px; font-size: 13px; line-height: 1.55; max-width: 90ch; overflow-wrap: anywhere; }
.sel-method-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 6px; }
.sel-hash { overflow-wrap: anywhere; }

/* ---- reason dialogs */
.sel-dialog { width: min(520px, calc(100vw - 32px)); }
.sel-dialog.wide { width: min(720px, calc(100vw - 32px)); }
.sel-form fieldset { border: 0; padding: 0; margin: 10px 0; }
.sel-form legend { font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.sel-code-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 4px 12px; }
.sel-code { margin: 0; padding: 4px 6px; border-radius: 6px; font-size: 13px; color: var(--text); cursor: pointer; align-items: center; }
.sel-code:hover, .sel-code:has(input:checked) { background: var(--surface-2); }
/* The app styles every input as a full-width field; radios are not fields. */
.sel-code input[type=radio] { width: auto; flex: none; margin: 0; padding: 0; border: 0; accent-color: var(--series-1); }
.sel-missing-list { display: grid; gap: 8px; max-height: 50vh; overflow-y: auto; margin: 10px 0; }
.sel-missing-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.2fr); gap: 8px; align-items: center; padding-bottom: 8px; border-bottom: 1px solid var(--grid); font-size: 12.5px; }
.sel-missing-row > div { overflow-wrap: anywhere; }
@media (max-width: 640px) { .sel-missing-row { grid-template-columns: 1fr; } }

/* ---- peer challenge */
.sel-ch-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 12px 20px; align-items: start; }
@media (max-width: 900px) { .sel-ch-grid { grid-template-columns: 1fr; } }
.sel-ch-grid textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.sel-ch-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
label.sel-file { display: inline-block; margin: 0; font-size: 12px; color: var(--text); cursor: pointer; }
label.sel-file:focus-within { outline: 2px solid var(--series-1); outline-offset: 1px; }
.sel-ch-out { margin-top: 12px; min-width: 0; }
.sel-ch-out > p { margin: 0 0 8px; }
.sel-ch-table tr.sel-ch-why td { border-bottom: 1px solid var(--border); padding: 0 0 8px; color: var(--text-2); white-space: normal; font-size: 12px; }
/* The row spans the whole (wide) table; keep its text in the visible part of the scroller, as the app's detail rows do. */
.sel-why-body { position: sticky; left: 0; width: 100cqw; padding: 0 12px; line-height: 1.45; }
.sel-ch-table tr[data-sel-status] td { border-bottom: 0; }
.sel-cf { margin-top: 14px; }
.sel-cf-best { margin: 0 0 8px; padding: 8px 12px; border-radius: 6px; background: var(--info-bg); color: var(--info-ink); font-size: 12.5px; }
