/* Controls: buttons, drop-downs, fields, rail filters, small chips.
 *
 * Black means "press" and "chosen". A second button is a quiet fill.
 */

/* ============================================================== buttons === */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 var(--sp-5);
  background: var(--ink); color: var(--paper); border: 0; border-radius: var(--r-pill);
  font: 500 var(--fs-sm)/1 var(--sans); text-decoration: none; white-space: nowrap; cursor: pointer;
}
.btn:hover { background: var(--ink-hover); color: var(--paper); }
.btn.red, .btn-primary { background: var(--ink); color: var(--paper); }
.btn.red:hover, .btn-primary:hover { background: var(--ink-hover); color: var(--paper); }
.btn.o { background: var(--fill); color: var(--ink); }
.btn.o:hover { background: var(--fill-2); color: var(--ink); }
.btn-sm { min-height: 32px; padding: 0 var(--sp-4); font-size: var(--fs-xs); }
.btn-block { width: 100%; }
/* an unavailable button is a quiet fill with grey words that still read
 * (4.9:1), not a faded black one with pale words */
.btn[disabled], .btn[aria-disabled="true"],
.btn[disabled]:hover, .btn[aria-disabled="true"]:hover { background: var(--fill); color: var(--sub); cursor: not-allowed; }

.ghost {
  display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px;
  background: var(--fill); color: var(--ink); border: 0; border-radius: var(--r);
  font-weight: 500; font-size: var(--fs-xs); cursor: pointer;
}
.ghost:hover { background: var(--fill-2); }

.apply {
  display: block; width: 100%; min-height: 40px; margin: var(--sp-4) 0; padding: 0 var(--sp-4);
  text-align: center; background: var(--ink); color: var(--paper); font-weight: 500;
  border: 0; border-radius: var(--r-pill); cursor: pointer;
}
.apply:hover { background: var(--ink-hover); }

/* =========================================================== drop-downs ===
 * One control for every filter: a real select in a label that reads
 * "Label Value". The browser draws the open menu, so a phone gets its own
 * picker. A filter that is narrowing the list is drawn black (.is-set, put
 * on by the server). The form's button shows only with script off. */

.pops { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin: 0; }
/* in a page's flow the row keeps clear of what follows it; in the data stamp
 * (outside .page) it sits flush */
.page .pops { margin-bottom: var(--sp-3); }
.pop {
  position: relative; display: inline-flex; align-items: center; height: 30px; padding-left: 10px;
  border-radius: var(--r); background: var(--fill); color: var(--ink);
  font-size: var(--fs-xs); white-space: nowrap; transition: background-color 160ms var(--ease);
}
.pop:hover { background: var(--fill-2); }
.pop > span { color: var(--sub); }
.pop select, .pop input {
  appearance: none; -webkit-appearance: none; height: 30px; margin: 0;
  border: 0; border-radius: var(--r); background: transparent; color: var(--ink);
  font: 500 var(--fs-xs) var(--sans);
}
.pop select { field-sizing: content; max-width: 16rem; padding: 0 26px 0 6px; text-overflow: ellipsis; cursor: pointer; }
/* an open list is the browser's own surface: keep its text dark on any chip */
.pop select option { background: var(--paper); color: var(--ink); }
.pop input { width: 132px; padding: 0 10px 0 6px; }
.pop select:focus-visible, .pop input:focus-visible { outline: 0; }
.pop:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.pop:has(select)::after {
  content: ""; position: absolute; right: 11px; top: 11px; width: 5px; height: 5px;
  border-bottom: 1.5px solid; border-right: 1.5px solid; transform: rotate(45deg);
  opacity: .7; pointer-events: none;
}
.pop.is-set { background: var(--ink); color: var(--paper); }
.pop.is-set:hover { background: var(--ink-hover); }
.pop.is-set > span { color: var(--bar-sub); }
.pop.is-set select, .pop.is-set input { color: var(--paper); }
.js .pops-go { display: none; }
/* a value changed from the keyboard waits for this button (base.html) */
.js .pops.pops-keyed .pops-go { display: inline-flex; }

/* =============================================================== fields === */

