/* =============================================================================
   stage-proposal.css — Stage 01 · Proposal page styles.
   Loaded after controls.css + pages.css. Page-specific composition only —
   primitives (.panel, .seg, .doc-chip, .stat-tile, .badge) come from controls.
   All colour via CSS custom properties. Square corners, no shadows.
   ========================================================================== */

.prop-stage { display: flex; flex-direction: column; gap: var(--space-6); }

/* ── tab bar ────────────────────────────────────────────────────────────────── */

.prop-tabbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  /* Gap to the tab content below so the card isn't flush with the tabs --
   * matches .cmp-tabbar / .memo-toolbar. */
  margin-bottom: var(--space-4);
}

/* ── tab body ───────────────────────────────────────────────────────────────── */

.prop-tab { display: flex; flex-direction: column; gap: var(--space-6); }

.prop-block { display: flex; flex-direction: column; gap: var(--space-3); }

.prop-sub { display: flex; flex-direction: column; gap: var(--space-3); }

/* ── grids ──────────────────────────────────────────────────────────────────── */

.prop-grid { display: grid; gap: var(--space-4); }
.prop-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.prop-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ── prose ──────────────────────────────────────────────────────────────────── */

.prop-prose {
  color: var(--text-secondary);
  font-size: var(--text-body-sm);
  line-height: 1.55;
}
.prop-prose--lede { font-size: var(--text-body); }
.prop-prose--sm { font-size: var(--text-body-xs); }
.prop-prose--tight { margin-top: var(--space-1); }
.prop-prose--strong { color: var(--text-primary); }

/* Screening-verdict body inside the hero — even spacing between the verdict
   statement, the rationale, and each labelled sub-section. */
.prop-verdict { display: flex; flex-direction: column; gap: var(--space-4); }

/* ── rules ──────────────────────────────────────────────────────────────────── */

.prop-rule {
  height: 1px;
  background: var(--hairline);
  margin: var(--space-5) 0 var(--space-1);
}

/* IRR list rendered under headline economics — each row is a basis label
 * (verbatim from the source memo) and its value. The primary row gets a
 * tonal lift so the IC reader's eye lands on it first. */
.prop-irrs {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: var(--space-2);
}
.prop-irrs__row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-top: 1px solid var(--hairline);
  font-size: var(--text-body-sm);
}
.prop-irrs__row:first-child { border-top: none; }
.prop-irrs__row--primary {
  font-weight: 600;
  color: var(--text-primary);
}
.prop-irrs__label { color: var(--text-muted); }
.prop-irrs__row--primary .prop-irrs__label { color: var(--text-primary); }
.prop-irrs__value {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* Spacer only — the feathered divider was removed; the margin keeps the gap. */
.prop-rule--soft {
  background: transparent;
  margin: var(--space-5) 0 0;
}

/* ── labelled field ─────────────────────────────────────────────────────────── */

.prop-field {
  border-top: 1px solid var(--hairline);
  padding: var(--space-3) var(--space-4) var(--space-3) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.prop-field__value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-body-sm);
  color: var(--text-primary);
  line-height: 1.5;
}

/* ── deal overview ──────────────────────────────────────────────────────────── */

.prop-overview .panel__body { display: flex; flex-direction: column; }
.prop-overview__name { font-size: var(--text-h3); margin-bottom: var(--space-3); }

/* ── recommendation ─────────────────────────────────────────────────────────── */

/* The screening verdict now renders via SynthesisHero (controls/composites). */

/* Stylized ordered list — a mono accent "01 02 03" marker. */
.prop-list {
  margin: var(--space-3) 0 0;
  padding-left: 0;
  list-style: none;
  counter-reset: prop-item;
  color: var(--text-secondary);
}
.prop-list li {
  counter-increment: prop-item;
  position: relative;
  padding-left: var(--space-7);
  margin-bottom: var(--space-3);
  line-height: 1.5;
}
.prop-list li::before {
  content: counter(prop-item, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.05em;
  font-family: var(--font-mono);
  font-size: var(--text-body-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent-emphasis);
}

/* ── early-flag / disclosure card heads ─────────────────────────────────────── */

.prop-flag__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.prop-disc__pillar { font-size: var(--text-h4); }

/* tag cluster on the right of a card head — category badge + severity etc. */
.prop-flag__tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* ── decisive-factors balance bar ───────────────────────────────────────────── */

/* A proportional segmented bar (against | mixed | supports) over a count
   legend — the lean of the verdict at a glance, above the sorted cards. Segment
   colours mirror the per-card direction badge (directionTone / .badge--*). */
.prop-balance {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.prop-balance__bar {
  display: grid;
  gap: 2px;
  height: 8px;
}
.prop-balance__seg--red     { background: var(--status-danger); }
.prop-balance__seg--orange  { background: var(--cta); }
.prop-balance__seg--accent  { background: var(--accent-emphasis); }
.prop-balance__seg--neutral { background: var(--text-muted); }
.prop-balance__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}
.prop-balance__tally {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.prop-balance__dot {
  width: 9px;
  height: 9px;
  flex: none;
}

/* ── decisive factors grid ──────────────────────────────────────────────────── */

.prop-factors {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: var(--space-3);
}
.prop-factor {
  border-top: 1px solid var(--hairline);
  padding-top: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.prop-factor__head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.prop-factor__weight {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Row-dividing hairlines belong *between* rows, never above the first. Neither
   .prop-field nor .prop-factor has a :first-child guard, and both sit in
   two-column grids, so the whole first row (both cells) draws a line. Strip it
   across the first row; the ≤960px override restores the second cell once the
   grid collapses to a single column. */
.prop-grid--2 > .prop-field:nth-child(-n + 2),
.prop-factors > .prop-factor:nth-child(-n + 2) {
  border-top: none;
}

/* ── diligence plan total ───────────────────────────────────────────────────── */

.prop-plan__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
}
.prop-plan__total-value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-body-sm);
  color: var(--text-primary);
}

/* ── two-column card splits ─────────────────────────────────────────────────── */

.prop-conflict__cols { margin-top: var(--space-3); }

.prop-confirm {
  margin-top: var(--space-4);
  background: color-mix(in srgb, var(--accent-emphasis) 6%, transparent);
  border: 1px solid var(--accent-emphasis);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* ── responsive ─────────────────────────────────────────────────────────────── */

@media (max-width: 960px) {
  .prop-grid--2,
  .prop-grid--3,
  .prop-factors { grid-template-columns: 1fr; }
  /* single column — the second cell is a real second row again. */
  .prop-grid--2 > .prop-field:nth-child(2),
  .prop-factors > .prop-factor:nth-child(2) { border-top: 1px solid var(--hairline); }
}
