/* =========================================================================
   Shared contract styles — used by every brand.
   Brand colors are set from each brand's brand.js (colors: {...}).
   ========================================================================= */

:root {
  --accent: #6d28d9;
  --accent-ink: #4c1d95;
  --accent-soft: #f4f0ff;
  --accent-line: #d9ccfb;

  --ink: #18181d;
  --ink-2: #3b3b45;
  --muted: #6b6b78;
  --line: #d6d6de;
  --line-soft: #ececf1;
  --paper: #ffffff;
  --bg: #efeff3;
  --danger: #a4161a;
  --ok: #137a3a;
  --ok-soft: #eaf8ef;
  --ok-line: #9fdcb5;
  --warn: #8a5300;
  --warn-soft: #fff6e5;
  --warn-line: #f3cf8a;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --script: "Dancing Script", "Brush Script MT", "Segoe Script", cursive;

  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-ink); }

.page {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 16px 150px;
}

.paper {
  background: var(--paper);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(20, 20, 40, .06), 0 12px 40px rgba(20, 20, 40, .08);
  padding: clamp(20px, 5vw, 56px);
}
.paper.narrow { max-width: 620px; margin: 0 auto; }

/* ---------- Brand header ---------- */
.doc-head {
  text-align: center;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 2px solid var(--accent);
}
.brand-logo {
  display: block;
  width: 160px;
  height: 160px;
  object-fit: cover;
  margin: 0 auto 14px;
  border-radius: 18px;
  background: #000;
}
.brand-mark {
  width: 124px;
  height: 124px;
  margin: 0 auto 12px;
  border-radius: 14px;
  background: #0e0e13;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.brand-name {
  margin: 0;
  color: var(--accent);
  font-size: clamp(24px, 4.5vw, 32px);
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
  line-height: 1.15;
}
.doc-title {
  margin: 4px 0 0;
  color: var(--ink-2);
  font-style: italic;
  font-size: 15px;
}

