/* Family Forward Agreement Builder styles. Screen app + print document. */

.app-body { background: var(--paper); }

.app-shell {
  display: grid;
  grid-template-columns: 300px 1fr;
  max-width: var(--wide);
  margin: 0 auto;
  min-height: calc(100vh - 74px);
}
@media (max-width: 920px) { .app-shell { grid-template-columns: 1fr; } }

/* ---------- rail ---------- */

.rail {
  border-right: 1px solid var(--line);
  padding: 28px 20px 40px clamp(18px, 3vw, 34px);
  position: sticky;
  top: 74px;
  align-self: start;
  max-height: calc(100vh - 74px);
  overflow-y: auto;
}
@media (max-width: 920px) {
  .rail { position: static; max-height: none; border-right: none; border-bottom: 1px solid var(--line); }
  .rail nav { display: flex; overflow-x: auto; gap: 8px; padding-bottom: 8px; }
  .rail .rail-head { display: none; }
}
.rail-head { margin-bottom: 18px; }
.rail-head .eyebrow { margin-bottom: 6px; }
.rail-head p { font-size: 0.92rem; color: var(--ink-soft); }
.rail-progress {
  height: 7px; border-radius: 99px; background: rgba(46, 58, 92, 0.12);
  margin: 14px 0 20px; overflow: hidden;
}
.rail-progress span { display: block; height: 100%; width: 0; background: var(--teal); border-radius: 99px; transition: width 0.4s ease; }

.rail-link {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.94rem;
  font-weight: 520;
  color: var(--ink);
}
@media (max-width: 920px) { .rail-link { grid-template-columns: auto auto auto; white-space: nowrap; } }
.rail-link:hover { background: rgba(68, 84, 143, 0.08); }
.rail-link.active { background: var(--pine); color: var(--paper-on-pine); }
.rail-link.active .rl-num { color: var(--amber); }
.rl-num { font-family: var(--mono); font-weight: 500; font-size: 0.76rem; letter-spacing: 0.1em; color: var(--teal); }
.rl-state { width: 10px; height: 10px; border-radius: 50%; background: rgba(46, 58, 92, 0.15); }
.rl-state.some { background: var(--amber); }
.rl-state.done { background: var(--teal); }
.rail-link.active .rl-state.done { background: var(--amber-soft); }

/* ---------- workspace ---------- */

.workspace { padding: clamp(24px, 4vw, 52px); }

.ws-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 26px;
}
.ws-toolbar .spacer { flex: 1; }
.chip {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 7px 14px;
}
.chip.saved { color: var(--teal); border-color: var(--teal); }
.chip.warn { color: var(--amber-ink); border-color: var(--amber-ink); font-weight: 600; }
.btn-small {
  font-family: var(--sans); font-weight: 600; font-size: 0.86rem;
  padding: 9px 16px; border-radius: 99px; cursor: pointer;
  border: 1.5px solid var(--line); background: #FFFFFF; color: var(--teal);
}
.btn-small:hover { border-color: var(--teal); }
.btn-small.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-small.primary:hover { background: var(--teal-strong); }

.section-card {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 46px);
  box-shadow: 0 10px 30px -22px rgba(46, 58, 92, 0.35);
}
.sec-eyebrow { font-family: var(--mono); font-weight: 500; font-size: 0.84rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--teal); }
.section-card h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 8px 0 12px; }
.sec-intro { color: var(--ink-soft); margin-bottom: 30px; }

.field { margin-bottom: 30px; }
.field label { display: block; font-weight: 640; font-size: 1.04rem; margin-bottom: 6px; }
.field .help { font-size: 0.94rem; color: var(--ink-soft); margin-bottom: 10px; }
.field textarea, .field input[type="text"], .field input[type="date"] {
  width: 100%;
  font-family: var(--sans);
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  resize: vertical;
}
.field textarea { min-height: 110px; }
.field textarea:focus, .field input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(68, 84, 143, 0.14); }
.field details { margin-top: 8px; }
.field summary {
  cursor: pointer; list-style: none;
  font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--amber-ink);
}
.field summary::-webkit-details-marker { display: none; }
.field summary::before { content: "+ "; }
.field details[open] summary::before { content: "\2212 "; }
.example-text {
  margin-top: 8px;
  background: rgba(201, 115, 137, 0.1);
  border-left: 3px solid var(--amber);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 16px;
  font-size: 0.93rem;
  color: var(--ink-soft);
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } }

