/**
 * The verdict card — PRD §6. Requires styles/tokens.css.
 *
 * Rendered top to bottom in §6's exact order, which is a product decision and
 * not a layout preference:
 *
 *   1 header · 2 the dose · 3 if it goes wrong · 4 stop proposer ·
 *   5 if it goes right · 6 your rules vs the signal's · 7 account risk ·
 *   8 warnings · 9 actions · 10 click steps
 *
 * THE LOSS COMES BEFORE THE GAIN (§3.6), which is why "if it goes wrong" is
 * section 3 and "if it goes right" is section 5. Reordering them is a spec
 * change, not a styling choice.
 *
 * Geometry is copied from design/rapater-calculator.html rather than
 * approximated from §3's tables — prompt 1.3 makes that file the visual truth
 * for spacing, weight, radius and colour.
 */

/* --- The card shell ------------------------------------------------------ */

.verdict {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-verdict);
  overflow: hidden;
  box-shadow: var(--shadow-verdict);
}

/* Every section after the header is separated by the 1px rule, never heavier. */
.verdict__sect {
  padding: 20px 24px;
  border-top: 1px solid var(--line);
}

.verdict__sect > .cap {
  display: block;
  margin-bottom: 14px;
}

/* --- 1. Header ----------------------------------------------------------- */

.verdict__head {
  padding: 24px;
}

