/* Single linear page: stacked steps, comfortable max width. */
.linear {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg, 24px);
  max-width: 960px;
  margin: 0 auto;
}
.step { display: flex; flex-direction: column; gap: var(--space-md, 16px); }
.step__head { display: flex; align-items: baseline; gap: 10px; }
.step__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.6rem; height: 1.6rem; border-radius: 50%;
  background: var(--accent, #2563eb); color: #fff; font-size: 0.85rem; font-weight: 700;
}
.step__head h3 { margin: 0; font-size: 1.15rem; }
.step__hint { color: var(--faded); font-size: 0.9rem; }

/* Full-width responsive course grid (replaces the cramped column). */
.course-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
}
.dataset-chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* Verdict bins */
/* auto-fit so the optional 4th ERROR bin doesn't overflow a fixed 3-col grid */
.bins { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--space-md); margin-bottom: var(--space-lg); }
.bin__count { font-family: var(--font-display); font-weight: 600; font-size: 1.4rem; }
.verdict-yes { color: var(--success); font-family: var(--font-display); font-weight: 600; }
.verdict-no { color: var(--danger); font-family: var(--font-display); font-weight: 600; }
.verdict-notstated { color: var(--ink-muted); font-family: var(--font-body); font-style: italic; }
/* ERROR: distinct from a real "No" (amber warning), so a failed analysis can't
   masquerade as a confident negative answer. */
.verdict-error { color: #b45309; font-family: var(--font-display); font-weight: 600; }
.cell-error-note { color: #b45309; font-size: 0.78rem; margin-top: 2px; }

/* Persistent analysis-failure banner above the results table. */
.analysis-error-banner {
    background: #fef3c7; border: 1px solid #f59e0b; color: #92400e;
    border-radius: 8px; padding: 10px 14px; margin-bottom: var(--space-md);
    font-size: 0.88rem; font-weight: 500;
}

.progress { height: 2px; background: var(--paper-warm, #f5f0e8); margin-bottom: var(--space-md); }
.progress__fill { height: 100%; background: var(--signal); width: 0; transition: width 0.1s ease; }

/* Pin stars */
.pin-btn { background: none; border: none; cursor: pointer; color: var(--ink-muted); font-size: 0.9rem; padding: 0 0.25rem; line-height: 1; vertical-align: middle; }
.pin-btn.pinned { color: var(--accent, #c0420e); }
.pin-btn:hover { opacity: 0.7; }

/* History panel entries */
.history-entry { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-sm) 0; border-bottom: 1px solid var(--rule, #e0d8ce); font-size: 0.85rem; }
.history-q { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-meta { color: var(--ink-muted); white-space: nowrap; }
.history-rerun { white-space: nowrap; }

/* Promote bin button */
.promote-bin { font-size: 0.75rem; margin-top: var(--space-xs, 0.25rem); display: block; }

/* Inline compare link in result rows */
.compare-link { font-size: 0.75rem; color: var(--ink-muted); margin-left: 0.25rem; }
.compare-link:hover { color: var(--accent, #c0420e); }

@media (prefers-reduced-motion: reduce) {
  .progress__fill { transition: none; }
  .result-row { animation: none !important; transform: none !important; }
}

/* Keyboard focus rings — visible for keyboard users, hidden for mouse */
:focus-visible { outline: 2px solid var(--accent, #c0420e); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

/* Scope picker (Step 1) + filters (Step 2) */
.scope-breadcrumb { font-size: 0.9rem; color: var(--text-muted, #555); margin-bottom: 6px; }
.dataset-chip--dept[aria-expanded="true"] { outline: 2px solid var(--accent, #1565c0); outline-offset: 1px; }
.program-stage { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dept-programs__group { display: flex; flex-wrap: wrap; gap: 8px; }
/* The display rules above override the UA [hidden] default, so restore it. */
#dept-stage[hidden], #program-stage[hidden], .dept-programs__group[hidden] { display: none; }
#program-back { margin-right: 4px; }

.filters { margin-bottom: var(--space-md, 16px); border: 1px solid var(--border, #e0e0e0); border-radius: 6px; padding: 6px 10px; }
.filters > summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; }
.filters-count { color: var(--accent, #1565c0); font-weight: 600; }
.filters-body { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.filter-row label { font-size: 0.9rem; display: inline-flex; align-items: center; gap: 4px; }
.filter-label { min-width: 90px; color: var(--text-muted, #555); font-size: 0.85rem; font-weight: 600; }

/* Academic-interest row inside the filters <details> (COULD 2.5): the label
   sits on its own line, then chips wrap, then the Select-all / Clear actions. */
.filter-row--interest { flex-direction: column; align-items: stretch; gap: 6px; }
.filter-row--interest .filter-label { min-width: 0; }
.filter-row--interest .interest-chips { margin-bottom: 0; }
.filter-actions { display: flex; gap: 8px; }

/* Transient toast (COULD 2.1) — non-blocking status, e.g. "N courses hidden". */
.toast {
  position: fixed; left: 50%; bottom: var(--space-lg, 24px);
  transform: translate(-50%, 12px);
  background: var(--ink, #1f2937); color: #fff;
  padding: var(--space-sm, 0.5rem) var(--space-md, 1rem);
  border-radius: 6px; font-size: 0.85rem;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1000; max-width: 90vw; text-align: center;
}
.toast--visible { opacity: 1; transform: translate(-50%, 0); }

/* Horizontal-scroll wrapper for the multi-column results table (COULD 2.7). */
.table-scroll { overflow-x: auto; }

/* Responsive (COULD 2.7): collapse the 3-up verdict bins to one column and
   let the page use the full width on narrow viewports. The course grid
   already adapts via auto-fill/minmax. */
@media (max-width: 640px) {
  .bins { grid-template-columns: 1fr; }
  .linear { max-width: 100%; }
  .step__head { flex-wrap: wrap; }
}