.intro { color: var(--ink-2); margin: 0 0 6px; }
@media (min-width: 640px) {
  .paper:not(.doc) .intro, .term p { text-align: justify; }
}
.meta-line {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.meta-line b { color: var(--ink-2); font-weight: 600; }

/* ---------- Sections ---------- */
.sec { margin-top: 34px; }
.sec-title {
  margin: 0 0 14px;
  padding-bottom: 7px;
  border-bottom: 1.5px solid var(--accent);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.sec-sub { margin: -6px 0 14px; color: var(--muted); font-size: 14px; }

/* ---------- Form fields ---------- */
.field {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 8px 0;
  border-radius: 8px;
  transition: background-color .3s;
}
.field-label {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}
.field-label .req { color: var(--accent); margin-left: 2px; }
.field-label .opt { color: var(--muted); font-weight: 400; font-size: 12.5px; margin-left: 6px; }
.field-control { position: relative; min-width: 0; }

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="date"],
.field input[type="time"],
.field input[type="number"],
.field select,
.field textarea,
.money input {
  width: 100%;
  min-height: 44px;
  padding: 9px 4px;
  font-size: 16px; /* prevents iOS zoom */
  border: 0;
  border-bottom: 1.5px solid var(--line);
  border-radius: 0;
  background: transparent;
  outline: none;
  transition: border-color .15s, background-color .15s;
  -webkit-appearance: none;
  appearance: none;
}
.field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 52%, calc(100% - 9px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}
.field textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus, .money input:focus {
  border-bottom-color: var(--accent);
  background: var(--accent-soft);
}
.field input::placeholder, .field textarea::placeholder { color: #a3a3ae; }

.money { display: flex; align-items: center; }
.money > span {
  padding: 0 4px 0 2px;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1.5px solid var(--line);
  min-height: 44px;
  display: flex;
  align-items: center;
}
.money:focus-within > span { border-bottom-color: var(--accent); background: var(--accent-soft); }

.field-pair { display: grid; grid-template-columns: 1fr; gap: 0 24px; }

@media (min-width: 640px) {
  .field { grid-template-columns: 210px 1fr; align-items: center; gap: 12px; }
  .field.is-tall { align-items: start; }
  .field.is-tall .field-label { padding-top: 10px; }
  .field-pair { grid-template-columns: 1fr 1fr; }
  .field-pair .field { grid-template-columns: 110px 1fr; }
}

/* locked (set by the business) */
.field.is-locked .field-control {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 4px;
  border-bottom: 1.5px dotted var(--accent-line);
}
.locked-value { flex: 1; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.locked-value.is-empty { color: var(--muted); font-weight: 400; }
.lock-tag {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}
.lock-tag svg { width: 13px; height: 13px; }

/* services checklist */
.checks { display: grid; grid-template-columns: 1fr; gap: 6px 18px; padding: 4px 0; }
@media (min-width: 640px) { .checks { grid-template-columns: 1fr 1fr; } }
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  cursor: pointer;
}
.check:has(input:checked) { border-color: var(--accent-line); background: var(--accent-soft); }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; flex: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 0; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 600;
}
.chip svg { width: 14px; height: 14px; }

/* highlight for missing items */
.needs { background: #fff1f1 !important; box-shadow: 0 0 0 2px #f4b4b4; }

/* notes / callouts */
.note {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  font-size: 14px;
  line-height: 1.55;
}
.danger { color: var(--danger); }

/* ---------- Terms & initials ---------- */
.initials-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 14px 16px;
  margin-bottom: 8px;
  border-radius: 10px;
  background: #f7f7fa;
  border: 1px solid var(--line-soft);
}
.initials-box label { font-weight: 700; font-size: 14px; }
.initials-box input {
  width: 92px;
  min-height: 44px;
  padding: 6px 10px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .08em;
  text-align: center;
  text-transform: uppercase;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: #fff;
  outline: none;
}
.initials-box input:focus { border-color: var(--accent); }
.initials-box p { margin: 0; flex: 1 1 260px; font-size: 13.5px; color: var(--muted); }

.terms { list-style: none; margin: 0; padding: 0; }
.term {
  padding: 16px 8px 14px;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 8px;
  transition: background-color .3s;
}
.term p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.term p b:first-child { color: var(--ink); }
.term-init {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}
.init-btn {
  min-width: 108px;
  min-height: 44px;
  padding: 4px 14px;
  border: 1.5px dashed var(--accent);
  border-radius: 9px;
  background: #fff;
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background-color .15s, border-color .15s, transform .08s;
}
.init-btn:hover { background: var(--accent-soft); }
.init-btn:active { transform: scale(.97); }
.init-btn[aria-pressed="true"] {
  border-style: solid;
  border-color: var(--ok-line);
  background: var(--ok-soft);
  color: var(--ok);
}
.init-btn .ink { font-family: var(--script); font-size: 24px; line-height: 1; color: #10213f; font-weight: 700; }
.init-btn svg { width: 15px; height: 15px; }

/* ---------- Signature ---------- */
.consent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  margin: 16px 0 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #f7f7fa;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
}
.consent input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }

.sig-block { margin-top: 14px; }
.sig-tabs {
  display: inline-flex;
  padding: 3px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: #f0f0f4;
}
.sig-tabs button {
  min-height: 36px;
  padding: 4px 18px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.sig-tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

.sig-pad {
  position: relative;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  background: #fcfcfe;
  overflow: hidden;
}
.sig-pad canvas {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 1;
  touch-action: none;
  cursor: crosshair;
  position: relative;
  z-index: 2;
}
.sig-pad::after { /* signing line */
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 24%;
  border-bottom: 1.5px solid #c9c9d3;
  z-index: 1;
}
.sig-x {
  position: absolute;
  left: 3%;
  bottom: 25%;
  font-weight: 700;
  color: #a0a0ac;
  z-index: 1;
}
.sig-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a7a7b3;
  font-size: 14px;
  pointer-events: none;
  z-index: 1;
}
.sig-pad.has-ink .sig-hint { display: none; }
.sig-clear {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  min-height: 32px;
  padding: 2px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.sig-typed-wrap {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 120px;
  padding: 12px 6% 18px;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  background: #fcfcfe;
}
.sig-typed-wrap .sig-x { bottom: 22px; }
.sig-typed-preview {
  width: 100%;
  border-bottom: 1.5px solid #c9c9d3;
  font-family: var(--script);
  font-weight: 700;
  font-size: clamp(30px, 7vw, 44px);
  line-height: 1.25;
  color: #10213f;
  min-height: 1.3em;
  padding-left: 18px;
  overflow-wrap: anywhere;
}
.sig-typed-preview:empty::before { content: "Type your full name above"; font-family: var(--font); font-size: 14px; font-weight: 400; color: #a7a7b3; }
.sig-caption { margin-top: 8px; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; }
.sig-caption b { color: var(--ink-2); font-weight: 600; }

.company-sig {
  margin-top: 26px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: #fafafc;
  font-size: 14px;
  color: var(--muted);
}
.company-sig strong { color: var(--ink-2); }

.footer-line {
  margin: 34px 0 0;
  text-align: center;
  font-style: italic;
  font-size: 13.5px;
  color: var(--accent);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, opacity .15s;
}
.btn:hover { border-color: #b9b9c5; background: #fafafc; }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn-lg { min-height: 52px; padding: 12px 26px; font-size: 16px; }
.btn[disabled] { opacity: .6; cursor: progress; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent-ink); font-weight: 600; cursor: pointer; text-decoration: underline; }

/* ---------- Bottom dock (progress + submit) ---------- */
.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
.dock-in {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.steps { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; min-width: 0; }
.steps li button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
}
.steps li button .dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid #c4c4cf;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.steps li button .dot svg { width: 11px; height: 11px; display: none; }
.steps li.done button { color: var(--ok); border-color: var(--ok-line); background: var(--ok-soft); }
.steps li.done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.steps li.done .dot svg { display: block; }
.steps .count { font-weight: 500; font-variant-numeric: tabular-nums; }
.dock .btn-primary { white-space: nowrap; flex: none; }
@media (max-width: 520px) {
  .steps { gap: 4px; }
  .steps .label-long { display: none; }
  .steps li button { min-height: 34px; padding: 4px 8px 4px 5px; gap: 4px; font-size: 12.5px; }
  .steps li button .dot { width: 16px; height: 16px; }
  .dock .btn-primary { padding: 10px 14px; font-size: 15px; }
  .dock .btn-primary svg { display: none; }
}
@media (max-width: 380px) {
  .steps .count { display: none; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(10px);
  z-index: 40;
  max-width: min(92vw, 520px);
  padding: 12px 16px;
  border-radius: 10px;
  background: #1d1d24;
  color: #fff;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Status / admin cards ---------- */
.status {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px;
  margin-bottom: 16px;
  border-radius: 14px;
  border: 1px solid var(--ok-line);
  background: var(--ok-soft);
}
.status.warn { border-color: var(--warn-line); background: var(--warn-soft); }
.status.info { border-color: var(--accent-line); background: var(--accent-soft); }
.status-icon {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ok);
  color: #fff;
}
.status.warn .status-icon { background: #d48806; }
.status.info .status-icon { background: var(--accent); }
.status-icon svg { width: 18px; height: 18px; }
.status h2 { margin: 0 0 4px; font-size: 18px; line-height: 1.3; }
.status p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.status p + p { margin-top: 6px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; }

.admin-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: #16161c;
  color: #e9e9ef;
  font-size: 14px;
}
.admin-bar b { color: #fff; }
.admin-bar .pill { margin-left: auto; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #2b2b35; }
.admin-bar .pill.on { background: #134e2c; color: #b8f0cc; }
.admin-bar .pill.off { background: #5a3a06; color: #ffe0a3; }
.admin-bar .admin-home { flex-basis: 100%; color: #c9c9d4; font-size: 13px; text-decoration: none; }
.admin-bar .admin-home:hover { color: #fff; }
#hist-note svg { width: 14px; height: 14px; vertical-align: -2px; color: var(--ok); }

.prep-actions { margin-top: 30px; display: flex; justify-content: center; }
.result {
  margin-top: 24px;
  padding: 20px;
  border-radius: 14px;
  border: 1px solid var(--ok-line);
  background: var(--ok-soft);
  transition: opacity .2s;
}
.result.stale { opacity: .55; }
.result h3 { margin: 0 0 6px; font-size: 18px; }
.result p { margin: 0 0 12px; font-size: 14.5px; color: var(--ink-2); }
.link-row { display: flex; gap: 8px; margin-bottom: 12px; }
.link-row input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  color: var(--ink-2);
}
.share-row { display: flex; flex-wrap: wrap; gap: 8px; }
.small { font-size: 13px; color: var(--muted); }

.cs-panel {
  margin: 0 0 16px;
  padding: 20px;
  border-radius: 14px;
  border: 1px solid var(--accent-line);
  background: #fff;
}
.cs-panel h3 { margin: 0 0 4px; font-size: 17px; }
.cs-panel > p { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.cs-panel .field input { font-size: 16px; }

/* Record a payment (your copy only) */
.pay-grid { display: grid; grid-template-columns: 1fr; gap: 0 20px; }
@media (min-width: 640px) {
  .pay-grid { grid-template-columns: 1fr 1fr; }
  .pay-grid .field { grid-template-columns: 1fr; align-items: start; }
}
.pay-panel .consent { margin: 10px 0 0; }

.empty { text-align: center; padding: 10px 4px 4px; }
.empty h2 { margin: 0 0 10px; font-size: 22px; }
.empty p { color: var(--ink-2); margin: 0 auto 10px; max-width: 460px; }
.tiny-link { text-align: center; font-size: 12.5px; margin-top: 18px; }
.tiny-link a { color: var(--muted); }

/* =========================================================================
   Signed document (on screen, in print, and in the PDF)
   No viewport media queries here so the PDF lays out the same on any device.
   ========================================================================= */
.doc { color: var(--ink); font-size: 15px; line-height: 1.5; }
.doc--pdf { font-size: 11.5px; background: #fff; padding: 0; }
.doc--pdf .doc-head { padding-bottom: 12px; margin-bottom: 14px; }
.doc--pdf .brand-mark { width: 96px; height: 96px; }
.doc--pdf .brand-logo { width: 112px; height: 112px; border-radius: 12px; }
.doc--pdf .brand-name { font-size: 24px; }
.doc--pdf .doc-title { font-size: 12.5px; }
.doc--pdf .sec { margin-top: 18px; }
.doc--pdf .sec-title { font-size: 11px; margin-bottom: 8px; padding-bottom: 5px; }

.doc .intro { font-size: 1em; }
.doc-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  padding: 4px 0;
}
.doc-label { font-weight: 700; white-space: nowrap; }
.doc-value {
  flex: 1 1 160px;
  min-height: 1.5em;
  padding: 0 4px 1px;
  border-bottom: 1px solid #8d8d99;
  overflow-wrap: anywhere;
}
.doc-pair { display: flex; flex-wrap: wrap; gap: 0 24px; }
.doc-pair > .doc-row { flex: 1 1 220px; }
.doc-list { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 4px 0 2px; }
.doc-list span { white-space: nowrap; }
.doc-list span::before { content: "\2611\00a0"; color: var(--accent); }
.doc-notes { padding: 4px 0; white-space: pre-wrap; }
.doc .note { font-size: .93em; margin-top: 12px; }

.doc-term { padding: 7px 0 5px; }
.doc-term p { margin: 0; color: var(--ink-2); }
.doc--pdf .intro, .doc--pdf .doc-term p { text-align: justify; }
.doc-init {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 8px;
  margin-top: 2px;
  font-size: .86em;
  color: var(--muted);
}
.doc-init-mark {
  min-width: 70px;
  padding: 0 6px;
  border-bottom: 1px solid #8d8d99;
  text-align: center;
  font-family: var(--script);
  font-size: 1.55em;
  font-weight: 700;
  line-height: 1.1;
  color: #10213f;
}

.doc-sigs { display: flex; flex-wrap: wrap; gap: 20px 40px; margin-top: 18px; }
.doc-sig { flex: 1 1 250px; min-width: 0; }
.doc-sig-line {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-height: 62px;
  border-bottom: 1px solid #44444f;
}
.doc-sig-line > b { padding-bottom: 4px; }
.sig-img { display: block; height: 56px; width: auto; max-width: 100%; object-fit: contain; }
.doc--pdf .sig-img { height: 46px; }
.sig-typed {
  font-family: var(--script);
  font-weight: 700;
  font-size: 2em;
  line-height: 1.15;
  color: #10213f;
  padding-bottom: 2px;
}
.doc-sig-cap { margin-top: 4px; font-size: .82em; color: var(--muted); }
.doc-sig-cap b { color: var(--ink-2); font-weight: 600; }
.doc-pending { color: var(--muted); font-style: italic; font-size: .9em; padding-bottom: 6px; }

.doc-audit {
  margin-top: 22px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f6f6f9;
  border: 1px solid var(--line-soft);
  font-size: .8em;
  color: var(--muted);
  line-height: 1.5;
}
.doc-audit b { color: var(--ink-2); font-weight: 600; }

/* Payments recorded after signing */
.pay-table { width: 100%; border-collapse: collapse; }
.pay-table th, .pay-table td { padding: 6px 8px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.pay-table th { font-size: .82em; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.pay-table .num { text-align: right; white-space: nowrap; }
.pay-table tfoot td { border-bottom: 0; border-top: 1.5px solid #8d8d99; font-weight: 700; }
.pay-full { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; color: var(--ok); font-weight: 700; }
.pay-full svg { width: 18px; height: 18px; flex: none; }
.doc--pdf .pay-full svg { display: none; } /* the PDF renderer leaves it blank */
.doc-payments .doc-audit { margin-top: 14px; }

/* PAID IN FULL stamp at the top of the document (solid borders: the PDF renderer
   doesn't draw double borders) */
.paid-stamp-wrap { text-align: center; margin: -6px 0 16px; }
.paid-stamp {
  display: inline-block;
  padding: 3px;
  border: 3px solid var(--ok);
  border-radius: 8px;
  color: var(--ok);
  transform: rotate(-3deg);
}
.paid-stamp > span {
  display: block;
  padding: 6px 18px 5px;
  border: 1px solid var(--ok);
  border-radius: 5px;
  font-size: 1.45em;
  font-weight: 800;
  letter-spacing: .12em;
  line-height: 1.1;
}
.paid-stamp small { display: block; margin-top: 3px; font-size: .5em; font-weight: 700; letter-spacing: .08em; }

/* ---------- Print ---------- */
@media print {
  @page { size: letter; margin: 0.5in; }
  body { background: #fff; font-size: 12px; }
  .no-print, .dock, .toast { display: none !important; }
  .page { padding: 0; max-width: none; }
  .paper { box-shadow: none; border-radius: 0; padding: 0; }
  .doc { font-size: 11.5px; }
  .doc .intro, .doc-term p { text-align: justify; }
  .doc-term, .doc-row, .doc-sigs, .doc-sign-block, .note, .doc-audit, .doc-payments { break-inside: avoid; }
  .sec-title { break-after: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