.field { display: block; }
.field > span, .field-label { display: block; margin-bottom: var(--sp-1); font: 500 var(--fs-xs)/1.3 var(--sans); color: var(--sub); }
.input, .select, .textarea, .sel {
  width: 100%; min-height: 40px; padding: 8px 12px;
  background-color: var(--paper); color: var(--ink);
  border: 1px solid var(--line-control); border-radius: var(--r);
  font: var(--fs-md)/1.35 var(--sans);
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
.sel { display: flex; justify-content: space-between; align-items: center; min-height: 36px; padding: 6px 10px; font-size: var(--fs-sm); }
.textarea { min-height: 5rem; line-height: 1.6; resize: vertical; }
.grade-input { min-height: 44px; text-align: center; font-variant-numeric: tabular-nums; }
.input::placeholder, .textarea::placeholder { color: var(--sub); }
.input:hover, .select:hover, .textarea:hover, .sel:hover { border-color: var(--sub); }
.input:focus, .select:focus, .textarea:focus, .sel:focus, .flt input.sel:focus {
  outline: none; border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 30%, transparent);
}
/* the arrow is two small gradients in the text colour, so no image is needed */
.select, select.sel {
  appearance: none; padding-right: 30px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.flt input.sel { font: inherit; font-size: var(--fs-sm); }
/* filter rows: controls sit side by side, then stack neatly on a phone */
form.flex .sel, form .flex .sel { width: auto; min-width: 9rem; }
input[type="checkbox"], input[type="radio"] { width: 1rem; height: 1rem; accent-color: var(--ink); }
input[type="range"].rng { width: 100%; accent-color: var(--ink); }

/* ========================================================= rail filters === */

.rail-form { margin: 0; }
.flt { padding: var(--sp-4) 0; border: 0; border-bottom: 1px solid var(--line-2); margin: 0; }
.flt .lab, .flt legend { display: block; padding: 0; margin-bottom: var(--sp-2); font-size: var(--fs-xs); font-weight: 600; color: var(--ink); }
/* a fieldset legend sits on the top border by default, eating the top padding;
   floating it makes it lay out like a div-based label */
.flt > legend { float: left; width: 100%; }
.flt > legend + * { clear: both; }
.flt label.lab { display: block; }
.rail-reset { border-bottom: 0; padding-top: 0; }
.rail-note { margin: 6px 0 0; color: var(--sub); font-size: var(--fs-xs); line-height: 1.4; }

/* segments: a quiet track, the chosen one black */
.seg { display: flex; gap: 2px; padding: 2px; border-radius: var(--r); background: var(--fill); }
.seg > * {
  flex: 1; display: block; padding: 6px 0; text-align: center;
  border: 0; border-radius: var(--r-sm); background: transparent;
  color: var(--sub); font-weight: 500; font-size: var(--fs-sm); text-decoration: none; cursor: pointer;
  transition: background-color 160ms var(--ease), color 160ms var(--ease);
}
.seg > *:hover { color: var(--ink); }
.seg > .on, .seg > [aria-current="page"], .seg > [aria-pressed="true"], .seg label:has(input:checked) { background: var(--ink); color: var(--paper); }
/* radio-backed segments: the label carries the look, the input stays focusable */
.seg input[type="radio"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.seg.seg-view { display: inline-flex; flex: none; }
.seg.seg-view > label { flex: none; padding: 5px 12px; position: relative; font-size: var(--fs-xs); }

.chk { display: flex; align-items: center; gap: var(--sp-2); padding: 5px 0; font-size: var(--fs-sm); cursor: pointer; }
.chk input[type="checkbox"], .chk input[type="radio"] { width: 17px; height: 17px; margin: 0; accent-color: var(--ink); }
.chk b { display: inline-block; width: 15px; height: 15px; border: 1px solid var(--line-control); border-radius: var(--r-sm); }
.chk b.y { background: var(--ink); border-color: var(--ink); }
.chk-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--sp-2); }

