/* Proof bench + compose-confirm modal + verifier matrix —
 * see docs/UX.md §Proof Bench, §Disclosure, docs/STYLE-GUIDE.md §11.
 *
 * The compose-confirm modal uses the coral bounded-exception border
 * per STYLE-GUIDE §2 / §10.5 — considered disclosure is the one place
 * the bounded-exception border appears as primary chrome, not as
 * punctuation. */

.proofs-hero {
  min-height: 100dvh;
  padding: var(--space-12) var(--space-6) var(--space-12);
  color: var(--color-text-body);
  display: grid;
  align-content: start;
}

.proofs-column {
  display: grid;
  width: min(100%, 1120px);
  margin-inline: auto;
  gap: var(--space-5);
  text-align: left;
}

/* Session-dev-key honesty banner. */
.proofs-notice {
  background: var(--color-accent-bounded-subtle);
  border-inline-start: 3px solid var(--color-accent-bounded);
  border-radius: var(--r-md);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--color-text-bounded);
  margin: 0;
}

.proofs-card {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-5);
  background: var(--color-bg-elevated);
  border-radius: var(--r-lg);
  border: 1px solid var(--color-border-secondary);
}

.proofs-card-title {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 500;
  color: var(--color-text-heading);
  margin: 0;
}

.proofs-card-body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--color-text-body);
  margin: 0;
}

.proofs-empty {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  padding: var(--space-4);
  border: 1px dashed var(--color-border-secondary);
  border-radius: var(--r-md);
  margin: 0;
}

.proofs-builder {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: var(--space-4);
  align-items: start;
}

.proofs-panel,
.proofs-preview {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--color-bg-page);
  border: 1px solid var(--color-border-secondary);
  border-radius: var(--r-md);
}

.proofs-panel h2,
.proofs-preview h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.2;
  font-weight: 500;
  color: var(--color-text-heading);
  margin: 0;
}

.proofs-panel-eyebrow {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  line-height: 1.3;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--color-primary-text);
  margin: 0 0 calc(-1 * var(--space-3));
}

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

.proofs-intent,
.proofs-suggestion {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-secondary);
  border-radius: var(--r-md);
  color: var(--color-text-body);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.proofs-intent:hover,
.proofs-suggestion:hover {
  border-color: var(--color-primary-accent);
}

.proofs-intent-active {
  background: var(--color-bg-proof-inset);
  border-color: var(--color-primary-accent);
}

.proofs-intent strong,
.proofs-suggestion strong {
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.2;
  font-weight: 500;
  color: var(--color-text-heading);
}

.proofs-intent span,
.proofs-suggestion span,
.proofs-suggestion em {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--color-text-body);
  font-style: normal;
}

.proofs-suggestion em {
  color: var(--color-primary-text);
  font-weight: 700;
}

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

.proofs-scope-field {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--color-bg-proof-inset);
  border: 1px solid var(--color-border-proof);
  border-radius: var(--r-md);
}

.proofs-scope-field span,
.proofs-preview dt {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  line-height: 1.3;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--color-text-muted);
}

.proofs-scope-field strong,
.proofs-scope-field select,
.proofs-preview dd {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.4;
  font-weight: 500;
  color: var(--color-text-heading);
}

.proofs-scope-field select {
  inline-size: 100%;
  min-block-size: 2.5rem;
  padding: var(--space-2);
  background: var(--color-bg-page);
  border: 1px solid var(--color-border-primary);
  border-radius: var(--r-md);
}

.proofs-suggestions {
  display: grid;
  gap: var(--space-3);
}

.proofs-suggestion-disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.proofs-preview {
  position: sticky;
  top: var(--space-6);
  background: var(--color-accent-bounded-subtle);
  border-inline-start: 3px solid var(--color-accent-bounded);
}

.proofs-preview dl {
  display: grid;
  gap: var(--space-3);
  margin: 0;
}

.proofs-preview-row {
  display: grid;
  gap: var(--space-1);
}

.proofs-preview dd {
  margin: 0;
}

/* Modal overlay + card. Considered-disclosure callout: coral
 * bounded-exception border (per STYLE-GUIDE §2 / §10.5) on a dark
 * scrim, centred. */
.modal-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: var(--space-6);
  background: rgba(14, 22, 20, 0.45); /* slate-950 @ 45% */
  z-index: 100;
}

.modal-card {
  position: relative; /* anchor for absolutely-positioned descendants */
  width: min(60ch, 100%);
  max-height: 90dvh;
  overflow-y: auto;
  background: var(--color-bg-page);
  border-inline-start: 3px solid var(--color-accent-bounded);
  border-radius: var(--r-lg);
  padding: var(--space-6);
  display: grid;
  gap: var(--space-4);
  box-shadow: 0 24px 64px -16px rgba(14, 22, 20, 0.35);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--color-text-bounded);
  margin: 0;
}

.modal-section {
  display: grid;
  gap: var(--space-2);
}

