/* Proposals tab — builds on the tokens and components in styles.css. */

/* Group cards collapse via <details>; the summary reuses .card-head. */
.proposal-group { padding-bottom: 16px; }
.proposal-group-head { cursor: pointer; list-style: none; margin-bottom: 0; min-height: var(--tap); align-items: center; }
.proposal-group-head::-webkit-details-marker { display: none; }
.proposal-group-head::after { content: "›"; color: var(--muted); font-size: 18px; transform: rotate(90deg); transition: transform 0.2s var(--ease); }
.proposal-group:not([open]) .proposal-group-head::after { transform: none; }
.proposal-group-head h2 { flex: 1; }
.proposal-group[open] .proposal-group-head { margin-bottom: 14px; }
.proposal-row .stack-main { display: flex; flex-direction: column; }
.proposal-row .stack-title { display: block; }

/* Detail */
.proposal-back { margin-bottom: 18px; }
.proposal-detail-head { margin-bottom: 20px; }
.proposal-detail-head h1 { font-size: 30px; line-height: 1.05; letter-spacing: -0.04em; margin-bottom: 10px; }
.proposal-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }

.proposal-decide { border-color: var(--primary-line); }
.proposal-decide-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.proposal-decide-buttons .btn-primary,
.proposal-decide-buttons .btn-ghost { min-height: 48px; }
.proposal-reject:hover { border-color: var(--danger); color: var(--danger); }
.proposal-reason { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.proposal-reason textarea { width: 100%; min-height: 110px; }
.proposal-decision-line { margin: 0 0 6px; }
.proposal-reason-text { margin: 0 0 14px; color: var(--text-2); white-space: pre-wrap; }

.proposal-digest { margin-bottom: 16px; }
.proposal-offer { font-size: 17px; font-weight: 600; margin: 0 0 4px; }
.proposal-subtitle { color: var(--text-2); margin: 0 0 14px; }
.proposal-parts { list-style: none; margin: 0 0 10px; padding: 0; border-top: 1px solid var(--border-soft); }
.proposal-parts li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); font-size: 14.5px; }
.proposal-total { font-weight: 600; }
.proposal-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.proposal-bonus { font-style: normal; font-size: 12px; color: var(--primary); margin-left: 4px; }

.proposal-actions-row { display: flex; flex-wrap: wrap; gap: 10px; }
.proposal-link-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

/* Scorecards: PASS/FAIL (or n/5) column + check name + detail line */
.score-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.score-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; background: var(--card-alt); border-radius: var(--radius-sm); }
.score-mark { flex: 0 0 48px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; color: var(--positive); padding-top: 2px; }
.score-row.is-fail { background: var(--danger-soft); }
.score-row.is-fail .score-mark { color: var(--danger); }
.score-body { display: flex; flex-direction: column; min-width: 0; }
.score-name { font-size: 14.5px; font-weight: 600; }
.score-detail { font-size: 13.5px; color: var(--text-2); overflow-wrap: anywhere; }
.proposal-fixes-label { margin-top: 16px; }
.proposal-fixes { margin: 6px 0 0; padding-left: 20px; color: var(--text-2); }

.proposal-log {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text-2);
}

/* Full-screen preview: the proposal is a light document, so the frame is white. */
.proposal-preview {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
}
.proposal-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(8px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.proposal-preview iframe { flex: 1; width: 100%; border: 0; background: #fff; }
body.no-scroll { overflow: hidden; }

@media (max-width: 860px) {
  .proposal-detail-head h1 { font-size: 26px; }
  .proposal-decide-buttons { flex-direction: column; }
  .proposal-decide-buttons .btn-primary,
  .proposal-decide-buttons .btn-ghost,
  .proposal-actions-row > * { width: 100%; min-height: 50px; font-size: 16px; }
  .proposal-actions-row { flex-direction: column; }
}