.logos { display: grid; grid-template-columns: repeat(8, 1fr); gap: var(--sp-1); }
.logos > a, .logos > label, .logos > button {
  display: flex; align-items: center; justify-content: center; aspect-ratio: 1;
  padding: 2px; border: 1px solid transparent; border-radius: var(--r);
  background: transparent; opacity: .45; cursor: pointer;
}
.logos img { width: 100%; height: 100%; object-fit: contain; }
.logos > *:hover { opacity: .8; }
.logos > .on, .logos > [aria-pressed="true"], .logos > :has(input:checked) { opacity: 1; border-color: var(--ink); background: var(--fill); }
.logos > label { position: relative; }
.logos input { position: absolute; opacity: 0; width: 1px; height: 1px; }
/* the checkbox itself is invisible, so its tile carries the keyboard ring */
.logos > label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 1px; opacity: 1; }
/* nothing ticked means every club: show them all lit */
.logos:not(:has(input:checked)) > label { opacity: 1; }

.range { height: 4px; background: var(--line-2); border-radius: var(--r-pill); position: relative; margin: 12px 6px 4px; }
.range i { position: absolute; left: 20%; right: 0; top: 0; bottom: 0; background: var(--ink); border-radius: var(--r-pill); }
.range b { position: absolute; left: 20%; top: -5px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); }

/* link chips: jump links and a rail's quick filters */
.chip-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-grid a { padding: 5px 10px; border-radius: var(--r); background: var(--fill); color: var(--ink); font-size: var(--fs-xs); font-weight: 500; text-decoration: none; }
.chip-grid a:hover { background: var(--fill-2); }
.chip-grid a[aria-current] { background: var(--ink); color: var(--paper); }

/* Columns menu: a native disclosure; its checkboxes hide column groups */
.colmenu { position: relative; }
.colmenu > summary { list-style: none; }
.colmenu > summary::-webkit-details-marker { display: none; }
.colmenu > summary::after { content: "\25BE"; font-size: var(--fs-sm); }
.colmenu-panel {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; min-width: 160px;
  padding: var(--sp-2) var(--sp-3); background: var(--paper);
  border: 1px solid var(--line-2); border-radius: var(--r-md); box-shadow: var(--shadow-menu);
}

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-top: var(--sp-3); flex: none; }
.pager .note { margin: 0; }

/* ========================================================== small chips === */

.pill { display: inline-block; padding: 1px 8px; white-space: nowrap; border-radius: var(--r-sm); background: var(--fill); color: var(--sub); font: 500 var(--fs-2xs)/1.5 var(--sans); }
.pill-sol { color: var(--hot); background: var(--mine); }
.pill-solid { color: var(--paper); background: var(--ink); }

/* a grade carries its value and a colour, never the colour alone */
.grade { display: inline-block; min-width: 1.75rem; padding: 1px 4px; text-align: center; border-radius: var(--r-sm); font-weight: 600; font-variant-numeric: tabular-nums; }
.grade-hi { background: var(--t-high-bg); color: var(--t-high-ink); }
.grade-mid { background: var(--fill); color: var(--ink); }
.grade-lo { background: var(--t-poor-bg); color: var(--t-poor-ink); }

/* college: a position chip, and the portal's status badges */
.cfb-chip { display: inline-block; min-width: 2.2em; padding: 0 5px; text-align: center; border-radius: var(--r-sm); background: var(--fill); color: var(--sub); font: 600 var(--fs-2xs)/18px var(--sans); vertical-align: 1px; }
.cfb-chip-solid { color: var(--paper); background: var(--ink); }
a.cfb-chip { text-decoration: none; }
a.cfb-chip:hover { background: var(--fill-2); color: var(--ink); }
a.cfb-chip-solid:hover { background: var(--ink-hover); color: var(--paper); }
.cfb-badge { display: inline-block; padding: 0 8px; border: 1px solid transparent; border-radius: var(--r-sm); background: var(--fill); color: var(--sub); font: 500 var(--fs-2xs)/20px var(--sans); white-space: nowrap; }
.cfb-badge-elig { color: var(--paper); background: var(--ink); }
.cfb-badge-future { color: var(--ink); }
.cfb-badge-commit { color: var(--ink); background: transparent; border-color: var(--line); white-space: normal; }
.cfb-badge-open { color: var(--hot); background: var(--mine); }
.cfb-badge-none { background: transparent; border-color: var(--line); border-style: dashed; }
.cfb-badges { display: flex; flex-wrap: wrap; gap: var(--sp-1); margin: var(--sp-3) 0; }

