/* Cursive fonts for typed signatures (self-hosted, SIL OFL 1.1, see fonts/LICENSE.md). */
@font-face { font-family: "Great Vibes"; src: url("/fonts/great-vibes-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Mrs Saint Delafield"; src: url("/fonts/mrs-saint-delafield-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

/* DMO Business Tools: Signatures (sender screens and the signer page).
   Builds on styles.css tokens. Kept separate so the PDF tools and
   signatures workstreams do not edit the same stylesheet. */

input[type="email"], textarea {
  width: 100%; font: inherit; min-height: 48px; padding: 10px 14px;
  border: 1.5px solid #9d94ad; border-radius: 10px; background: #fff; color: var(--ink);
}
textarea { min-height: 6rem; resize: vertical; }
input[type="email"]:focus-visible, textarea:focus-visible { border-color: var(--brand); }

/* Signer colours: each signer's fields share one colour (always with a text label too). */
.sg-c0 { --sg: #542f9c; --sg-bg: rgba(84, 47, 156, 0.12); }
.sg-c1 { --sg: #1d6b57; --sg-bg: rgba(29, 107, 87, 0.13); }
.sg-c2 { --sg: #a1440f; --sg-bg: rgba(161, 68, 15, 0.12); }
.sg-c3 { --sg: #1d4e78; --sg-bg: rgba(29, 78, 120, 0.12); }
.sg-c4 { --sg: #8a1f5c; --sg-bg: rgba(138, 31, 92, 0.12); }
.sg-dot { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 50%; background: var(--sg, var(--brand)); flex: none; }

/* Dashboard */
.chip-btn[aria-current="page"] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-deep); font-weight: 650; }
.chips a.chip-btn { text-decoration: none; }
.sg-hero h1 { margin-bottom: 0.5rem; }
.sg-section h2 { font-size: 1.5rem; }
.sg-count { font-family: var(--font-text); font-size: 1rem; color: var(--muted); }
.sg-list { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.sg-row { display: flex; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.9rem 1.1rem; border-top: 1px solid var(--line); flex-wrap: wrap; }
.sg-row:first-child { border-top: 0; }
.sg-row-main { min-width: 0; flex: 1 1 18rem; }
.sg-row-title { font-weight: 650; overflow-wrap: anywhere; display: block; }
.sg-row-sub, .sg-row-date { color: var(--muted); font-size: 0.9rem; overflow-wrap: anywhere; }
.sg-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 0.25rem; }

/* Steps */
.sg-steps ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; padding: 0; margin: 0.5rem 0 1rem; }
.sg-step a, .sg-step > span { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 44px; color: var(--muted); text-decoration: none; font-weight: 600; }
.sg-step a { color: var(--brand); }
.sg-step-n { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; border: 1.5px solid currentColor; font-size: 0.85rem; }
.sg-step.is-current > span { color: var(--ink); }
.sg-step.is-current .sg-step-n { background: var(--brand); border-color: var(--brand); color: #fff; }
.sg-step.is-done .sg-step-n { background: var(--good-bg); border-color: var(--good); color: var(--good); }
.sg-step-h { margin-top: 1rem; }
.sg-title { overflow-wrap: anywhere; }
.sg-title-row { display: flex; align-items: center; gap: 0.5rem 1rem; flex-wrap: wrap; }
.sg-title-row h1 { margin-bottom: 0.4rem; }
.sg-docline { margin-top: -0.4rem; overflow-wrap: anywhere; }
.sg-save { color: var(--muted); font-size: 0.92rem; min-height: 1.5em; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.sg-status { font-weight: 600; min-height: 1.5em; }
.sg-nav-actions { margin-top: 2rem; }
.sg-discard { margin: 2.5rem 0 1rem; }
.sg-bad { color: var(--bad); font-weight: 600; }

/* Choose a document */
.sg-drop { text-align: center; }
.sg-drop-title { font-size: 1.5rem; margin: 0 0 0.5rem; }
.sg-details { margin: 1.25rem 0; }
.sg-details summary { cursor: pointer; font-weight: 650; min-height: 44px; display: flex; align-items: center; }
.sg-doc-list { list-style: none; padding: 0; margin: 0.75rem 0 0; display: grid; gap: 0.4rem; }
.sg-doc-btn { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 0.1rem; padding: 0.7rem 1rem; min-height: 48px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font: inherit; color: var(--ink); cursor: pointer; }
.sg-doc-btn:hover { border-color: var(--brand-line); background: var(--brand-soft); }
.sg-doc-name { font-weight: 650; overflow-wrap: anywhere; }

/* Signers */
.sg-signers { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.sg-signer { box-shadow: inset 6px 0 0 var(--sg); }
.sg-signer-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; }
.sg-signer-head h3 { margin: 0; flex: 1; }
.sg-signer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem 1rem; }
.sg-signer-grid .field + .field { margin-top: 0; }

/* Field editor */
.sg-editor { display: grid; grid-template-columns: 18.5rem minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.sg-side { position: sticky; top: 0.75rem; display: grid; gap: 0.9rem; max-height: calc(100vh - 1.5rem); overflow: auto; padding-bottom: 0.5rem; }
.sg-toolbar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 0.9rem; box-shadow: inset 0 5px 0 var(--sg); }
.sg-add-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem; margin-top: 0.75rem; }
.sg-add { min-height: 44px; border-radius: var(--radius); border: 1.5px solid var(--sg); background: var(--sg-bg); color: var(--ink); font: inherit; font-weight: 650; font-size: 0.92rem; cursor: pointer; padding: 0.3rem 0.5rem; }
.sg-add:hover { background: #fff; }
.sg-panel-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 0.9rem; }
.sg-panel-title { margin-bottom: 0.6rem; }
.sg-panel-actions { margin: 0.8rem 0 0; gap: 0.4rem; }
.sg-counts { margin: 0; font-size: 0.92rem; }
.sg-field-list { list-style: none; padding: 0; margin: 0.5rem 0 0; display: grid; gap: 0.2rem; font-size: 0.92rem; }
.sg-list-btn { background: none; border: 0; padding: 0.35rem 0; min-height: 36px; font: inherit; color: var(--brand); text-align: left; text-decoration: underline; cursor: pointer; }

.sg-pages { display: grid; gap: 1.25rem; min-width: 0; }
.sg-page-label { margin: 0 0 0.3rem; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.sg-page { position: relative; width: 100%; background: #fff; box-shadow: 0 0 0 1px var(--line), var(--shadow-card); border-radius: 4px; overflow: hidden; user-select: none; -webkit-user-select: none; }
.sg-page img { display: block; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.sg-layer { position: absolute; inset: 0; }
.sg-field {
  position: absolute; box-sizing: border-box; margin: 0; padding: 0 3px;
  border: 2px dashed var(--sg); background: var(--sg-bg); color: var(--sg);
  border-radius: 4px; font: 700 clamp(9px, 1.1vw, 13px)/1.1 var(--font-text); text-align: left;
  display: flex; align-items: center; overflow: hidden; cursor: grab; touch-action: none;
}
.sg-field.is-optional { border-style: dotted; }
.sg-field.is-selected { border-style: solid; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--sg); z-index: 2; }
.sg-field:active { cursor: grabbing; }
.sg-field-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.sg-handle { position: absolute; right: -2px; bottom: -2px; width: 16px; height: 16px; background: var(--sg); border-radius: 3px 0 3px 0; cursor: nwse-resize; }
.sg-handle::after { content: ""; position: absolute; inset: -10px; } /* bigger touch target */

/* Review */
.sg-review { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.sg-review-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.sg-review-list li { display: flex; gap: 0.6rem; align-items: baseline; overflow-wrap: anywhere; }

/* Sender's confirmation of authority (required before sending) */
.sg-authority { margin-top: 1rem; border-left: 4px solid var(--brand); }
.sg-authority h3 { margin: 0; }
.sg-authority-list { margin: 0; padding-left: 1.4rem; display: grid; gap: 0.45rem; }
.sg-authority-agree { font-weight: 650; }
.sg-auth-sig { min-height: 2.2rem; margin: 0.4rem 0 0; padding: 0 0.2rem 0.1rem; border-bottom: 1.5px solid var(--line-strong);
  font-family: var(--font-display); font-style: italic; font-size: 1.5rem; color: var(--brand-deep); overflow-wrap: anywhere; }

/* Activity */
.sg-done .actions { margin: 0.8rem 0; }
.sg-recs { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 1rem; }
.sg-rec p { margin: 0.25rem 0; }
.sg-rec-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.sg-rec-email { overflow-wrap: anywhere; }
.sg-rec-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.6rem; }
.sg-edit-rec { margin-top: 0.6rem; }
.sg-timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.sg-timeline li { display: grid; grid-template-columns: 12rem 1fr; gap: 0.25rem 1rem; padding: 0.45rem 0 0.45rem 1rem; position: relative; }
.sg-timeline li::before { content: ""; position: absolute; left: -6px; top: 0.9rem; width: 10px; height: 10px; border-radius: 50%; background: var(--brand-line); }
.sg-timeline time { color: var(--muted); font-size: 0.9rem; }
.sg-hashes code, .sg-verify code { font-size: 0.8rem; overflow-wrap: anywhere; word-break: break-all; }
.sg-outbox { list-style: none; padding: 0; display: grid; gap: 1rem; }
.sg-mail { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.85rem; background: var(--surface-2); padding: 0.75rem; border-radius: var(--radius-sm); }

@media (max-width: 900px) {
  /* Phones and small tablets: only the "add a field" bar stays at the top;
     the selected field's settings open as a small sheet at the bottom. */
  .sg-editor { display: block; }
  .sg-side { display: contents; }
  .sg-toolbar { position: sticky; top: 0; z-index: 6; padding: 0.6rem; margin-bottom: 0.75rem; }
  .sg-add-row { display: flex; overflow-x: auto; gap: 0.4rem; padding-bottom: 0.25rem; }
  .sg-add { flex: none; padding: 0.3rem 0.8rem; }
  .sg-panel:has(.sg-panel-card) { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom)); background: var(--bg); box-shadow: 0 -8px 24px -12px rgba(31, 22, 64, 0.35); }
  .sg-panel .sg-panel-card .field { display: flex; align-items: center; gap: 0.5rem; }
  .sg-panel .sg-panel-card .field .label { margin: 0; }
  .sg-panel .sg-panel-card .check { min-height: 40px; }
  .sg-panel-actions { margin-top: 0.4rem; }
  .sg-pages { padding-bottom: 15rem; }
  .sg-review { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  /* The "Signatures" link makes five in the main nav: let it wrap to two rows on phones. */
  .main-nav { flex-wrap: wrap; border-radius: var(--radius-lg); }
  .main-nav a { flex: 1 1 28%; }
  .sg-signer-grid { grid-template-columns: 1fr; }
  .sg-row-side { align-items: flex-start; }
  .sg-timeline li { grid-template-columns: 1fr; }
  .sg-who { display: flex; align-items: center; gap: 0.5rem; }
  .sg-who .label { margin: 0; white-space: nowrap; }
  .sg-who select { min-height: 44px; }
  .sg-panel-card { padding: 0.7rem; }
  .sg-field { font-size: 9px; }
}

/* ---------------- Signer page ---------------- */
.sgn-body { background: var(--bg); }
.sgn-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.sgn-header-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 56px; flex-wrap: wrap; }
.sgn-brand { font-family: var(--font-display); font-size: 1.3rem; color: var(--brand-deep); }
.sgn-brand span { font-family: var(--font-text); font-size: 0.85rem; color: var(--muted); }
.sgn-secure { font-size: 0.88rem; color: var(--muted); overflow-wrap: anywhere; }
main.sgn-main { padding-bottom: 9rem; max-width: 60rem; }
.sgn-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.5rem; margin: 1.5rem 0; box-shadow: var(--shadow-card); }
.sgn-card h1 { margin-top: 0.25rem; font-size: clamp(1.7rem, 2.5vw + 1rem, 2.4rem); overflow-wrap: anywhere; }
.sgn-eyebrow { font-weight: 650; color: var(--brand); margin: 0; overflow-wrap: anywhere; }
.sgn-quote { margin: 1rem 0; padding: 0.75rem 1rem; border-left: 4px solid var(--brand-line); background: var(--surface-2); border-radius: 0 var(--radius) var(--radius) 0; overflow-wrap: anywhere; white-space: pre-line; }
.sgn-quote p { margin: 0; }
.sgn-facts { padding-left: 1.2rem; margin: 1rem 0; }
.sgn-wide { width: 100%; max-width: 26rem; }
.sgn-decline-line { text-align: center; margin: 1.5rem 0; }
.sgn-doc-head { margin: 1.25rem 0 0.75rem; }
.sgn-doc-title { font-size: clamp(1.4rem, 2vw + 1rem, 2rem); margin: 0 0 0.3rem; overflow-wrap: anywhere; }
.sgn-pages { display: grid; gap: 1rem; }
.sgn-page { user-select: auto; }
.sgn-field {
  position: absolute; box-sizing: border-box; margin: 0; padding: 0 3px; cursor: pointer;
  border: 2px solid #c98a00; background: rgba(255, 216, 77, 0.45); color: #3a2a00; border-radius: 3px;
  font: 700 clamp(8px, 1.6vw, 14px)/1.1 var(--font-text); display: flex; align-items: center; justify-content: flex-start; overflow: visible;
  touch-action: manipulation;
}
.sgn-field::before { content: ""; position: absolute; inset: -8px; } /* a finger-sized target around small fields */
.sgn-field.is-required:not(.is-done) { animation: sgn-pulse 2.4s ease-in-out infinite; }
.sgn-field.is-done { background: rgba(227, 242, 231, 0.55); border-color: var(--good); color: var(--ink); }
.sgn-field.sgn-t-date_signed::before { content: none; }
.sgn-field.sgn-t-date_signed { background: rgba(238, 232, 251, 0.6); border: 1.5px dashed var(--brand-line); color: var(--muted); cursor: default; }
.sgn-field img { max-width: 100%; max-height: 100%; object-fit: contain; object-position: left center; }
.sgn-field.sgn-t-checkbox { justify-content: center; padding: 0; }
.sgn-check { font-size: clamp(10px, 2vw, 18px); line-height: 1; color: var(--good); }
.sgn-ftext { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sgn-value { font-weight: 500; color: var(--ink); }
.sgn-auto { font-weight: 500; font-size: 0.85em; }
.sgn-field.is-flash { outline: 4px solid var(--focus); outline-offset: 3px; }
@keyframes sgn-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(201, 138, 0, 0.0); } 50% { box-shadow: 0 0 0 5px rgba(201, 138, 0, 0.28); } }

.sgn-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px -16px rgba(31, 22, 64, 0.35); padding: 0.6rem 0 calc(0.6rem + env(safe-area-inset-bottom)); }
.sgn-bar-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; flex-wrap: wrap; max-width: 60rem; }
.sgn-bar-text { margin: 0; font-weight: 650; }
.sgn-bar-actions { display: flex; gap: 0.5rem; }
.sgn-bar-btn { min-height: 48px; }

.sgn-dialog { border: 0; border-radius: var(--radius-lg); padding: 0; width: min(38rem, calc(100vw - 1.5rem)); max-height: calc(100vh - 1.5rem); box-shadow: var(--shadow-lift); color: var(--ink); }
.sgn-dialog::backdrop { background: rgba(31, 22, 64, 0.45); }
.sgn-dialog-inner { padding: 1.25rem 1.25rem 0.5rem; }
.sgn-dialog-title { margin: 0 0 1rem; font-size: 1.5rem; }
.sgn-tabs { display: flex; gap: 4px; padding: 4px; margin: 0 0 1rem; border: 1px solid var(--line); border-radius: var(--radius-pill); width: fit-content; max-width: 100%; }
.sgn-tab { position: relative; }
.sgn-tab input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.sgn-tab span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 1.1rem; border-radius: var(--radius-pill); font-weight: 650; }
.sgn-tab input:checked + span { background: var(--brand); color: #fff; }
.sgn-tab input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.sgn-styles { border: 0; padding: 0; margin: 1rem 0 0; display: grid; gap: 0.5rem; }
.sgn-style { display: flex; align-items: center; gap: 0.75rem; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 0.4rem 0.9rem; min-height: 64px; cursor: pointer; overflow: hidden; }
.sgn-style input { width: 1.2rem; height: 1.2rem; accent-color: var(--brand); flex: none; }
.sgn-style:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.sgn-style-sample { font-size: 2rem; color: #10204a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sgn-style-vibes { font-family: "Great Vibes", cursive; font-size: 2.3rem; }
.sgn-style-delafield { font-family: "Mrs Saint Delafield", cursive; font-size: 3rem; line-height: 1.3; }
.sgn-style-flow { font-family: "Fraunces", Georgia, serif; font-style: italic; }
.sgn-style-classic { font-family: Georgia, "Times New Roman", serif; font-style: italic; }
.sgn-style-plain { font-family: var(--font-text); font-weight: 500; }
.sgn-canvas { display: block; width: 100%; border: 1.5px dashed #9d94ad; border-radius: var(--radius); background: #fff; touch-action: none; cursor: crosshair; }
.sgn-up-preview { max-width: 100%; max-height: 120px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-top: 0.5rem; background: #fff; }
.sgn-consent { padding-left: 1.2rem; margin: 1rem 0; }
.sgn-consent li { margin: 0.3rem 0; }
.sgn-agree { margin: 1rem 0 0.25rem; font-weight: 650; }
.sgn-status { font-weight: 600; }
.sgn-message h1 { margin-top: 0; }
.sgn-done h1 { color: var(--good); }

@media (max-width: 640px) {
  .sgn-card { padding: 1.1rem; margin: 1rem 0; }
  .sgn-bar-row { flex-direction: column; align-items: stretch; gap: 0.4rem; }
  .sgn-bar-text { text-align: center; }
  .sgn-bar-actions .btn { flex: 1; }
  .sgn-dialog-inner { padding: 1rem 1rem 0.25rem; }
  .sgn-style-sample { font-size: 1.6rem; }
  main.sgn-main { padding-bottom: 12rem; }
}
@media (prefers-reduced-motion: reduce) {
  .sgn-field.is-required:not(.is-done) { animation: none; }
}
.sgn-styles legend { font-family: var(--font-text); font-size: 1rem; font-weight: 650; padding: 0; }
.sgn-inline-decline { min-height: 44px; padding-left: 0; }
/* Fields scrolled or tabbed into view stay clear of the fixed progress bar. */
html:has(body.sgn-body) { scroll-padding-bottom: 7.5rem; scroll-padding-top: 1rem; }
@media (max-width: 640px) { html:has(body.sgn-body) { scroll-padding-bottom: 10rem; } }

/* Signer page: security code from the email instead of the link */
.sgn-code-form { display: grid; gap: 8px; max-width: 520px; margin-top: 16px; }
.sgn-code-form label { font-weight: 600; }
.sgn-code-input { font: 15px/1.4 ui-monospace, Consolas, Menlo, monospace; padding: 12px; border: 1px solid var(--line, #c9c3d9); border-radius: 8px; width: 100%; box-sizing: border-box; }
.sgn-code-err { color: var(--danger, #a4262c); margin: 0; }
.sgn-code-form .btn { justify-self: start; margin-top: 6px; }

/* Development outbox: rendered email preview */
.sg-mail-preview { margin: 8px 0 12px; }
.sg-mail-preview summary { cursor: pointer; color: var(--brand, #542f9c); font-weight: 600; }
.sg-mail-preview iframe { display: block; width: 100%; height: 720px; border: 1px solid var(--line, #ddd6ea); border-radius: 8px; margin-top: 8px; background: #fff; }

/* Signing order */
.sg-order { border: 1px solid var(--line, #ddd6ea); border-radius: 12px; padding: 12px 16px 14px; margin: 18px 0 0; display: grid; gap: 10px; }
.sg-order legend { padding: 0 6px; }
.sg-order-opt { align-items: flex-start; }
.sg-when { font-weight: 400; font-size: 0.85em; }
.sg-signer-head .btn-quiet + .btn-quiet { margin-left: 0; }
.sg-signer-head { flex-wrap: wrap; }

/* Automatic reminders */
.sg-reminders { display: grid; gap: 6px; }
.sg-rem-box { border-top: 1px solid var(--line, #ddd6ea); margin-top: 12px; padding-top: 12px; }

/* Templates */
.sg-tpl-list { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.sg-tpl-name { font-size: 1.1rem; margin: 0 0 4px; overflow-wrap: anywhere; }
.sg-tpl p { margin: 4px 0; }
.sg-tpl-roles { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 10px; }
.sg-tpl-role { border-left: 3px solid var(--brand-line, #c9bceb); padding-left: 12px; }
.sg-tpl-save { margin-top: 20px; }

/* Signer header and the "after signing" actions */
a.sgn-brand { text-decoration: none; }
a.sgn-brand:hover, a.sgn-brand:focus-visible { text-decoration: underline; }
.sgn-header-right { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.sgn-after { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.sgn-after:empty, .sgn-message .sgn-after:not(:has(a:not([hidden]))) { display: none; }

/* Saved signature (signer) */
.sgn-saved { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; background: var(--surface); }
.sgn-saved h3 { margin: 0 0 8px; font-size: 1rem; }
.sgn-saved-img { display: block; max-width: 100%; max-height: 110px; background: #fff; border-radius: 6px; margin-bottom: 8px; }
.sgn-or { margin: 10px 0 0; }
.sgn-remember { margin-top: 10px; }
.sgn-remember p { margin: 2px 0 0 1.75rem; }

/* A fillable form arrives as a flat copy: what happened, and its empty boxes as fields. */
.sg-form-notice .notice p { margin: 0 0 0.5rem; }
.sg-boxes-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.sg-boxes-actions .label { margin: 0; }
.sg-boxes-actions select { min-height: 44px; max-width: 100%; }

/* Phones (2026-10-01 audit) */
.sgn-style[hidden], .sgn-styles p[hidden] { display: none; }
.sgn-check-big { font-size: 1.1rem; }
.sgn-check-big input { width: 1.75rem; height: 1.75rem; flex: none; }
/* Type / Draw / Upload share the width on narrow screens instead of running off the edge. */
@media (max-width: 400px) {
  .sgn-tabs { width: 100%; }
  .sgn-tab { flex: 1 1 0; min-width: 0; }
  .sgn-tab span { justify-content: center; width: 100%; padding: 0 0.5rem; }
}
/* Landscape phones: a slimmer progress bar leaves more of the document on screen. */
@media (max-height: 500px) and (orientation: landscape) {
  .sgn-bar { padding: 0.35rem 0 calc(0.35rem + env(safe-area-inset-bottom)); }
  .sgn-bar-row { flex-direction: row; align-items: center; }
  .sgn-bar-btn { min-height: 44px; }
  .sgn-header-row { min-height: 44px; }
  html:has(body.sgn-body) { scroll-padding-bottom: 5rem; }
  main.sgn-main { padding-bottom: 5rem; }
  .sgn-dialog { max-height: calc(100vh - 0.75rem); }
  .sgn-dialog-inner { padding-top: 0.75rem; }
  .sgn-dialog-title { margin-bottom: 0.5rem; font-size: 1.25rem; }
}

/* ---------- home: "Midnight glow" (owner pick 2026-11-13, design canvas board 4 option 2) ---------- */
.hm { --mg-bg: #15111f; --mg-ink: #f4f0fb; --mg-muted: #b4abc8; --mg-box: #2a2240; --mg-line: #2e2645; --mg-gold: #f0b400;
  --mg-glow: radial-gradient(120% 90% at 100% 0%, rgba(124, 82, 214, 0.55) 0%, rgba(124, 82, 214, 0) 55%);
  display: flex; flex-direction: column; gap: 1.75rem; }
.hm-card { position: relative; overflow: hidden; background: var(--mg-bg); color: var(--mg-ink); border: 1px solid var(--mg-line); border-radius: 28px; --focus: #f0b400; }
.hm-glow::before { content: ""; position: absolute; inset: 0; background: var(--mg-glow); pointer-events: none; transition: opacity .35s ease; }
.hm-glow > * { position: relative; }
.hm-card a, .hm-card .hm-link { color: var(--mg-ink); }
.hm-card :focus-visible { outline-color: #f0b400; }
.hm-muted { color: var(--mg-muted); margin: 0; }

.hm-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1.5rem; align-items: stretch; }
.hm-hello { display: flex; flex-direction: column; justify-content: center; gap: 0.5rem; }
.hm-eyebrow { margin: 0; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brand); }
.hm-h1 { margin: 0; font-size: 1rem; font-family: var(--font-text); font-weight: 700; letter-spacing: 0.04em; color: var(--muted); }
.hm-greet { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: clamp(2.1rem, 4vw, 3.2rem); line-height: 1.05; letter-spacing: -0.02em; color: var(--ink); }
.hm-greet-sub { display: block; color: var(--muted); font-size: 0.62em; line-height: 1.25; margin-top: 0.4rem; letter-spacing: -0.01em; }
.hm-hello .actions { margin-top: 1rem; }

.hm-drop { display: flex; flex-direction: column; justify-content: space-between; gap: 1.75rem; min-height: 15rem; padding: 1.75rem; transition: transform .2s ease, box-shadow .2s ease; }
.hm-drop:hover, .hm-drop.is-dragging { transform: translateY(-2px); box-shadow: 0 24px 48px -24px rgba(21, 17, 31, 0.7); }
.hm-drop.is-dragging { border: 1.5px dashed #c9b6f5; }
.hm-drop.is-dragging::before { opacity: 1.6; background: radial-gradient(140% 120% at 100% 0%, rgba(124, 82, 214, 0.8) 0%, rgba(124, 82, 214, 0) 60%); }
.hm-drop-top { display: flex; justify-content: space-between; align-items: flex-start; }
.hm-icon-box { width: 56px; height: 56px; border-radius: 16px; background: var(--mg-box); color: #e6dcff; display: grid; place-items: center; }
.hm-drop-title { margin: 0 0 0.4rem; font-family: var(--font-display); font-size: 1.75rem; line-height: 1.12; }
.hm-link { text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.hm-drop-status { margin: 0; color: var(--mg-gold); font-weight: 600; min-height: 1.2em; }
.hm-drop-status:empty { display: none; }

.hm-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; }
@media (max-width: 560px) { .hm-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; } .hm-tile { padding: 1rem; } .hm-tile-value { font-size: 2.1rem; } }
.hm-tile { display: flex; flex-direction: column; gap: 0.6rem; padding: 1.25rem; border-radius: 22px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-card); color: var(--ink); text-decoration: none; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.hm-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); color: var(--ink); }
.hm-tile.is-on { border: 2px solid var(--brand); }
.hm-tile-top { display: flex; justify-content: space-between; align-items: center; }
.hm-tile-label { font-size: 0.9rem; font-weight: 650; color: var(--muted); }
.hm-tile-value { font-family: var(--font-display); font-size: 2.6rem; font-weight: 500; line-height: 1; letter-spacing: -0.02em; }
.hm-tile-note { font-size: 0.85rem; color: var(--muted); }
.hm-dot { width: 10px; height: 10px; border-radius: 50%; }
.hm-bars { display: flex; align-items: flex-end; gap: 4px; height: 28px; }
.hm-bar { flex: 1; border-radius: 3px; transform-origin: bottom; animation: hm-rise .7s cubic-bezier(.2, .7, .2, 1) both; }
.hm-bar:nth-child(2n) { animation-delay: .05s; } .hm-bar:nth-child(3n) { animation-delay: .1s; }
@keyframes hm-rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.is-info { background: #1d4e78; } .is-warn { background: #c2410c; } .is-good { background: #1c6b3a; } .is-brand { background: var(--brand); }

.hm-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1.25rem; }
.hm-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 1.5rem; box-shadow: var(--shadow-card); min-width: 0; }
.hm-panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1rem; }
.hm-panel-head h2 { margin: 0; font-size: 1.5rem; }
.hm-flight, .hm-acts { list-style: none; margin: 0; padding: 0; }
.hm-flight-item { display: flex; flex-direction: column; gap: 0.6rem; padding: 0.9rem 0; border-top: 1px solid var(--surface-2, #efe9dd); }
.hm-flight-item:first-child { border-top: 0; padding-top: 0; }
.hm-flight-title { font-weight: 700; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.hm-flight-title:hover { text-decoration: underline; }
.hm-segs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.hm-seg { display: flex; flex-direction: column; gap: 6px; }
.hm-seg-track { display: block; height: 6px; border-radius: 99px; background: var(--surface-2, #efe9dd); overflow: hidden; }
.hm-seg-fill { display: block; height: 100%; border-radius: 99px; background: var(--brand); transform-origin: left; animation: hm-grow .9s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes hm-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.hm-seg-label { font-size: 0.78rem; font-weight: 650; color: var(--muted); }
.hm-seg-label.is-on { color: var(--ink); }
.hm-flight-note { margin: 0; font-size: 0.85rem; color: var(--muted); }
.hm-act { display: flex; gap: 0.85rem; align-items: flex-start; padding: 0.6rem 0; }
.hm-act-icon { flex: none; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; }
.hm-act-icon.is-info { background: #e2edf6; color: #1d4e78; } .hm-act-icon.is-good { background: #e3f2e7; color: #1c6b3a; }
.hm-act-icon.is-bad { background: #fbe4e2; color: #9e2424; } .hm-act-icon.is-brand { background: var(--brand-soft); color: var(--brand); }
.hm-act-text { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.hm-act-meta { font-size: 0.85rem; color: var(--muted); }
.hm-act-meta a { color: var(--muted); }

.hm-banner { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; justify-content: space-between; padding: 1.6rem 1.9rem; }
.hm-seal { flex: none; width: 60px; height: 60px; border-radius: 18px; background: var(--mg-gold); color: #1a1424; display: grid; place-items: center; }
.hm-banner-text { flex: 1 1 22rem; }
.hm-eyebrow-gold { margin: 0; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mg-gold); }
.hm-banner-title { margin: 0.2rem 0 0.3rem; font-family: var(--font-display); font-size: 1.5rem; }
.hm-banner .btn-light { background: var(--mg-ink); color: var(--mg-bg); }

.hm-docs .tools-bar { margin-top: 0; }
.hm-sec-h { font-size: 1.05rem; margin: 1.5rem 0 0.6rem; }
.hm-list { border-radius: 18px; }
.hm-row { display: grid; grid-template-columns: auto minmax(0, 2.2fr) minmax(0, 1.2fr) auto; align-items: center; gap: 0.5rem 1rem; transition: background .15s ease; }
.hm-row:hover { background: #fbf7ef; }
.hm-doc { width: 36px; height: 44px; border-radius: 8px; background: var(--surface-2, #efe9dd); border: 1px solid var(--line); display: grid; place-items: center; font-size: 0.6rem; font-weight: 800; color: var(--muted); }
.hm-people { display: flex; flex-direction: column; gap: 4px; }
.hm-avatars { display: flex; }
.hm-av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 0.68rem; font-weight: 800; color: #fff; border: 2px solid var(--surface); margin-left: -8px; }
.hm-av:first-child { margin-left: 0; }
.hm-av-0 { background: #542f9c; } .hm-av-1 { background: #1d4e78; } .hm-av-2 { background: #7a3310; } .hm-av-3 { background: #1e5b3a; }
.hm-av.is-signed { box-shadow: 0 0 0 2px #1c6b3a; }

@media (max-width: 860px) {
  .hm-hero { grid-template-columns: 1fr; }
  .hm-row { grid-template-columns: auto minmax(0, 1fr); }
  .hm-people, .hm-row .sg-row-side { grid-column: 2; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .hm-bar, .hm-seg-fill { animation: none; }
  .hm-tile, .hm-drop { transition: none; }
}

/* DMO Sign Verified (identity check): small, self-contained, easy to re-skin. */
.vf-toggle { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--line); }
.vf-toggle .check { align-items: flex-start; }
.vf-dev { font-weight: 600; }
.vf-steps { padding-left: 1.25rem; }
.vf-steps li { margin: 0.35rem 0; }
.vf-agree { align-items: flex-start; margin: 1rem 0 0.5rem; }
.vf-agree input { margin-top: 0.15rem; flex: none; }
.vf-ok { color: var(--good, #1f7a3a); font-weight: 600; }
.vf-sim { margin: 0.25rem 0; }
/* starter templates
   Templates page: "How templates work" strip, "Your templates", the "Start from an example" gallery,
   and the starter preview (#/sign/templates/starter/<slug>). Midnight glow panels on the ivory page.
   Role colours differ in lightness and border style (solid / dashed / dotted), never hue alone. */
.st-r0 { --st: #2e1a5e; --st-bg: rgba(46, 26, 94, 0.12); --st-style: solid; --st-dark: #f4f0fb; }
.st-r1 { --st: #237a63; --st-bg: rgba(35, 122, 99, 0.12); --st-style: dashed; --st-dark: #6fc3a6; }
.st-r2 { --st: #8a6400; --st-bg: rgba(138, 100, 0, 0.12); --st-style: dotted; --st-dark: #f0b400; }

.st-glow {
  background: radial-gradient(120% 90% at 100% 0%, rgba(124, 82, 214, 0.55) 0%, rgba(124, 82, 214, 0) 55%), #15111f;
  color: #f4f0fb; border: 1px solid #2e2645; border-radius: 24px; padding: 1.5rem;
}
.st-glow h2 { color: #f4f0fb; font-family: var(--font-display); }
.st-glow a, .st-link-btn { color: #f4f0fb; text-decoration: underline; text-underline-offset: 3px; }
.st-glow :focus-visible { outline: 3px solid #f0b400; outline-offset: 2px; }
.st-inner { background: #2a2240; border: 1px solid #2e2645; border-radius: 16px; padding: 0.9rem 1rem; }
.st-link-btn { background: none; border: 0; padding: 0.25rem 0; min-height: 44px; font: inherit; font-weight: 650; cursor: pointer; }

/* How templates work (3 steps) */
.st-how { margin: 1.25rem 0 2rem; }
.st-how-h { font-size: 1.35rem; margin: 0 0 1rem; }
.st-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.st-step { display: flex; gap: 0.75rem; align-items: flex-start; background: #2a2240; border-radius: 16px; padding: 0.9rem 1rem; }
.st-step-n { flex: none; display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: #f0b400; color: #15111f; font-weight: 750; }
.st-step-t { margin: 0 0 0.25rem; font-weight: 700; }
.st-step-d { margin: 0; color: #b4abc8; font-size: 0.92rem; }
.st-how-foot { margin: 1rem 0 0; color: #b4abc8; }

/* Your templates */
.st-yours { margin-bottom: 2.5rem; }
.st-yours .sg-tpl { background: #fffdf8; border: 1px solid #e2d9c8; border-radius: 24px; box-shadow: var(--shadow-card); }
.st-empty { padding: 1.5rem; }
.st-empty-t { font-family: var(--font-display); font-size: 1.25rem; margin: 0 0 0.35rem; }
.st-empty-actions { margin-top: 1rem; }

/* Gallery */
.st-gallery h2:focus { outline: none; }
.st-gallery h2:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.st-filter { margin: 0.75rem 0 1.25rem; }
.st-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.st-card { background: #fffdf8; border: 1px solid #e2d9c8; border-radius: 24px; box-shadow: var(--shadow-card); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.st-card[hidden] { display: none; }
.st-thumb { display: block; background: #efe9dd; border-bottom: 1px solid #e2d9c8; aspect-ratio: 16 / 10; overflow: hidden; }
.st-thumb img { display: block; width: 100%; height: auto; }
.st-card-body { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; gap: 0.15rem; flex: 1; }
.st-card-name { font-size: 1.15rem; margin: 0.35rem 0 0.15rem; overflow-wrap: anywhere; }
.st-card-desc { margin: 0 0 0.35rem; color: var(--muted); font-size: 0.93rem; }
.st-card-actions { margin-top: auto; padding-top: 0.6rem; }
.st-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0; }
.st-cat { display: inline-flex; align-items: center; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em; padding: 0.15rem 0.65rem; border-radius: 99px; background: #eee8fb; color: #2e1a5e; }
.st-id { font-size: 0.78rem; }

/* Role chain: Client -> Your business */
.st-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.4rem; margin: 0.35rem 0; font-size: 0.92rem; font-weight: 650; }
.st-chain-sep { color: var(--muted); font-weight: 400; }
.st-role { display: inline-flex; align-items: center; gap: 0.35rem; }
.st-swatch { display: inline-block; width: 0.9rem; height: 0.9rem; border-radius: 3px; border: 2px var(--st-style, solid) var(--st); background: var(--st-bg); flex: none; }
.st-opt { color: var(--muted); font-weight: 400; }
.st-glow .st-chain-sep, .st-glow .st-opt { color: #b4abc8; }
.st-glow .st-swatch { border-color: var(--st-dark); background: transparent; }

/* Preview: pages with fields drawn per role, notes beside them */
.st-preview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(18rem, 24rem); gap: 1.5rem; align-items: start; margin-top: 1.25rem; }
.st-pages { display: grid; gap: 1.25rem; min-width: 0; }
.st-page-fig { margin: 0; }
.st-page { position: relative; background: #fff; border: 1px solid #e2d9c8; border-radius: 6px; overflow: hidden; box-shadow: var(--shadow-card); }
.st-page img { display: block; width: 100%; height: auto; }
.st-page-fig figcaption { margin-top: 0.4rem; }
.st-box { position: absolute; box-sizing: border-box; border: 2px var(--st-style) var(--st); background: var(--st-bg); border-radius: 3px; overflow: hidden; }
.st-box.is-check { border-radius: 2px; }
.st-box-t { display: block; padding: 0 3px; font: 700 clamp(7px, 0.9vw, 11px)/1.25 var(--font-text); color: var(--st); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-notes { position: sticky; top: 1rem; display: grid; gap: 0.75rem; }
.st-notes-h { font-size: 1.3rem; margin: 0; }
.st-inner-h { margin: 0 0 0.25rem; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #b4abc8; }
.st-legend { list-style: none; padding: 0; margin: 0.5rem 0 0; display: grid; gap: 0.35rem; font-size: 0.9rem; color: #b4abc8; }
.st-legend strong { color: #f4f0fb; }
.st-note-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.st-note-t { margin: 0 0 0.2rem; font-weight: 700; color: #f0b400; }
.st-note-d { margin: 0; color: #f4f0fb; font-size: 0.93rem; }
.st-idnote { margin: 0; color: #f4f0fb; font-size: 0.93rem; border-color: #f0b400; }
.st-notes-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.st-btn-gold { background: #f0b400; color: #15111f; border: 1px solid #f0b400; font-weight: 750; }
.st-btn-gold:hover { background: #ffc61a; }
.st-btn-ghost { background: transparent; color: #f4f0fb; border: 1px solid #5b4f7a; font-weight: 650; }
.st-btn-ghost:hover { border-color: #b4abc8; }
.st-notes-small { margin: 0; color: #b4abc8; font-size: 0.85rem; }
.st-notes .sg-status { color: #f4f0fb; margin: 0; }
.st-disclaimer { margin-top: 1.5rem; }
@media (max-width: 900px) {
  .st-preview { grid-template-columns: minmax(0, 1fr); }
  .st-notes { position: static; order: -1; }
}
@media (max-width: 640px) {
  .st-glow { padding: 1.1rem; border-radius: 20px; }
  .st-notes-actions .btn { flex: 1 1 100%; }
}

/* home v2 (2026-11-13, owner: match the design canvas mock-up more closely) */
.hm { gap: 2rem; }
.hm-hero { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 2rem; }
.hm-greet { font-size: clamp(2.3rem, 4.4vw, 3.6rem); }
.hm-greet-sub { font-size: 0.72em; margin-top: 0.15rem; }
.hm-lead { margin: 0.5rem 0 0; font-size: 1.1rem; color: var(--muted); max-width: 34rem; }
.hm-drop { min-height: 16rem; }

.hm-docs-wrap { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: flex-start; }
.hm-docs { flex: 999 1 40rem; min-width: 0; }
.hm-docs-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin-bottom: 1.1rem; }
.hm-docs-head h2 { margin: 0 auto 0 0; font-size: 1.5rem; }
.hm-tabs { display: flex; flex-wrap: wrap; gap: 4px; background: var(--surface-2, #efe9dd); border-radius: 14px; padding: 4px; }
.hm-tab { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 38px; padding: 0 0.9rem; border-radius: 10px; color: var(--muted);
  font-weight: 700; font-size: 0.92rem; text-decoration: none; transition: background .15s ease, color .15s ease; }
.hm-tab:hover { color: var(--ink); }
.hm-tab.is-on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(36, 27, 51, 0.12); }
.hm-tab-n { opacity: 0.65; font-weight: 650; }
.hm-search { width: 20rem; min-height: 44px; }
.hm-search input[type="search"] { min-height: 40px; }

.hm-table { overflow-x: auto; }
.hm-thead, .hm-row { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, 1.4fr) minmax(0, 1.2fr) minmax(0, 0.9fr) 40px; gap: 1rem; align-items: center; min-width: 44rem; }
.hm-thead { padding: 0 1rem 0.6rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.hm-list { border: 0; background: transparent; border-radius: 0; overflow: visible; }
.hm-row { padding: 0.85rem 1rem; border-top: 1px solid var(--surface-2, #efe9dd); border-radius: 14px; cursor: pointer; flex-wrap: nowrap; }
.hm-row:hover { background: #fbf7ef; }
.hm-row.is-open { background: #f3eefb; }
.hm-doc-cell { display: flex; gap: 0.8rem; align-items: center; min-width: 0; }
.hm-row .sg-row-main { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; }
.hm-row .sg-row-title { color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-row .sg-row-title:hover { text-decoration: underline; color: var(--brand); }
.hm-row .sg-row-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-status { display: flex; }
.hm-more { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.hm-more:hover, .hm-row.is-open .hm-more { color: var(--brand); border-color: var(--brand); }
.hm-row.is-open .hm-more svg { transform: rotate(180deg); }
.hm-empty { padding: 1.5rem 1rem; color: var(--muted); margin: 0; }

.hm-drawer { flex: 1 1 20rem; max-width: 24rem; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 1.4rem;
  box-shadow: var(--shadow-lift); display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 5.5rem; animation: hm-slide .28s cubic-bezier(.2, .7, .2, 1) both; }
.hm-drawer[hidden] { display: none; }
@keyframes hm-slide { from { transform: translateX(18px); opacity: 0; } to { transform: none; opacity: 1; } }
.hm-drawer-head { display: flex; justify-content: space-between; gap: 0.75rem; align-items: flex-start; }
.hm-drawer-head h3 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 1.35rem; line-height: 1.2; overflow-wrap: anywhere; }
.hm-drawer .badge { align-self: flex-start; }
.hm-x { flex: none; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.hm-trail { list-style: none; margin: 0; padding: 0; }
.hm-trail li { display: flex; gap: 0.75rem; position: relative; padding-bottom: 0.9rem; }
.hm-trail li:not(:last-child)::after { content: ""; position: absolute; left: 5px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.hm-trail-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; background: var(--brand); }
.hm-trail .is-now .hm-trail-dot { background: #f0b400; box-shadow: 0 0 0 4px #fff2cf; }
.hm-trail .is-bad .hm-trail-dot { background: #9e2424; }
.hm-trail-text { display: block; font-weight: 600; font-size: 0.95rem; }
.hm-trail-when { font-size: 0.8rem; color: var(--muted); }
.hm-signers { list-style: none; margin: 0; padding: 0.9rem 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 0.6rem; }
.hm-signers li { display: flex; align-items: center; gap: 0.7rem; }
.hm-signers .hm-av { margin-left: 0; }
.hm-signer-who { display: flex; flex-direction: column; min-width: 0; flex: 1; overflow-wrap: anywhere; }
.hm-pill { font-size: 0.75rem; font-weight: 700; border-radius: 999px; padding: 3px 9px; background: var(--surface-2, #efe9dd); color: var(--muted); }
.hm-pill.is-signed { background: #e3f2e7; color: #1c6b3a; } .hm-pill.is-viewed { background: #e2edf6; color: #1d4e78; }
.hm-pill.is-declined { background: #fbe4e2; color: #9e2424; }

@media (max-width: 860px) {
  .hm-thead { display: none; }
  .hm-thead, .hm-row { min-width: 0; }
  .hm-row { grid-template-columns: minmax(0, 1fr) 40px; gap: 0.4rem 0.75rem; }
  .hm-doc-cell { grid-column: 1; }
  .hm-people, .hm-status, .hm-row .sg-row-date { grid-column: 1; padding-left: 3rem; }
  .hm-more { grid-column: 2; grid-row: 1; }
  .hm-search { width: 100%; }
  .hm-drawer { max-width: none; position: static; }
}
@media (prefers-reduced-motion: reduce) { .hm-drawer { animation: none; } }

/* signers step v2 ("Who signs ...?", 2026-11-13, from the design canvas board 2) */
.sg-steps ol { display: flex; flex-wrap: wrap; gap: 6px; }
.sg-step > a, .sg-step > span { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 40px; padding: 0 0.95rem; border-radius: 999px;
  background: var(--surface-2, #efe9dd); color: var(--muted); font-weight: 700; font-size: 0.9rem; text-decoration: none; }
.sg-step.is-done > a, .sg-step.is-done > span { background: #e3f2e7; color: #1c6b3a; }
.sg-step.is-current > a, .sg-step.is-current > span { background: #221640; color: #fff; }
.sg-step .sg-step-n { background: transparent; color: inherit; width: auto; height: auto; min-width: 0; border: 0; }
.vs-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem 1rem; margin-bottom: 1.25rem; }
.vs-top .back { margin: 0; }
.vs-top .sg-steps { margin: 0; }
.vs-h1 { margin: 0 0 0.4rem; font-family: var(--font-display); font-weight: 500; font-size: clamp(2rem, 3.8vw, 3rem); line-height: 1.06; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.vs-h1-doc { color: var(--muted); }
.vs-layout { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: flex-start; margin-top: 1.5rem; }
.vs-main { flex: 999 1 34rem; min-width: 0; display: flex; flex-direction: column; gap: 1rem; }
.vs-main .sg-signers { display: flex; flex-direction: column; gap: 1rem; margin: 0; padding: 0; }
.vs-card { list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 1.4rem; box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: 1rem; transition: border-color .2s ease; }
.vs-card.is-verified { border: 2px solid var(--brand); }
.vs-head { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.vs-head h3 { margin: 0 auto 0 0; font-size: 1.05rem; }
.vs-num { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-family: var(--font-display); font-size: 1.3rem; color: #fff; background: #5e566b; }
.vs-card.is-verified .vs-num { background: var(--brand); }
.vs-card .sg-dot { display: none; }
.vs-add { min-height: 56px; border: 1.5px dashed var(--line-strong, #cfc6dd); border-radius: 20px; background: transparent; color: var(--brand); font: inherit; font-weight: 700; cursor: pointer; }
.vs-add:hover { background: var(--surface); border-color: var(--brand); }
.vs-main .sg-order { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 1rem 1.2rem; }

.vs-toggle { border-top: 1px solid var(--surface-2, #efe9dd); padding-top: 1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.vs-toggle-row { display: flex; align-items: center; gap: 0.9rem; cursor: pointer; }
.vs-shield { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2, #efe9dd); color: var(--muted); font-weight: 800; }
.vs-card.is-verified .vs-shield { background: #f0b400; color: #241b33; }
.vs-toggle-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.vs-switch { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 60px; height: 34px; border-radius: 999px; background: #cfc6dd; cursor: pointer; margin: 0; transition: background .2s ease; }
.vs-switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform .22s cubic-bezier(.2, .7, .2, 1); }
.vs-switch:checked { background: var(--brand); }
.vs-switch:checked::after { transform: translateX(26px); }
.vs-steps3 { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.6rem; animation: hm-rise-in .3s ease both; }
@keyframes hm-rise-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.vs-steps3 li { background: #f3eefb; border-radius: 14px; padding: 0.8rem; display: flex; flex-direction: column; gap: 2px; font-size: 0.88rem; }
.vs-steps3 b { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); }

.vs-aside { flex: 1 1 18rem; max-width: 24rem; display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 5.5rem; }
.vs-sum { padding: 1.5rem; display: flex; flex-direction: column; gap: 0.8rem; }
.vs-sum-row { display: flex; justify-content: space-between; gap: 1rem; color: var(--mg-muted, #b4abc8); font-size: 0.95rem; }
.vs-sum-row b { color: var(--mg-ink, #f4f0fb); }
.vs-sum-line { height: 1px; background: #2e2645; }
.vs-sum .btn-primary { background: #f4f0fb; color: #15111f; width: 100%; justify-content: center; margin-top: 0.4rem; }
.vs-sum .btn-primary:hover { background: #fff; color: #15111f; }
.vs-note { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 1.1rem 1.2rem; }
.vs-note-h { margin: 0 0 0.3rem; font-weight: 700; }
.vs-note p.small { margin: 0; }
.vs-aside > .btn-quiet { align-self: center; }
@media (max-width: 860px) { .vs-aside { position: static; max-width: none; } }
@media (prefers-reduced-motion: reduce) { .vs-switch, .vs-switch::after, .vs-steps3 { transition: none; animation: none; } }
.vs-layout { --mg-bg: #15111f; --mg-ink: #f4f0fb; --mg-muted: #b4abc8; --mg-box: #2a2240; --mg-line: #2e2645; --mg-gold: #f0b400;
  --mg-glow: radial-gradient(120% 90% at 100% 0%, rgba(124, 82, 214, 0.55) 0%, rgba(124, 82, 214, 0) 55%); }
.hm-status .badge { white-space: normal; text-align: left; line-height: 1.25; }
.hm-row .sg-row-date { font-size: 0.88rem; }
.vs-main .sg-order legend { font-family: var(--font-text); font-size: 1rem; font-weight: 700; padding: 0 0.4rem; }
@media (max-width: 860px) { .hm-hero { grid-template-columns: 1fr; gap: 1.25rem; } .hm-drop { min-height: 12rem; } }
.hm-phone-send { display: none; }
@media (max-width: 480px) { .hm-phone-send { display: inline-flex; margin-top: 1rem; background: #f4f0fb; color: #15111f; } }
.hm-tab-n { opacity: 1; font-weight: 600; color: inherit; background: rgba(36, 27, 51, 0.06); border-radius: 999px; padding: 0 0.45rem; }

/* Starter templates: the disclaimer, and "Make it yours" (the business's details + the review confirmation). */
.st-legal p { margin: 0; }
.st-legal p + p { margin-top: 0.5rem; }
.st-dialog { width: min(40rem, calc(100vw - 1.5rem)); }
.st-dialog .sgn-dialog-inner { padding-bottom: 1.25rem; }
.st-dialog .st-legal { margin-top: 0; }
.st-yours-form { display: grid; gap: 0.85rem; }
.st-yours-form .field { margin: 0; }
.st-yours-form .field .small { margin: 0 0 0.3rem; }
.st-yours-form input[type=text], .st-yours-form input[type=email], .st-yours-form input[type=tel] { width: 100%; }
.st-form-h { margin: 0.25rem 0 0; font-size: 1.1rem; }
.st-yours-form > p { margin: 0; }
.st-ack { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.6rem 0.8rem; background: var(--surface); }
.st-ack .check { align-items: flex-start; }
.st-ack .check input { flex: none; margin-top: 0.15rem; }
.st-err { margin: 0.3rem 0 0; color: var(--bad, #a3261d); font-weight: 650; font-size: 0.9rem; }
.st-err[hidden] { display: none; }
.st-yours-form [aria-invalid=true] { border-color: var(--bad, #a3261d); box-shadow: 0 0 0 1px var(--bad, #a3261d); }
@media (max-width: 40rem) {
  .st-dialog .actions .btn { flex: 1 1 100%; }
}