.modal-section-title {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--color-text-heading);
  margin: 0;
}

.modal-section p,
.modal-section ul {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--color-text-body);
  margin: 0;
  padding-inline-start: var(--space-5);
}

.modal-section code {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  background: var(--color-bg-elevated);
  padding: 0 var(--space-1);
  border-radius: var(--r-sm);
  color: var(--color-primary-text);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: flex-end;
  margin-block-start: var(--space-2);
}

.modal-error {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  color: var(--red-500);
  margin: 0;
}

/* Verifier matrix — every field on its own row, never aggregated. */
.matrix-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-2);
  border-block-start: 1px solid var(--color-border-secondary);
  padding-block-start: var(--space-3);
}

.matrix-row {
  display: grid;
  grid-template-columns: 14ch minmax(0, 1fr);
  gap: var(--space-3);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.matrix-label {
  color: var(--color-text-muted);
  font-weight: 500;
}

.matrix-value {
  color: var(--color-text-heading);
  word-break: break-all;
}

.matrix-mono {
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

@media (max-width: 480px) {
  .proofs-hero {
    padding: var(--space-8) var(--space-4);
  }
  .modal-card {
    padding: var(--space-4);
  }
  .matrix-row {
    grid-template-columns: 1fr;
    gap: var(--space-1);
  }
  .proofs-builder,
  .proofs-intent-grid,
  .proofs-scope-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .proofs-preview {
    position: static;
  }
}

/* ---------------------------------------------------------------- */
/* §8.5 — the locus pulse, the signature motion.                    */
/*                                                                  */
/* Fires once when the user issues a proof: the beacon mark anchors */
/* the matrix head at icon-2xl (48px per §11.1) and its accent dot  */
/* scales 1.0 → 1.4 → 1.0 with a brightness lift over 300ms. The    */
/* ring does not move. animation-delay 120ms aligns with the §8.5   */
/* choreography window (the dot pulse runs 120–420ms; the dot       */
/* settles by 500ms). Reduced motion suppresses the keyframes;      */
/* the dot is drawn in its rest state on first paint.               */
/* ---------------------------------------------------------------- */

.matrix-beacon-anchor {
  display: grid;
  place-items: center;
  margin-block-end: var(--space-3);
  color: var(--color-text-heading);
}

.matrix-beacon-anchor svg {
  inline-size: 48px;
  block-size: 48px;
  display: block;
}

.matrix-beacon-anchor .beacon-dot {
  /* Transform-origin matches the dot's centre so the scale lift
   * stays anchored to the locus rather than drifting off-axis. */
  transform-origin: 12px 8.855px;
  transform-box: fill-box;
  animation: locus-pulse 300ms 120ms var(--ease-out) 1 forwards;
}

@keyframes locus-pulse {
  0%   { transform: scale(1.0); filter: brightness(1.0); }
  50%  { transform: scale(1.4); filter: brightness(1.15); }
  100% { transform: scale(1.0); filter: brightness(1.0); }
}

@media (prefers-reduced-motion: reduce) {
  .matrix-beacon-anchor .beacon-dot {
    animation: none;
  }
}

/* -------------------------------------------------------------------- */
/* Witness picker + M17 disclosure-preview gate (ADR-0007 §10).         */
/*                                                                      */
/* The picker is a checkbox list inside the compose-confirm preview     */
/* — one row per session-fake received attestation. The gate renders    */
/* below it only when at least one witness is ticked; it must remain    */
/* on-screen so the user reads what the verifier learns before issue.   */
/* -------------------------------------------------------------------- */

.witness-picker {
  display: grid;
  gap: var(--space-2);
}

.witness-picker-row {
  min-block-size: 44px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--r-md);
  background: var(--color-bg-proof-inset);
  cursor: pointer;
}

.witness-picker-row input[type="checkbox"] {
  inline-size: 18px;
  block-size: 18px;
  accent-color: var(--color-primary-accent);
}

.disclosure-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  border: 1px solid var(--color-border-secondary);
  border-radius: var(--r-full);
  background: var(--color-bg-surface);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0;
  text-transform: lowercase;
}

.m17-gate {
  /* Coral left border mirrors the witness-flow card chrome
   * convention in STYLE-GUIDE §2 — "bounded-actor moments are
   * layout and chrome changes, not palette swaps." */
  border-inline-start: 3px solid var(--color-accent-bounded);
  padding-inline-start: var(--space-4);
}

.m17-gate ul {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.m17-witness-row {
  display: grid;
  grid-template-columns: auto auto auto minmax(0, 1fr);
  gap: var(--space-2);
  align-items: baseline;
  padding: var(--space-2) 0;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--color-text-body);
}

.m17-witness-row strong {
  font-weight: 700;
  color: var(--color-text-heading);
}

.m17-witness-row code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.m17-warning {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border-inline-start: 2px solid var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 12%, transparent);
  color: var(--color-text-body);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.m17-warning-persona {
  border-inline-start-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