.ws-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 30px; }

.privacy-line { margin-top: 22px; font-size: 0.9rem; color: var(--ink-soft); text-align: center; }

/* ---------- print document ---------- */

.print-doc { display: none; }

@media print {
  @page { margin: 18mm 16mm; }
  body { background: #FFFFFF; font-size: 10.4pt; }
  .site-header, .app-shell, .site-footer { display: none !important; }
  .print-doc { display: block; font-family: var(--sans); color: #292E3F; }

  .pd-cover { text-align: center; padding-top: 40mm; page-break-after: always; }
  .pd-cover img { width: 34mm; height: 34mm; margin: 0 auto 10mm; }
  .pd-kicker { font-family: var(--mono); font-size: 8.5pt; letter-spacing: 0.22em; text-transform: uppercase; color: #44548F; }
  .pd-cover h1 { font-size: 27pt; font-weight: 650; letter-spacing: -0.015em; margin: 6mm 0 4mm; }
  .pd-cover .pd-for { font-size: 12.5pt; color: #4E5468; }
  .pd-cover .pd-photo { width: 62mm; height: 62mm; margin: 12mm auto 0; border: 1.5px dashed #9AA0B5; border-radius: 3mm; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 7.5pt; letter-spacing: 0.12em; text-transform: uppercase; color: #9AA0B5; padding: 6mm; }
  .pd-cover .pd-vow { margin-top: 14mm; font-size: 10.5pt; color: #4E5468; font-style: italic; }

  .pd-preamble { border: 1.5px solid #2E3A5C; border-radius: 3mm; padding: 4mm 5mm; font-size: 9.2pt; color: #4E5468; margin-bottom: 9mm; page-break-inside: avoid; }
  .pd-preamble strong { color: #292E3F; }

  .pd-section { page-break-inside: auto; margin-bottom: 9mm; }
  .pd-sec-head { border-bottom: 2.5px solid #2E3A5C; padding-bottom: 2.5mm; margin-bottom: 5mm; page-break-after: avoid; }
  .pd-sec-head .pd-kicker { color: #C97389; }
  .pd-sec-head h2 { font-size: 15.5pt; font-weight: 650; margin-top: 1mm; }
  .pd-sec-intro { font-size: 9.4pt; color: #4E5468; margin-bottom: 5mm; }

  .pd-field { margin-bottom: 5.5mm; page-break-inside: avoid; }
  .pd-field h3 { font-size: 10.6pt; font-weight: 650; margin-bottom: 1.6mm; }
  .pd-field .pd-answer { white-space: pre-wrap; border-left: 2.5px solid #C97389; padding: 1.5mm 0 1.5mm 4mm; }
  .pd-field .pd-blank { border-bottom: 1px solid #9AA0B5; height: 8mm; }
  .pd-field .pd-blank + .pd-blank { margin-top: 4mm; }

  .pd-sign { page-break-inside: avoid; margin-top: 12mm; }
  .pd-sign h2 { font-size: 15.5pt; font-weight: 650; border-bottom: 2.5px solid #2E3A5C; padding-bottom: 2.5mm; margin-bottom: 4mm; }
  .pd-sign .pd-oath { font-size: 10.2pt; color: #4E5468; margin-bottom: 8mm; }
  .pd-sig-row { display: grid; grid-template-columns: 2fr 1.4fr 1fr; gap: 8mm; margin-bottom: 10mm; }
  .pd-sig-cell .pd-line { border-bottom: 1px solid #292E3F; height: 9mm; }
  .pd-sig-cell .pd-cap { font-family: var(--mono); font-size: 7.5pt; letter-spacing: 0.12em; text-transform: uppercase; color: #4E5468; margin-top: 1.6mm; }
  .pd-footer { margin-top: 10mm; text-align: center; font-family: var(--mono); font-size: 8pt; letter-spacing: 0.16em; text-transform: uppercase; color: #44548F; }
}
