/* Scoped to the new document template. Stored legacy documents keep their existing style. */
.html-preview:has(.consent-paper) { background: #fff; }
.html-preview .consent-paper {
  --paper-ink: #36474f;
  --paper-muted: #6c7477;
  --paper-accent: #724834;
  --paper-line: #e5ddd3;
  color: var(--paper-ink); background: #fff;
  font: 400 14px/1.7 "Segoe UI", Arial, sans-serif;
  text-align: left; letter-spacing: 0; overflow-wrap: anywhere;
  width: 100%; max-width: 860px; margin: 0 auto;
}
.html-preview .consent-paper * { box-sizing: border-box; }
.html-preview .consent-paper p { margin: 0 0 16px; text-align: left; font-size: inherit; line-height: inherit; }
.html-preview .consent-paper strong { font-weight: 600; }
.html-preview .consent-paper-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 0 0 24px; border-bottom: 1px solid var(--paper-line); }
.html-preview .consent-paper-brand { display: flex; align-items: center; gap: 12px; }
.html-preview .consent-paper-brand svg { width: 42px; height: 42px; flex-shrink: 0; fill: none; stroke: #baa07f; stroke-width: 1.4; stroke-linecap: round; }
.html-preview .consent-paper-brand strong { display: block; font-size: 14px; letter-spacing: .15em; font-weight: 600; color: var(--paper-ink); }
.html-preview .consent-paper-brand span { display: block; margin-top: 2px; color: var(--paper-muted); font-size: 9px; letter-spacing: .18em; }
.html-preview .consent-paper-tag { color: var(--paper-accent); font-size: 8px; font-weight: 600; letter-spacing: .1em; text-align: right; }
.html-preview .consent-paper-title { padding: 30px 0 22px; }
.html-preview .consent-paper .consent-paper-kicker { margin: 0 0 10px; font-size: 9px; font-weight: 600; letter-spacing: .15em; color: var(--paper-accent); }
.html-preview .consent-paper h1 { max-width: none; margin: 0 0 10px; color: var(--paper-ink); font: 600 clamp(24px, 2.8vw, 34px)/1.15 "Segoe UI", Arial, sans-serif; text-align: left; letter-spacing: -.035em; text-transform: none; }
.html-preview .consent-paper .consent-paper-subtitle { font-size: 14px; color: var(--paper-muted); max-width: 60ch; margin: 0; }
.html-preview .consent-client-card { padding: 20px 22px; margin: 26px 0; border: 1px solid var(--paper-line); border-radius: 12px; background: #faf8f4; break-inside: avoid; }
.html-preview .consent-paper .consent-section-heading { display: flex; align-items: baseline; gap: 10px; font: 600 15px/1.5 "Segoe UI", Arial, sans-serif; color: var(--paper-ink); letter-spacing: -.01em; margin: 0 0 17px; text-transform: none; break-after: avoid; }
.html-preview .consent-section-heading > span { flex-shrink: 0; font-size: 10px; letter-spacing: .04em; font-weight: 600; color: var(--paper-accent); padding-right: 9px; border-right: 1px solid #baa07f; }
.html-preview .consent-paper .consent-field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 15px 0 0; }
.html-preview .consent-paper .consent-field-grid-client { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.html-preview .consent-paper .consent-date-grid { padding-top: 15px; margin-top: 18px; border-top: 1px solid var(--paper-line); }
.html-preview .consent-paper .consent-field { display: flex; flex-direction: column; align-items: stretch; gap: 4px; min-height: 0; }
.html-preview .consent-paper .consent-field > span { font-size: 10px; color: var(--paper-muted); font-weight: 400; }
.html-preview .consent-paper .consent-field > strong { color: var(--paper-ink); font-size: 13px; font-weight: 600; line-height: 1.5; border: 0; padding: 0; min-height: 0; }
.html-preview .consent-paper-section { padding: 24px 0 0; margin: 24px 0 0; border-top: 1px solid var(--paper-line); }
.html-preview .consent-phototype-wrap { margin: 18px 0; max-width: 100%; }
.html-preview .consent-paper .consent-phototype-table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; border: 1px solid var(--paper-line); border-radius: 9px; overflow: hidden; font-size: 12px; line-height: 1.6; margin: 0; }
.html-preview .consent-paper .consent-phototype-table td { padding: 10px 12px; border: 0; border-bottom: 1px solid var(--paper-line); vertical-align: top; overflow-wrap: anywhere; }
.html-preview .consent-phototype-table thead td { background: #f3eee7; color: var(--paper-accent); font-size: 10px; }
.html-preview .consent-phototype-table td:first-child { width: 65px; white-space: nowrap; }
.html-preview .consent-phototype-table td:last-child { width: 36px; text-align: center; font-weight: 600; }
.html-preview .consent-phototype-table tbody tr:last-child td { border-bottom: 0; }
.html-preview .consent-phototype-table .is-selected-phototype td { background: #f2e9dc; color: #5d3b2b; font-weight: 600; }
.html-preview .consent-safety-note { margin: 22px 0 0; padding: 18px; border-left: 3px solid #baa07f; border-radius: 0 8px 8px 0; background: #faf8f4; font-size: 12px; }
.html-preview .consent-safety-note > p:last-child { margin-bottom: 0; }
.html-preview .consent-paper ol { margin: 0 0 0 20px; padding: 0; }
.html-preview .consent-paper li { margin: 0 0 12px; padding-left: 6px; text-align: left; line-height: 1.65; break-inside: avoid; }
.html-preview .consent-paper li::marker { color: var(--paper-accent); font-weight: 600; font-size: 11px; }
.html-preview .consent-paper .consent-service-line { display: flex; flex-direction: column; align-items: stretch; gap: 5px; padding: 14px 16px; margin: 18px 0 0; background: #faf8f4; border: 1px solid var(--paper-line); border-radius: 8px; }
.html-preview .consent-paper .consent-service-line > span { font-weight: 400; font-size: 10px; color: var(--paper-muted); }
.html-preview .consent-paper .consent-service-line > strong { border: 0; padding: 0; min-height: 0; font-weight: 600; font-size: 12px; }
.html-preview .consent-paper .inline-consent-check { display: flex; align-items: flex-start; gap: 10px; margin: 16px 0; padding: 14px 16px; border: 1px solid var(--paper-line); border-radius: 8px; background: #faf8f4; font-size: 12px; cursor: pointer; }
.html-preview .consent-paper .inline-consent-check:focus-visible { outline: 2px solid #724834; outline-offset: 3px; }
.html-preview .consent-paper .inline-consent-check-box { color: var(--paper-accent); font-size: 19px; line-height: 1.3; flex-shrink: 0; }
.html-preview .consent-paper-signoff { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--paper-line); break-inside: avoid; }
.html-preview .consent-paper .document-signature-area { display: grid; justify-items: center; width: min(340px, 100%); margin: 0 auto 24px; text-align: center; gap: 7px; }
.html-preview .consent-paper .signature-placeholder-line { min-height: 60px; border-bottom: 1px solid #879195; }
.html-preview .consent-paper .inline-document-signature { width: 100%; margin: 0; display: grid; justify-items: center; }
.html-preview .consent-paper .inline-document-signature img { display: block; width: 100%; max-width: 300px; height: 125px; max-height: 125px; object-fit: contain; object-position: center bottom; margin: 0 auto; }
.html-preview .consent-paper .live-signature-canvas { display: block; width: 100%; max-width: 300px; height: 125px; margin: 0 auto; }
.html-preview .consent-paper .inline-document-signature span { width: 100%; min-height: 5px; border-bottom: 1px solid #879195; }
.html-preview .consent-paper .document-signature-area strong { font-size: 12px; }
.html-preview .consent-paper .document-signature-area small { font-size: 10px; color: var(--paper-muted); }
.html-preview .consent-paper .consent-paper-footer { margin: 0; color: var(--paper-muted); font-size: 8px; letter-spacing: .17em; text-align: center; }
.html-preview .consent-paper-legacy > h1 { margin-top: 24px; font-size: 24px; }
.html-preview .consent-paper-legacy table { width: 100%; border-collapse: collapse; font-size: 12px; }
.html-preview .consent-paper-legacy :is(td, th) { padding: 10px 12px; border: 1px solid var(--paper-line); vertical-align: top; }
.html-preview .consent-paper-legacy thead { background: #faf8f4; }
.document-shell:has(.consent-paper) .document-observations-print { color: #36474f; font: 400 10pt/1.6 "Segoe UI", Arial, sans-serif; }
.document-shell:has(.consent-paper) .document-observations-print h2 { font: 600 15px/1.5 "Segoe UI", Arial, sans-serif; }
.document-shell:has(.consent-paper) .document-observations-print h3 { font: 600 12px/1.5 "Segoe UI", Arial, sans-serif; }
@media screen and (max-width: 600px) {
  .html-preview .consent-paper { font-size: 13px; line-height: 1.75; }
  .html-preview .consent-paper-header { gap: 10px; padding-bottom: 18px; }
  .html-preview .consent-paper-brand { gap: 8px; }
  .html-preview .consent-paper-brand svg { width: 30px; height: 30px; }
  .html-preview .consent-paper-brand strong { font-size: 11px; }
  .html-preview .consent-paper-tag { display: none; }
  .html-preview .consent-paper-title { padding-top: 23px; }
  .html-preview .consent-paper h1 { font-size: 26px; }
  .html-preview .consent-client-card { padding: 15px; }
  .html-preview .consent-paper .consent-field-grid-client { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .html-preview .consent-paper .consent-phototype-table td { padding: 8px 7px; font-size: 11px; }
  .html-preview .consent-phototype-table td:first-child { width: 48px; }
  .html-preview .consent-phototype-table td:last-child { width: 25px; }
  .html-preview .consent-safety-note { padding: 13px; }
}
@media print {
  .html-preview .consent-paper { font-size: 10pt; line-height: 1.5; max-width: none; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .html-preview .consent-paper-header { padding-bottom: 14px; }
  .html-preview .consent-paper-title { padding: 20px 0 15px; }
  .html-preview .consent-paper h1 { font-size: 25pt; }
  .html-preview .consent-client-card { padding: 14px 18px; margin: 20px 0; }
  .html-preview .consent-paper-section { margin-top: 18px; padding-top: 18px; }
  .html-preview .consent-paper li { margin-bottom: 9px; }
  .html-preview .consent-paper p { orphans: 3; widows: 3; }
  .html-preview .consent-phototype-table tr { break-inside: avoid; }
  .html-preview .consent-phototype-table thead { display: table-header-group; }
  .html-preview .consent-paper .inline-consent-check { cursor: default; }
}