.verdict__dir {
  font-size: var(--t-dir);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* The one-sentence description of the signal. §1.4.1: this string is generated
   at the signal layer and describes what the signal says — it never tells the
   reader what to do. */
.verdict__plain {
  color: var(--body);
  font-size: var(--t-body);
  margin-top: 6px;
}

/* --- 2. The dose --------------------------------------------------------- */

.dose {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.dose__box {
  background: var(--tint);
  border-radius: var(--r-inset);
  padding: 14px 16px;
}

.dose__k {
  font-size: var(--t-label);
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.dose__v {
  font-size: var(--t-stat);
  font-weight: 700;
  color: var(--purple);
  margin-top: 3px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* --- 3. If it goes wrong ------------------------------------------------- */

/* §6 item 3: full-bleed red band, and the loss is "the largest element on the
   page" at 52px. That is the whole point of the card — it is why the loss is
   stated before any gain, and why nothing else may be sized above it. */
.verdict__hero {
  background: var(--red-soft);
  padding: 24px;
}

.verdict__hero .cap {
  color: var(--red);
  opacity: 0.8;
}

.verdict__loss {
  font-size: var(--t-hero);
  font-weight: 700;
  color: var(--red);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}

.verdict__hero-caption {
  color: var(--red);
  opacity: 0.9;
  font-size: 15px;
  margin-top: 8px;
}

/* --- 4. Stop proposer ---------------------------------------------------- */

/* Shown only when stopWasProposed. The signal gave no stop, so this is the
   one number on the card the reader is invited to change. */
.stop-proposer {
  padding: 20px 24px;
  border-top: 1px solid var(--line);
  background: var(--tint);
}

.stop-proposer .cap {
  color: var(--amber);
}

.stop-proposer__slider {
  width: 100%;
  accent-color: var(--purple);
  margin: 12px 0 6px;
}

.stop-proposer__read {
  display: flex;
  justify-content: space-between;
  font-size: 14.5px;
  color: var(--body);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* --- 5. If it goes right — the target ladder ----------------------------- */

.ladder {
  width: 100%;
  border-collapse: collapse;
  font-size: 15.5px;
}

.ladder th {
  text-align: left;
  font-size: var(--t-label);
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 10px;
}

.ladder th.r,
.ladder td.r {
  text-align: right;
}

.ladder td {
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-weight: 500;
}

/* A target that clears the reader's own minimum, and one that does not. The
   colour states the comparison; it does not advise. */
.ladder tr.pass td:last-child {
  color: var(--green);
  font-weight: 600;
}

.ladder tr.fail td:last-child {
  color: var(--red);
  font-weight: 600;
}

/* The first passing target, filled with rounded end cells — the row the reader
   is looking for. In §10.4's vector this is target 4, not target 1. */
.ladder tr.first-pass {
  background: var(--green-soft);
}

.ladder tr.first-pass td {
  padding-left: 10px;
  padding-right: 10px;
}

.ladder tr.first-pass td:first-child {
  border-radius: 10px 0 0 10px;
}

.ladder tr.first-pass td:last-child {
  border-radius: 0 10px 10px 0;
}

/* --- 6. Your rules vs the signal's leverage ------------------------------ */

/**
 * §6 item 6, the signature element. Two 26px pill bars on ONE SHARED SCALE, so
 * the two losses are visually true — in §10.4's vector that is $10.00 against
 * $490.31, a 49x difference the reader sees rather than reads.
 *
 * §6: "Never collapsed, hidden behind a toggle, or moved below the fold. If
 * scope must be cut, cut something else." There is deliberately no collapsed
 * variant of this component to reach for.
 */
.bars__row {
  margin-bottom: 18px;
}

.bars__row:last-child {
  margin-bottom: 0;
}

.bars__label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 7px;
}

.bars__who {
  font-size: 14.5px;
  color: var(--body);
}

.bars__amt {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.bars__track {
  height: 26px;
  background: #2c2140;
  border-radius: var(--r-pill);
  overflow: hidden;
}

.bars__fill {
  height: 100%;
  border-radius: var(--r-pill);
  transition: width 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.bars__fill--mine {
  background: var(--green);
}

.bars__fill--theirs {
  background: var(--red);
}

/* States the multiple and the % of account (§6 item 6). The bars carry the
   comparison; this says it in words for anyone who cannot see them. */
.bars__caption {
  margin-top: 12px;
  color: var(--body);
}

/* --- 7. Account risk ----------------------------------------------------- */

.account-risk {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

/* --- 8. Warnings --------------------------------------------------------- */

/* Only those that fired. §3.5 forbids emoji and exclamation marks, so the mark
   is a typographic caret and the words carry the weight. */
.warn {
  padding: 16px 24px;
  background: var(--amber-soft);
  border-top: 1px solid var(--line);
  color: var(--amber);
  font-size: 15px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.warn__mark {
  font-weight: 700;
  flex-shrink: 0;
}

/* --- 9. Actions ---------------------------------------------------------- */

.actions {
  padding: 20px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--r-pill);
  padding: 13px 26px;
  border: none;
  transition: all 0.14s;
}

.btn--primary {
  background: linear-gradient(90deg, #ff4d82, #ff7ba3);
  color: #fff;
  border-radius: 9px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: var(--t-small);
  box-shadow: var(--shadow-primary);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-primary-hover);
}

.btn--primary:disabled {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
}

.btn--soft {
  background: var(--purple-soft);
  color: var(--purple-deep);
}

.btn--soft:hover {
  background: rgba(255, 77, 130, 0.22);
}

.btn--ghost {
  background: transparent;
  color: var(--body);
  border: 1px solid var(--line);
}

.btn--ghost:hover {
  border-color: var(--purple);
  color: var(--ink);
}

/* --- 10. Click steps ----------------------------------------------------- */

/* §6 item 10: numbered list with --purple-soft numerals, revealed on demand.
   §1.4.1: these come from lib/steps.ts, generated from the verdict — never
   from the signal. */
.steps {
  counter-reset: s;
  list-style: none;
  padding: 0;
  margin: 0;
}

.steps li {
  counter-increment: s;
  position: relative;
  padding: 12px 0 12px 42px;
  border-top: 1px solid var(--line);
  font-size: 15.5px;
}

.steps li:first-child {
  border-top: none;
}

.steps li::before {
  content: counter(s);
  position: absolute;
  left: 0;
  top: 11px;
  font-size: 13px;
  font-weight: 700;
  color: var(--purple-deep);
  background: var(--purple-soft);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
