/* ── Funding-model consultation: components added on top of gs-style.css ──
   Uses only existing tokens. No new colours. */

/* Cost facts panel */
.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--rule);
  background: var(--white);
  margin: 1.1rem 0 0.25rem;
}
.fact {
  padding: 0.9rem 1.1rem;
  border-right: 1px solid var(--rule-light);
}
.fact:last-child { border-right: 0; }
.fact-label {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--light-muted);
  margin-bottom: 0.35rem;
}
.fact-value {
  font-family: var(--font-figures);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--near-black);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.fact-sub {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 0.2rem;
  line-height: 1.4;
}

/* Key considerations */
.considerations {
  list-style: none;
  margin-top: 1.1rem;
  display: grid;
  gap: 0.4rem;
}
.considerations li {
  font-family: var(--font-serif);
  font-size: 0.92rem;
  color: var(--mid);
  padding-left: 1.1rem;
  position: relative;
  line-height: 1.55;
}
.considerations li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.62em;
  width: 5px; height: 5px;
  background: var(--light-muted);
}

/* ── Ranking control ─────────────────────────────────────────── */
.rank-instruction {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--mid);
  line-height: 1.5;
  margin-bottom: 1rem;
}
.rank-instruction b { color: var(--dark); font-weight: 700; }

.rank-list { display: grid; gap: 0.6rem; }

.rank-card {
  display: grid;
  grid-template-columns: 3.1rem 1fr auto;
  align-items: start;
  gap: 0 1rem;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--rule);
  background: var(--white);
  padding: 0.9rem 1.1rem 0.95rem 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.rank-card:hover { border-color: var(--light-muted); border-left-color: var(--muted); }
.rank-card.ranked {
  border-left-color: var(--near-black);
  box-shadow: inset 0 0 0 1px var(--rule-light);
}
.rank-card.dupe { border-color: var(--warning); border-left-color: var(--warning); background: var(--warning-bg); }

/* The rank badge doubles as the select's visible face */
.rank-slot { position: relative; width: 3.1rem; }
.rank-badge {
  width: 2.5rem; height: 2.5rem;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--rule);
  background: var(--bg-soft);
  font-family: var(--font-figures);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--light-muted);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  user-select: none;
}
.rank-card.ranked .rank-badge {
  background: var(--near-black);
  border-color: var(--near-black);
  color: var(--white);
}
.rank-card.dupe .rank-badge { background: var(--warning); border-color: var(--warning); color: var(--white); }
.rank-select {
  position: absolute; inset: 0;
  width: 2.5rem; height: 2.5rem;
  opacity: 0;
  cursor: pointer;
  padding: 0; border: 0;
}
.rank-select:focus-visible + .rank-badge { outline: 2px solid var(--dark); outline-offset: 2px; }
.rank-slot-hint {
  display: block;
  margin-top: 0.3rem;
  font-family: var(--font-sans);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--light-muted);
  text-align: center;
  width: 2.5rem;
}

.rank-body h3 {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 400;
  font-variation-settings: "opsz" 96, "SOFT" 50;
  letter-spacing: -0.005em;
  color: var(--near-black);
  line-height: 1.35;
}
.rank-desc {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  color: var(--mid);
  line-height: 1.55;
  margin-top: 0.25rem;
}
.rank-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.4rem;
  margin-top: 0.6rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--rule-light);
}
.rank-strip div { min-width: 0; }
.rank-strip dt {
  font-family: var(--font-sans);
  font-size: 0.53rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--light-muted);
}
.rank-strip dd {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--dark);
  margin-top: 0.12rem;
  line-height: 1.4;
}
/* --carry is reserved in this design system for the 'carried over, needs your
   confirmation' FIELD state. An undefined split is a note, not an action, so it
   takes the house note/caption convention: italic Crimson Pro in --muted. */
.rank-strip dd.undefined-split {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
}

.rank-move {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 0.15rem;
}
.rank-move button {
  width: 24px; height: 20px;
  border: 1px solid var(--rule);
  background: var(--white);
  color: var(--light-muted);
  font-size: 0.6rem;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, border-color 0.15s;
}
.rank-move button:hover:not(:disabled) { color: var(--near-black); border-color: var(--dark); }
.rank-move button:disabled { opacity: 0.3; cursor: default; }

.rank-status-row {
  display: flex; align-items: center; gap: 1rem;
  flex-wrap: wrap; margin-top: 1rem;
}

/* Checkbox / radio groups in house style */
.choice-list { display: grid; gap: 0.45rem; margin-top: 0.15rem; }
.choice {
  display: flex; align-items: flex-start; gap: 0.6rem;
  border: 1px solid var(--rule);
  background: var(--white);
  padding: 0.6rem 0.85rem;
  cursor: pointer;
  font-family: var(--font-serif);
  font-size: 0.92rem;
  color: var(--dark);
  line-height: 1.45;
  transition: border-color 0.15s, background 0.15s;
}
.choice:hover { border-color: var(--light-muted); }
.choice input { margin-top: 0.28rem; accent-color: var(--near-black); flex-shrink: 0; width: 14px; height: 14px; }
.choice.on { border-color: var(--near-black); box-shadow: inset 2px 0 0 var(--near-black); }
.choice .choice-note {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.66rem;
  color: var(--muted);
  margin-top: 0.15rem;
  line-height: 1.4;
}
.choice-cols { grid-template-columns: 1fr 1fr; }

.q { margin-bottom: 1.5rem; }
.q:last-child { margin-bottom: 0; }
.q > .q-label {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mid);
  line-height: 1.35;
  margin-bottom: 0.15rem;
}
.q > .help { display: block; margin-bottom: 0.5rem; }

.conditional[hidden] { display: none; }
.conditional {
  margin-top: 0.85rem;
  padding-left: 1rem;
  border-left: 1px solid var(--rule);
}

.charcount {
  font-family: var(--font-sans);
  font-size: 0.63rem;
  color: var(--light-muted);
  text-align: right;
  margin-top: 0.25rem;
}

.deadline-bar {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--mid);
}
.deadline-bar b { color: var(--near-black); font-weight: 700; }


@media (max-width: 640px) {
  .facts { grid-template-columns: 1fr; }
  .fact { border-right: 0; border-bottom: 1px solid var(--rule-light); }
  .fact:last-child { border-bottom: 0; }
  .rank-card { grid-template-columns: 3.1rem 1fr; }
  .rank-move { grid-column: 1 / -1; flex-direction: row; margin-top: 0.6rem; justify-content: flex-end; }
  .choice-cols { grid-template-columns: 1fr; }
}

/* ── Admin: results/link tables ─────────────────────────────────
   Same convention as grayswan-survey's report.css .gs-risk-legend
   scrollbar — thin, always visible (not the OS overlay style, which on
   macOS auto-hides and reads as "there's no way to scroll this"). */
.scroll-x {
  overflow-x: scroll;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) var(--bg-soft);
}
.scroll-x::-webkit-scrollbar { height: 10px; }
.scroll-x::-webkit-scrollbar-track { background: var(--bg-soft); }
.scroll-x::-webkit-scrollbar-thumb {
  background: var(--muted);
  border-radius: 4px;
  border: 2px solid var(--bg-soft);
}
.scroll-x::-webkit-scrollbar-thumb:hover { background: var(--dark); }

.link-cell { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
