.ra-doc { position: relative; line-height: 1.6; }
.ra-doc p { margin: 8px 0; }
.ra-title { text-align: center; font-size: 1.2rem; letter-spacing: .08em; margin: 0 0 16px; }
.ra-and { text-align: center; font-weight: 700; }
.ra-clauses { padding-left: 1.4em; }
.ra-clauses li { margin: 6px 0; }
.ra-sigs { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 16px 0; break-inside: avoid; }
.ra-sig-line { border-bottom: 1px solid #1c1917; height: 40px; }
.ra-annex { margin-top: 32px; font-size: 1rem; break-before: page; }
.ra-line { border-bottom: 1px solid #a8a29e; height: 28px; }
.ra-blank { color: #a16207; }

/* Wizard: one form, three fieldsets. JS hides all but the current step. */
.ra-wizard { display: grid; gap: 16px; }
.ra-wizard [hidden] { display: none !important; }
.ra-wizard legend { font-size: 1.6rem; line-height: 1.15; margin-bottom: 4px; }
.ra-wizard fieldset { margin-bottom: 0; }
.ra-progress[hidden] ~ .ra-step + .ra-step { margin-top: 32px; }
.ra-progress { margin-bottom: 20px; scroll-margin-top: 88px; }
.ra-progress p { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
#ra-count { color: var(--accent-text); }
.ra-bars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ra-bars span { height: 6px; border-radius: 3px; background: var(--border); }
.ra-bars span.on { background: var(--accent); }
.ra-q { margin: 0 0 8px; font-size: 15px; font-weight: 700; }
.ra-words, #ra-ends { margin-top: -6px; }
.ra-words:empty, #ra-ends:empty { display: none; }
.ra-term label { min-height: 60px; }
.ra-term small { display: block; font-size: 12px; font-weight: 400; opacity: .8; }
.ra-inr { position: relative; display: grid; gap: 6px; }
.ra-inr::before { content: '₹'; position: absolute; left: 14px; top: 0; line-height: 50px; color: var(--muted); font-weight: 400; pointer-events: none; }
.ra-inr input { padding-left: 30px; }

/* Preview: tap-to-open row on phones, sticky column on wide screens. */
.ra-preview summary { display: flex; gap: 12px; align-items: center; list-style: none; cursor: pointer; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.ra-preview summary::-webkit-details-marker { display: none; }
.ra-preview summary > svg { color: var(--muted); transition: transform .15s; }
.ra-preview[open] summary { margin-bottom: 12px; }
.ra-preview[open] summary > svg { transform: rotate(90deg); }
.ra-peek { flex: 1; min-width: 0; }
.ra-peek strong, .ra-peek small { display: block; }
.ra-peek small { font-size: 13px; color: var(--muted); }
.ra-thumb { position: relative; overflow: hidden; flex-shrink: 0; width: 64px; height: 80px; padding: 7px; display: flex; flex-direction: column; gap: 4px; background: #fff; border: 1px solid var(--border); border-radius: 4px; }
.ra-thumb span { height: 3px; border-radius: 2px; background: #D9D5CC; }
.ra-thumb span:first-child { height: 4px; width: 70%; align-self: center; background: #16161D; }
.ra-thumb span:nth-child(4) { width: 80%; }
.ra-thumb span:nth-child(6) { width: 60%; }
.ra-thumb b { position: absolute; top: 34px; left: -6px; right: -6px; text-align: center; font-size: 11px; font-weight: 800; letter-spacing: .12em; color: var(--chili); transform: rotate(-24deg); }

.ra-bar { flex-direction: column; align-items: stretch; gap: 8px; margin: 0 -16px; }
.ra-bar > div { display: flex; gap: 10px; }
.ra-bar .btn.block { flex: 1; font-size: 17px; }
.ra-bar .hint { text-align: center; }

@media (min-width: 900px) {
  .ra-wizard { grid-template-columns: minmax(320px, 460px) minmax(0, 1fr); grid-template-areas: "main preview" "bar preview"; gap: 16px 28px; align-items: start; }
  .ra-main { grid-area: main; }
  .ra-bar { grid-area: bar; margin: 0; border: 1px solid var(--border); border-radius: var(--radius); }
  .ra-preview { grid-area: preview; position: sticky; top: 88px; max-height: calc(100vh - 104px); overflow: auto; }
  .ra-preview[open] summary { display: none; }
}

/* Saved agreement page */
.ra-status { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.ra-status .note { flex: 1 1 100%; font-size: 15px; }
.ra-guide { margin-bottom: 20px; }
.ra-guide h2 { margin: 0 0 8px; font-size: 1.2rem; }
.ra-guide p { margin: 0 0 8px; color: var(--muted); }

/* DRAFT watermark: on screen and on paper. */
.ra-draft::after {
  content: 'DRAFT'; position: absolute; top: 30%; left: 50%; transform: translate(-50%, -50%) rotate(-30deg);
  font-size: clamp(64px, 18vw, 160px); font-weight: 800; letter-spacing: .1em; color: rgba(220, 38, 38, .15);
  pointer-events: none; white-space: nowrap;
}
@media print {
  .ra-draft::after { position: fixed; top: 50%; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ra-blank { color: inherit; }
}
