/* Research Outputs walkthrough — palette and type of the mockups (CLAUDE.md).
   Fonts are linked from the layout; every family has a system fallback so the
   pages are legible when Google Fonts is blocked. */

:root {
  --green: #1D6A4F;
  --ink: #1F2937;
  --muted: #6B7280;
  --rule: #E5E7EB;
  --paper: #FFFFFF;
  --wash: #F7F8F7;

  /* programs */
  --dex: #16824A;
  --csc: #2D63C8;
  --lvc: #C25E0A;
  --res: #993D78;

  /* status */
  --on-track: #1D6A4F;
  --at-risk: #C9A227;
  --off-track: #B42318;

  --column: 1120px;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --display: "Archivo", var(--sans);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--wash);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .masthead__name, .stat__value {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

h1 { font-size: 1.9rem; margin: 0 0 0.4rem; }
h2 { font-size: 1.3rem; margin: 2rem 0 0.6rem; }

a { color: var(--green); }

.column { max-width: var(--column); margin: 0 auto; padding: 0 24px; }

/* header ------------------------------------------------------------------ */

.masthead {
  background: var(--green);
  color: #FFFFFF;
  padding: 14px 0;
}
.masthead .column { display: flex; align-items: center; gap: 16px; }
.masthead__name { font-size: 1.05rem; color: #FFFFFF; text-decoration: none; }
.masthead__spacer { flex: 1; }
.masthead__user { font-size: 0.85rem; color: rgba(255, 255, 255, 0.85); }
.masthead__logout {
  margin: 0;
}
.masthead__logout button {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  color: #FFFFFF;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  padding: 3px 10px;
}

/* breadcrumb -------------------------------------------------------------- */

.stages {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.stages ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 10px 0;
  font-size: 0.9rem;
}
.stages li::after { color: var(--rule); content: "›"; margin-left: 6px; }
.stages li:last-child::after { content: ""; }
.stages a { color: var(--muted); text-decoration: none; }
.stages a:hover { text-decoration: underline; }
.stages .is-done a { color: var(--ink); }
.stages .is-done a::before { color: var(--green); content: "✓ "; }
.stages .is-current a { color: var(--green); font-weight: 600; }

/* content ----------------------------------------------------------------- */

main { padding: 32px 0 56px; }
.lede { color: var(--muted); font-size: 1.05rem; max-width: 62ch; }

.panel {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 24px;
  margin: 20px 0;
}

.pipeline { display: block; height: auto; max-width: 100%; }

.button {
  background: var(--green);
  border: 1px solid var(--green);
  border-radius: 6px;
  color: #FFFFFF;
  cursor: pointer;
  display: inline-block;
  font: inherit;
  font-weight: 600;
  padding: 9px 18px;
  text-decoration: none;
}
.button:hover { background: #17573F; }
.button[disabled], .button.is-disabled {
  background: var(--muted);
  border-color: var(--muted);
  cursor: not-allowed;
}

.note { color: var(--muted); font-size: 0.9rem; }

/* status and program swatches, used from milestone 5 on ------------------- */

.status { border-radius: 999px; font-size: 0.8rem; font-weight: 600; padding: 2px 10px; }
.status--on_track { background: rgba(29, 106, 79, 0.12); color: var(--on-track); }
.status--at_risk { background: rgba(201, 162, 39, 0.15); color: #8A6D12; }
.status--off_track { background: rgba(180, 35, 24, 0.12); color: var(--off-track); }

.program--DEX { color: var(--dex); }
.program--CSC { color: var(--csc); }
.program--LVC { color: var(--lvc); }
.program--RES { color: var(--res); }

/* footer ------------------------------------------------------------------ */

.colophon {
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.85rem;
  padding: 18px 0 40px;
}

/* start: the pipeline stages annotated with the user's own state ---------- */

.stagecards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  list-style: none;
  margin: 16px 0 24px;
  padding: 0;
  counter-reset: none;
}
.stagecards li {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  flex: 1 1 160px;
  padding: 12px 14px;
}
.stagecards li.is-done { border-color: var(--green); }
.stagecards a { font-weight: 600; text-decoration: none; }
.stagecards a:hover { text-decoration: underline; }
.stagecards__detail { color: var(--muted); display: block; font-size: 0.85rem; }
.stagecards li.is-done .stagecards__detail::before { color: var(--green); content: "✓ "; }

/* destroy ----------------------------------------------------------------- */

.counts { border-collapse: collapse; font-size: 0.9rem; width: 100%; }
.counts caption { color: var(--muted); font-size: 0.85rem; padding-bottom: 8px; text-align: left; }
.counts th, .counts td { border-bottom: 1px solid var(--rule); padding: 6px 8px; text-align: left; }
.counts thead th { color: var(--muted); font-weight: 600; }
.counts .num { font-variant-numeric: tabular-nums; text-align: right; }
.counts tfoot th, .counts tfoot td { border-bottom: none; font-weight: 600; }

.error { color: var(--off-track); font-weight: 600; }
.button--danger { background: var(--off-track); border-color: var(--off-track); }
.button--danger:hover { background: #8F1C13; }

/* --------------------------------------------------------------- page 1 --- */
.counts .ok { color: var(--on-track); font-weight: 600; }
.counts .not-ok { color: var(--off-track); font-weight: 600; }

.viewer__pick { align-items: center; display: flex; gap: 12px; margin: 12px 0 16px; }
.viewer__pick select { max-width: 44ch; padding: 6px 8px; }

.viewer { align-items: start; display: grid; gap: 20px; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
@media (max-width: 860px) { .viewer { grid-template-columns: minmax(0, 1fr); } }
.viewer__json {
  background: #FFFFFF;
  border: 1px solid var(--rule);
  border-radius: 8px;
  font-size: 0.78rem;
  line-height: 1.45;
  margin: 0;
  max-height: 32rem;
  overflow: auto;
  padding: 12px 14px;
}
.hl--name { background: rgba(29, 106, 79, 0.12); display: inline-block; width: 100%; }
.hl--address { background: rgba(201, 162, 39, 0.18); display: inline-block; width: 100%; }
.viewer__flat th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.viewer__flat td { word-break: break-word; }

/* The walkthrough's figures under the breadcrumb, on every stage page. */
.statusline {
  background: #FFFFFF;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
  padding: 8px 0;
}
.statusline__dot { color: var(--rule); }

/* Page 2 — Parse: coverage cards, the assignment timeline, the JIF table. */
.cards { display: flex; flex-wrap: wrap; gap: 12px; list-style: none; margin: 16px 0 8px; padding: 0; }
.card {
  background: var(--paper); border: 1px solid var(--rule); border-radius: 8px;
  display: flex; flex-direction: column; flex: 1 1 180px; gap: 2px; padding: 14px 16px;
}
.card__figure { font-family: var(--display); font-size: 1.7rem; font-variant-numeric: tabular-nums; }
.card__label { font-size: 0.9rem; font-weight: 600; }
.card__of { color: var(--muted); font-size: 0.8rem; }

.nowrap { white-space: nowrap; }
.registry__norm { color: var(--muted); display: block; font-size: 0.78rem; }
.registry td { vertical-align: middle; }

.timeline { background: var(--wash); border-radius: 3px; height: 16px; min-width: 200px; position: relative; }
.timeline__employed { background: var(--rule); border-radius: 3px; height: 16px; position: absolute; top: 0; }
.timeline__bar { border-radius: 3px; height: 10px; opacity: 0.9; position: absolute; top: 3px; }
.timeline__bar--DEX { background: var(--dex); }
.timeline__bar--CSC { background: var(--csc); }
.timeline__bar--LVC { background: var(--lvc); }
.timeline__bar--RES { background: var(--res); }
.timeline__left {
  background: var(--paper); border: 2px solid var(--off-track); border-radius: 50%;
  height: 10px; margin-left: -5px; position: absolute; top: 3px; width: 10px;
}
.timeline__scale {
  color: var(--muted); display: flex; font-size: 0.7rem; font-weight: 400;
  justify-content: space-between; margin-top: 2px; min-width: 200px;
}

.jif--high { background: rgba(29, 106, 79, 0.12); font-weight: 600; }

/* Page 3 — Match: the tier table, its reveal, and the queue in prose. */
#tiers tr { transition: opacity 200ms ease; }
#tiers tr.is-hidden { opacity: 0; }
.tier--queued td { border-top: 2px solid var(--rule); color: var(--muted); }
.button--small { font-size: 0.8rem; padding: 4px 10px; }
.queue { margin: 8px 0 16px; padding-left: 20px; }
.queue li { margin-bottom: 6px; }
.queue em { color: var(--ink); font-style: normal; font-weight: 500; }

/* page 4: the review queue */
.decide { border: 1px solid var(--rule); border-radius: 8px; margin: 16px 0; padding: 12px 16px; }
.decide__head { align-items: baseline; display: flex; gap: 12px; }
.decide__head h3 { margin: 0; }
.decide__reason { border-radius: 999px; font-size: 0.78rem; font-weight: 600; padding: 2px 10px; }
.decide__reason--ambiguous { background: rgba(201, 162, 39, 0.18); color: #8A6D12; }
.decide__reason--low_score { background: rgba(201, 162, 39, 0.18); color: #8A6D12; }
.decide__reason--no_candidate { background: rgba(180, 35, 24, 0.10); color: var(--off-track); }
.decide__why { color: var(--muted); font-size: 0.85rem; margin: 4px 0 12px; }
.decide__grid { align-items: start; display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.decide__grid h4 { margin: 0 0 6px; }
.decide__paper { display: flex; flex-direction: column; font-size: 0.9rem; gap: 2px; margin: 0 0 10px; }
.decide__title { font-weight: 600; }
.decide__meta { color: var(--muted); font-size: 0.82rem; }
.decide__pos th { color: var(--muted); font-weight: 600; white-space: nowrap; width: 12ch; }
.decide__not { align-items: center; display: flex; gap: 10px; margin-top: 14px; }
.decide__not .note { margin: 0; }

.authors { font-size: 0.85rem; margin: 0; padding-left: 22px; }
.authors li { margin-bottom: 2px; }
.authors li.is-iita .authors__name { font-weight: 600; }
.authors li.is-subject { background: rgba(201, 162, 39, 0.18); font-weight: 700; }
.authors__tag { color: var(--muted); font-size: 0.78rem; margin-left: 6px; }
.authors__tag--matched { color: var(--green); }

.cands { list-style: none; margin: 0 0 10px; padding: 0; }
.cands li { align-items: baseline; border-bottom: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 0; }
.cands form { display: inline; }
.cands__name { font-weight: 600; }
.cands__score { font-variant-numeric: tabular-nums; }
.cands__why { color: var(--muted); font-size: 0.8rem; }

.search { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.search input[type="search"] { border: 1px solid var(--rule); border-radius: 4px; padding: 5px 8px; }

@media (max-width: 760px) { .decide__grid { grid-template-columns: minmax(0, 1fr); } }

/* dashboard screens 1-3 (specs/07-pages.md) ------------------------------- */
.screen__head { align-items: flex-end; display: flex; gap: 24px; justify-content: space-between; margin-bottom: 16px; }
.screen__meta { text-align: right; }
.screen__meta .note { margin: 6px 0 0; }
.crumbs { color: var(--muted); font-size: 0.85rem; margin: 0 0 2px; }
.screen__year { color: var(--muted); font-weight: 500; }
.crumbs a { color: var(--muted); }

.picker { align-items: center; display: inline-flex; gap: 8px; }
.picker label { color: var(--muted); font-size: 0.85rem; }
.picker select { border: 1px solid var(--rule); border-radius: 4px; padding: 4px 6px; }

.strip { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); list-style: none; margin: 0 0 20px; padding: 0; }
.strip__card {
  align-items: baseline; background: var(--paper); border: 1px solid var(--rule); border-radius: 8px;
  display: flex; flex-wrap: wrap; font-size: 0.9rem; gap: 6px; padding: 14px 16px;
}
.strip__card strong { font-family: var(--display); font-size: 1.5rem; }
.strip__card--wide { color: var(--muted); }
.strip__card--none { color: var(--muted); }
.strip__card--none strong { color: var(--ink); font-size: 1.25rem; }
.dot { border-radius: 50%; display: inline-block; height: 8px; width: 8px; }
.dot--on_track { background: var(--on-track); }
.dot--at_risk { background: var(--at-risk); }
.dot--off_track { background: var(--off-track); }
.dot--none { border: 1px solid var(--muted); }

/* status by shape and word as well as colour (specs/09-design-references.md) */
.mark { font-size: 0.7em; line-height: 1; }
.mark--on_track { color: var(--on-track); }
.mark--at_risk { color: var(--at-risk); }
.mark--off_track { color: var(--off-track); }
.mark--none { color: var(--muted); }

.screen { align-items: start; display: grid; gap: 20px; grid-template-columns: minmax(0, 3fr) minmax(0, 1.35fr); }
.screen > div > .panel { margin-bottom: 20px; }
.panel__head { align-items: baseline; display: flex; gap: 16px; justify-content: space-between; margin-bottom: 10px; }
.panel__head h2 { font-size: 1.05rem; margin: 0; }
.panel__hint { color: var(--muted); font-size: 0.82rem; text-align: right; }

.rail { background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 14px 16px; }
.rail__head { align-items: baseline; display: flex; gap: 12px; justify-content: space-between; }
.rail__head h2 { font-size: 0.95rem; margin: 0 0 8px; }
.rail__hint { color: var(--muted); font-size: 0.78rem; }
.rail h3 { font-size: 0.85rem; letter-spacing: 0.04em; margin: 18px 0 6px; text-transform: uppercase; }

.kpis { border-collapse: collapse; font-size: 0.92rem; width: 100%; }
.kpis th, .kpis td { border-bottom: 1px solid var(--rule); padding: 9px 6px; text-align: left; vertical-align: middle; }
.kpis thead th { color: var(--muted); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.kpis .num { font-variant-numeric: tabular-nums; text-align: right; }
.kpis__category th { border-bottom: none; color: var(--green); font-size: 0.78rem; letter-spacing: 0.04em; padding-top: 14px; text-transform: uppercase; }
.kpis__id { color: var(--muted); font-size: 0.82rem; white-space: nowrap; width: 5ch; }
.kpis__value { white-space: nowrap; }
.kpis__value strong { font-family: var(--display); font-size: 1.25rem; }
.kpis__unit { color: var(--muted); font-size: 0.8rem; }
.kpis__target { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.kpis__status { white-space: nowrap; }
.kpis__of { color: var(--muted); display: block; font-size: 0.78rem; }
.kpis__name a { color: var(--ink); text-decoration: none; }
.kpis__name a:hover { color: var(--green); text-decoration: underline; }
.kpis__spark { text-align: right; width: 78px; }
.spark { vertical-align: middle; }
.spark--empty { color: var(--rule); }
.status--none { background: var(--wash); color: var(--muted); }
.status--not_measured { background: var(--wash); border: 1px dashed var(--muted); color: var(--muted); }

/* not measured: no value, no target, no status, and a way to find out why */
.nm { color: var(--muted); font-size: 0.8rem; font-weight: 400; white-space: nowrap; }
.nm__box {
  border: 1px dashed var(--muted); border-radius: 2px; display: inline-block;
  height: 10px; vertical-align: middle; width: 22px;
}
.nm--compact .nm__box { width: 16px; }

.bullet { display: block; margin-left: auto; }
.kpis__bullet { width: 112px; }
.oftarget { color: var(--muted); display: block; font-size: 0.75rem; font-weight: 400; }
.cell__of { color: var(--muted); display: block; font-size: 0.7rem; font-weight: 400; }

/* the naive sum beside the deduplicated figure (principle 4) */
.pair { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; margin-top: 12px; }
.pair__cell { background: var(--wash); border-radius: 8px; padding: 8px 10px; }
.pair__cell--kept { background: rgba(29, 106, 79, 0.10); }
.pair__label { color: var(--muted); display: block; font-size: 0.72rem; }
.pair__figure { display: block; font-family: var(--display); font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.pair__note { color: var(--muted); display: block; font-size: 0.7rem; }
.pair__cell--kept .pair__note { color: var(--green); font-weight: 600; }

.byyear .period { background: var(--wash); font-weight: 600; }
.byyear .is-current { font-weight: 600; }

.trend, .bars { display: block; height: auto; max-width: 100%; }

.cardlist { list-style: none; margin: 0; padding: 0; }
.entity { border: 1px solid var(--rule); border-radius: 8px; margin-bottom: 8px; }
.entity a { color: var(--ink); display: block; padding: 10px 12px; text-decoration: none; }
.entity a:hover { background: var(--wash); }
.entity__name { display: block; font-weight: 600; }
.entity__id { color: var(--muted); font-weight: 400; }
.entity__meta { color: var(--muted); display: block; font-size: 0.8rem; }
.entity__status { display: inline-block; margin-top: 6px; }

.honesty { background: var(--wash); border-radius: 8px; color: var(--muted); font-size: 0.85rem; margin: 12px 0 0; padding: 10px 12px; }

.stat { flex-direction: column; gap: 2px; }
.stat__head { align-items: center; color: var(--muted); display: flex; font-size: 0.78rem; gap: 8px; justify-content: space-between; width: 100%; }
.stat__label { font-size: 0.9rem; font-weight: 600; }
.stat__value { font-size: 1.9rem; font-variant-numeric: tabular-nums; }
.stat__of { color: var(--muted); font-size: 0.78rem; }
.stat .bullet { margin: 6px 0 0; }
.stat__pct { color: var(--muted); font-size: 0.78rem; }
.stat__pct .oftarget { display: inline; }

.behind { display: grid; font-size: 0.86rem; gap: 4px 10px; grid-template-columns: minmax(0, 1fr) auto; margin: 0; }

.behind dt { color: var(--muted); line-height: 1.3; }
.behind dd { font-variant-numeric: tabular-nums; font-weight: 600; margin: 0; text-align: right; }
.definition { color: var(--muted); font-size: 0.82rem; margin: 0 0 8px; }
.flag { background: rgba(201, 162, 39, 0.12); border-radius: 6px; color: #6B5510; font-size: 0.8rem; margin: 8px 0 0; padding: 8px 10px; }
.flag::before { content: "⚠ "; }

@media (max-width: 900px) {
  .screen { grid-template-columns: minmax(0, 1fr); }
  .screen__head { display: block; }
  .screen__meta { text-align: left; }
}

/* --- screens 4-8 ---------------------------------------------------------- */
.views { display: flex; flex-wrap: wrap; font-size: 0.82rem; gap: 14px; margin-top: 6px; }
.views a { color: var(--muted); text-decoration: none; }
.views a:hover { color: var(--green); text-decoration: underline; }
.views__here { color: var(--green); font-weight: 600; }

.picker--wide { flex-wrap: wrap; gap: 14px; margin-bottom: 16px; }
.dots, .lines, .funnel { display: block; height: auto; max-width: 100%; }

.matrix__cell a { color: var(--ink); display: block; text-decoration: none; }
.matrix__cell a:hover { color: var(--green); }
.matrix__cell strong { font-family: var(--display); font-size: 1.05rem; }
.matrix__cell.is-open { background: rgba(29, 106, 79, 0.08); }
.matrix .kpis__name a { color: var(--ink); text-decoration: none; }
.legend { color: var(--muted); font-size: 0.78rem; margin: 10px 0 0; }
.legend .nm__box { vertical-align: middle; }

.papers { font-size: 0.85rem; }
.papers__title { display: block; font-weight: 600; }
.papers__uid { color: var(--muted); font-size: 0.75rem; }

.chain, .targets, .pipeline, .quality, .coverage { font-size: 0.85rem; }
.chain td, .chain th, .targets td, .targets th, .pipeline th, .pipeline td { padding: 6px 4px; }
.pipeline th { color: var(--muted); font-weight: 500; text-align: left; }

.passport { border-collapse: collapse; font-size: 0.9rem; width: 100%; }
.passport th { border-bottom: 1px solid var(--rule); color: var(--muted); font-weight: 500;
  padding: 8px 12px 8px 0; text-align: left; vertical-align: top; width: 16ch; }
.passport td { border-bottom: 1px solid var(--rule); padding: 8px 0; }
.feeds { font-size: 0.85rem; }
.feeds code { background: var(--wash); font-size: 0.85em; padding: 1px 4px; }

.rules { color: var(--muted); font-size: 0.82rem; margin: 0; padding-left: 18px; }
.rules li { margin-bottom: 8px; }

.coverage__cell .cell__of { font-size: 0.68rem; }
.unmatched { font-size: 0.82rem; margin: 8px 0 0; padding-left: 18px; }
.unmatched__addr { color: var(--muted); display: block; font-size: 0.76rem; }
.lost { color: var(--muted); font-size: 0.78rem; margin: 8px 0 0; padding-left: 18px; }
.coverage__program th { color: var(--ink); font-weight: 600; text-align: left; }
.coverage__project { color: var(--muted); padding-left: 14px !important; }
.cell__of.nofte { color: var(--at-risk); }