/* model outputs: value + interval + confidence travel together */
.metric { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.metric-row { display: inline-flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.metric-value { font-size: var(--fs-xl); font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
:where(.metric-value) { color: var(--ink); }   /* zero specificity: sign classes win */
.metric-value .unit { font-size: .75em; color: var(--sub); font-weight: 400; }
.metric-value-sm { font-size: var(--fs-md); }
.metric-interval { font-size: var(--fs-xs); color: var(--sub); font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric-conf { display: inline-block; white-space: nowrap; font-variant-numeric: tabular-nums; padding: 0 5px; font: 500 var(--fs-2xs)/1.5 var(--sans); color: var(--sub); border: 1px solid var(--line); border-radius: var(--r-sm); }

/* verdicts: label text + glyph + border style; colour only reinforces */
.verdict { display: inline-flex; align-items: center; gap: 5px; padding: 1px 7px; border: 1px solid; border-radius: var(--r-sm); font: 600 var(--fs-xs)/1.4 var(--sans); white-space: nowrap; }
.verdict-glyph { font-weight: 400; font-size: var(--fs-2xs); line-height: 1; }
.verdict-benefit { color: var(--t-high-ink); border-color: var(--t-high-ink); background: var(--t-high-bg); border-style: solid; }
.verdict-hurt { color: var(--t-poor-ink); border-color: var(--t-poor-ink); background: var(--t-poor-bg); border-style: solid; }
.verdict-uncertain-good { color: var(--t-high-ink); border-color: var(--t-high-ink); background: transparent; border-style: dashed; }
.verdict-uncertain-bad { color: var(--t-poor-ink); border-color: var(--t-poor-ink); background: transparent; border-style: dashed; }
.verdict-even { color: var(--sub); border-color: var(--line); background: var(--fill); border-style: solid; }

/* feed freshness: word + marker shape (disc / ring / diamond) */
.freshness { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-size: var(--fs-md); font-weight: 500; }
.freshness::before { content: ""; flex: none; width: 9px; height: 9px; }
.freshness-fresh { color: var(--up); }
.freshness-fresh::before { background: var(--up); border: 0; border-radius: 50%; }
.freshness-stale { color: var(--hot); }
.freshness-stale::before { background: transparent; border: 2px solid var(--hot); border-radius: 50%; }
.freshness-failed { color: var(--down); }
.freshness-failed::before { background: var(--down); border: 0; border-radius: 1px; transform: rotate(45deg); }

/* ============================================================= callouts ===
 * A quiet fill and plain text. The later rules win, so a warn note that also
 * carries .callout takes the warn colours. */
.callout { padding: var(--sp-3) var(--sp-4); border-radius: var(--r); background: var(--mine); color: var(--ink); font-size: var(--fs-sm); }
.callout-info { background: var(--fill); }
.callout-bad { background: var(--t-poor-bg); color: var(--t-poor-ink); }
.callout-warn { background: var(--mine); }

@media (max-width: 760px) {
  .btn { min-height: 44px; }
  .btn-sm { min-height: 40px; }
  /* every rail and form control is at least 40px under the thumb, and a text
     field is 16px so a phone does not zoom in on it */
  .ghost, .sel, .chk { min-height: 40px; }
  .input, .select, .textarea, .sel, .flt input.sel { font-size: 16px; }
  .seg > *, .seg.seg-view > label { padding-top: 11px; padding-bottom: 11px; }
  .chip-grid a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--sp-3); }
  .logos { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); }
  /* a row of drop-downs scrolls sideways under the thumb. A scroller clips
     at its edge, so the padding is the room a focus ring needs (2px wide,
     2px off the control); the margin gives the same space back. */
  .pops { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: var(--sp-1); margin: calc(-1 * var(--sp-1)); scroll-padding-inline: var(--sp-2); }
  .page .pops { margin-bottom: var(--sp-2); }
  .pops::-webkit-scrollbar { display: none; }
  /* nothing in the row shrinks or wraps: a link beside the drop-downs stays whole */
  .pops > * { flex: none; white-space: nowrap; }
  .pop { flex: none; height: 40px; }
  .pop select, .pop input { height: 40px; font-size: 16px; }
  .pop:has(select)::after { top: 16px; }
}
@media (max-width: 640px) {
  form.flex { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; }
  form.flex .sel { width: 100%; min-width: 0; }
  form.flex > button, form.flex > a { grid-column: 1 / -1; justify-self: start; }
}
