/* Steve's Signed & Sealed. Paper and ink, sealed in blue.
   Brand tokens live here, and only here: blue leads, mint means "done / sealed", the contract is set like a
   printed page on a cool, calm canvas. One authored motion moment: the seal. Everything else is quiet. */
:root {
  --brand: #0070E5;
  --brand-deep: #005BC0;
  --brand-ink: #ffffff;
  --brand-wash: #EAF3FE;
  --mint: #3DD6AC;
  --mint-deep: #0A7A5F;      /* mint as text: 5.3:1 on white */
  --mint-wash: #E4F8F1;
  --font-body: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-doc: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;
  --bg: #F3F5F8;
  --paper: #ffffff;
  --ink: #0F1729;
  --muted: #586273;          /* 6.1:1 on white */
  --line: #E2E6EC;
  --line-strong: #CDD4DD;
  --ok: var(--mint-deep);
  --warn: #8A5A00;
  --bad: #B3261E;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-1: 0 1px 2px rgba(15, 23, 41, .05), 0 1px 1px rgba(15, 23, 41, .03);
  --shadow-2: 0 1px 2px rgba(15, 23, 41, .04), 0 6px 20px rgba(15, 23, 41, .07);
  --shadow-3: 0 2px 6px rgba(15, 23, 41, .06), 0 24px 60px rgba(15, 23, 41, .18);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --fast: 160ms;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--line-strong) transparent; }
body { background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font-body);   -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; caret-color: var(--brand); }
::selection { background: rgba(61, 214, 172, .32); color: var(--ink); }
main { max-width: 880px; margin: 0 auto; padding: 52px 16px 96px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.018em; text-wrap: balance; font-weight: 650; }
h1 { font-size: 1.75rem; margin: 0 0 6px; }
h2 { font-size: 1.2rem; margin: 32px 0 10px; }
h3 { font-size: 1rem; margin: 24px 0 8px; }
a { color: var(--brand); text-underline-offset: 3px; }
p { text-wrap: pretty; }

/* ---------- chrome ---------- */
/* The header: Steve's mark sits big in a round badge that hangs below the header line, like a medallion. */
.topbar { position: relative; z-index: 10; display: flex; align-items: center; justify-content: space-between; height: 84px; padding: 0 28px 0 140px;
  background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(15, 23, 41, .02), 0 8px 24px rgba(15, 23, 41, .04); }
.brand { display: flex; align-items: center; text-decoration: none; color: var(--ink); }
.brand-name { font: 600 1.7rem/1 var(--font-doc); letter-spacing: -0.015em; font-optical-sizing: auto; }
.brand-badge { position: absolute; z-index: 2; left: 24px; top: 12px; width: 104px; height: 104px; border-radius: 50%; background: #fff; display: grid; place-items: center;
  border: 1px solid var(--line); box-shadow: 0 2px 4px rgba(15, 23, 41, .05), 0 12px 28px rgba(15, 23, 41, .1); transition: transform 300ms var(--ease); }
.brand:hover .brand-badge { transform: rotate(-8deg); }
.brand-mark { width: 82px; height: 82px; display: block; }
#logout { font-size: .95rem; }
/* Header tabs (owner only): filters on the document list, plus New. On narrow screens they drop to their own scrolling row. */
.site-tabs { display: flex; gap: 4px; margin-left: auto; margin-right: 16px; }
.site-tabs[hidden] { display: none; }
.site-tabs button { border: 0; background: none; color: var(--muted); padding: 8px 12px; border-radius: 99px; font-weight: 550; white-space: nowrap; }
.site-tabs button:hover { background: var(--bg); color: var(--ink); }
.site-tabs button[aria-current="page"] { background: var(--brand-wash); color: var(--brand-deep); }
.site-tabs .count { font-size: .75rem; font-weight: 650; color: var(--brand-deep); }
.site-tabs .count:empty { display: none; }
.site-tabs .tab-new { color: var(--brand); }
.chip.draft { background: #FFF4DE; color: #8A5A00; }
.preview-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 16px 0 0; padding: 12px 16px;
  background: #FFF4DE; border: 1px solid #F2D69B; border-radius: var(--radius-sm); }
.preview-banner button { flex: none; }
.editor-actions { flex-wrap: wrap; gap: 8px; }
.editor-actions .danger { margin-left: auto; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin: 16px 0; box-shadow: var(--shadow-2); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1 1 220px; }
.icon { width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: -3px; }

/* ---------- controls ---------- */
label { display: block; font-weight: 600; font-size: .925rem; margin: 16px 0 6px; }
input[type=text], input[type=email], input[type=password], textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font: inherit; background: #fff; color: var(--ink);
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease); }
input::placeholder, textarea::placeholder { color: #6B7485; }
input:hover, textarea:hover { border-color: #B7C0CC; }
input:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(0, 112, 229, .16); }
textarea { min-height: 260px; font-family: var(--font-mono); font-size: .875rem; line-height: 1.6; }
textarea.plain { min-height: 110px; font-family: var(--font-body); font-size: 1rem; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

button { font: inherit; font-weight: 550; cursor: pointer; border-radius: var(--radius-sm); padding: 10px 16px; border: 1px solid var(--line-strong);
  background: #fff; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease), transform var(--fast) var(--ease); }
button:hover { background: #F7F9FB; border-color: #B7C0CC; }
button:active { transform: scale(.98); }
button.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 1px 2px rgba(0, 72, 150, .25); }
button.primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
button.danger { color: var(--bad); }
button.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; font-weight: 600; }
button:disabled, button:disabled:hover { opacity: .45; cursor: not-allowed; transform: none; }
button.primary:disabled { background: var(--brand); }
.link-btn { border: 0; background: none; color: var(--brand); padding: 4px 2px; font-weight: 550; }
.link-btn:hover { background: none; color: var(--brand-deep); text-decoration: underline; text-underline-offset: 3px; }

.error { color: var(--bad); margin: 12px 0 0; font-size: .925rem; }
.notice { background: var(--brand-wash); border: 1px solid #CFE3FB; border-radius: var(--radius-sm); padding: 12px 14px; }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 650; letter-spacing: .01em; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.pending { background: #EEF1F5; color: #4A5466; }
.chip.opened { background: var(--brand-wash); color: var(--brand-deep); }
.chip.signed { background: var(--mint-wash); color: var(--mint-deep); }
.chip.declined { background: #FBE9E7; color: var(--bad); }
.chip.void { background: #EEF1F5; color: var(--muted); }

.doc-list { list-style: none; padding: 0; margin: 0; }
.doc-list li { position: relative; display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 14px 12px; margin: 0 -12px;
  border-radius: var(--radius-sm); cursor: pointer; transition: background var(--fast) var(--ease); }
.doc-list li + li::before { content: ""; position: absolute; left: 12px; right: 12px; top: 0; height: 1px; background: var(--line); }
.doc-list li:hover, .doc-list li:focus-visible { background: #F4F7FA; outline: none; }
.doc-list li:focus-visible { box-shadow: 0 0 0 2px var(--brand); }
.doc-list .row-end { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.copy-box { display: flex; gap: 8px; }
.copy-box input { font-family: var(--font-mono); font-size: .825rem; }
code { font-family: var(--font-mono); font-size: .85em; background: #EEF1F5; padding: 1px 5px; border-radius: 5px; }

/* ---------- the contract, set like a printed page ---------- */
.doc { font-family: var(--font-doc); font-size: 1.08rem; line-height: 1.65; font-optical-sizing: auto; }
.doc.card { padding: 40px 44px; }
.doc h1 { font-family: var(--font-doc); font-size: 1.9rem; font-weight: 600; letter-spacing: -0.012em; margin-bottom: 18px; }
.doc h2 { font-family: var(--font-doc); font-size: 1.28rem; font-weight: 600; margin-top: 30px; }
.doc h3 { font-family: var(--font-doc); font-size: 1.1rem; font-weight: 600; }
.doc ul, .doc ol { padding-left: 1.4em; } .doc li { margin: 5px 0; }
.doc p, .doc li { max-width: 68ch; }

/* ---------- signer landing ---------- */
.land { max-width: 480px; margin: 48px auto; text-align: center; padding: 40px 32px 28px; box-shadow: var(--shadow-3); border-color: transparent; }
.land form { text-align: left; margin-top: 8px; }
.land-from { color: var(--muted); margin: 0 0 8px; }
.land h1 { font-size: 1.6rem; margin-bottom: 22px; }
.land .consent { margin-top: 18px; }
.disclosure { margin: 6px 0 0 30px; color: var(--muted); }
.disclosure summary { cursor: pointer; color: var(--brand); font-weight: 550; list-style: none; }
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary::after { content: " ›"; }
.disclosure[open] summary::after { content: " ⌄"; }
button.big { width: 100%; margin-top: 22px; padding: 14px 16px; font-size: 1.05rem; border-radius: 12px; }
.trust { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 22px -32px -28px; padding: 14px 20px; border-top: 1px solid var(--line);
  font-size: .8rem; color: var(--muted); background: #FAFBFC; border-radius: 0 0 var(--radius) var(--radius); }
.trust .icon { color: var(--mint-deep); }
.trust span { text-align: left; text-wrap: balance; }

.consent { display: flex; gap: 12px; align-items: flex-start; font-weight: 450; cursor: pointer; }
.consent input { margin: 3px 0 0; width: 18px; height: 18px; flex: none; accent-color: var(--brand); }

/* ---------- signing: action bar, guide, field tags ---------- */
.sign-bar { position: sticky; top: 10px; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  background: rgba(255, 255, 255, .94); border: 1px solid var(--line); border-radius: 14px; padding: 10px 10px 10px 18px; margin: 16px 0 0; box-shadow: var(--shadow-2); }
@supports (backdrop-filter: blur(1px)) { .sign-bar { background: rgba(255, 255, 255, .82); backdrop-filter: saturate(1.6) blur(14px); } }
.sbar-msg { display: flex; flex-direction: column; line-height: 1.3; } .sbar-msg strong { font-weight: 650; }
#progress { font-variant-numeric: tabular-nums; }
/* Mint fills in as each required field is completed. */
.sbar-progress { position: absolute; left: 14px; right: 14px; bottom: 0; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.sbar-progress span { display: block; height: 100%; width: 0; background: var(--mint); border-radius: 3px; transition: width 420ms var(--ease); }
.sbar-actions { display: flex; gap: 8px; align-items: center; }
.sbar-actions button, .tabs [role=tab] { white-space: nowrap; }
.menu { position: relative; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-3);
  min-width: 190px; padding: 6px; z-index: 30; transform-origin: top right; animation: pop 180ms var(--ease); }
.menu-list button { display: flex; justify-content: flex-start; width: 100%; border: 0; background: none; padding: 9px 12px; border-radius: 8px; }
.menu-list button:hover { background: #F2F5F8; }
.menu-list [data-act=decline] { color: var(--bad); }
.lbl-short { display: none; }
.chev { width: 14px; height: 14px; transition: transform var(--fast) var(--ease); }
[aria-expanded=true] .chev { transform: rotate(180deg); }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(-4px); } }
.sign-intro { margin: 14px 4px 0; }
.doc.signing { position: relative; padding-left: 104px; padding-right: 104px; }
.guide { position: absolute; left: 14px; top: 20px; z-index: 5; width: 76px; height: 34px; padding: 0 14px 0 10px; border: 0; border-radius: 8px 0 0 8px;
  font: 650 .8rem/1 var(--font-body); letter-spacing: .02em; background: var(--brand); color: var(--brand-ink);
  clip-path: polygon(0 0, 80% 0, 100% 50%, 80% 100%, 0 100%); justify-content: flex-start;
  transition: top 420ms var(--ease), background var(--fast) var(--ease); }
.guide:hover { background: var(--brand-deep); }
.guide:focus-visible { outline: none; background: var(--brand-deep); box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 5px var(--brand-deep); }
.guide.finish { background: var(--mint-deep); }
.tag { display: inline-flex; align-items: center; justify-content: center; gap: 6px; vertical-align: middle; font: 600 .8rem/1 var(--font-body);
  border: 1px dashed rgba(0, 112, 229, .55); background: rgba(0, 112, 229, .07); color: var(--brand-deep); border-radius: 8px; padding: 6px 12px; min-height: 34px; margin: 2px 0 2px 6px; }
@media (pointer: coarse) { .tag { min-height: 44px; padding: 8px 14px; } .tag-initial { min-width: 88px; } }
.tag .icon { width: 14px; height: 14px; }
.tag-sign { min-width: 132px; } .tag-initial { min-width: 76px; }
.tag.auto { border-color: var(--line-strong); background: #F6F8FA; color: var(--muted); font-weight: 550; }
button.tag { cursor: pointer; } button.tag:hover { background: rgba(0, 112, 229, .13); border-style: solid; }
.tag.filled { border-color: transparent; background: none; color: var(--ink); padding: 0 4px; font-weight: 500; }
button.tag.filled, button.tag.filled:hover { border-color: transparent; }
button.tag.filled:hover { background: rgba(0, 112, 229, .05); }
.tag.filled img { height: 46px; display: block; } .tag-initial.filled img { height: 34px; }
.tag.auto.filled { font: 1.04rem/1.4 var(--font-doc); color: var(--ink); background: none; }
.tag.pulse { animation: pulse 1s var(--ease) 2; }
@keyframes pulse { from { box-shadow: 0 0 0 0 rgba(0, 112, 229, .45); } to { box-shadow: 0 0 0 14px rgba(0, 112, 229, 0); } }
/* The signature writes itself in, left to right, like a pen. */
.ink-in { animation: write 720ms cubic-bezier(.45, .05, .25, 1) both; }
@keyframes write { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

.signature-block { display: flex; gap: 32px; flex-wrap: wrap; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 22px; margin-top: 34px; }
.sb-cell { min-width: 150px; } .sb-sign { min-width: 230px; }
.sb-slot { min-height: 54px; display: flex; align-items: flex-end; border-bottom: 1px solid var(--ink); padding-bottom: 4px; }
.sb-label { font: 600 .7rem/1 var(--font-body); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-top: 7px; }
.field-img { display: inline-block; vertical-align: middle; } .field-img.sig { height: 48px; max-width: 260px; } .field-img.ini { height: 34px; }
.field-text { font-family: var(--font-doc); }

/* ---------- adopt-signature + decline sheets ---------- */
body.modal-open { overflow: hidden; }
.modal-back { position: fixed; inset: 0; background: rgba(15, 23, 41, .38); z-index: 50; display: flex; align-items: flex-start; justify-content: center;
  padding: 6vh 16px; overflow-y: auto; animation: fade 200ms var(--ease); }
@supports (backdrop-filter: blur(1px)) { .modal-back { backdrop-filter: blur(3px); } }
.modal { background: var(--paper); border-radius: 20px; width: 100%; max-width: 620px; padding: 28px; box-shadow: var(--shadow-3); animation: rise 320ms var(--ease); }
.modal h2 { margin: 0 0 4px; font-size: 1.3rem; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.ini-field { flex: 0 0 110px; }
.tabs { display: flex; gap: 4px; background: #EEF1F5; border-radius: 11px; padding: 3px; margin: 20px 0 14px; }
.tabs [role=tab] { flex: 1; border: 0; border-radius: 8px; background: none; padding: 8px 6px; color: var(--muted); font-weight: 600; font-size: .9rem; }
.tabs [role=tab]:hover { color: var(--ink); background: none; }
.tabs [aria-selected=true], .tabs [aria-selected=true]:hover { color: var(--ink); background: #fff; box-shadow: var(--shadow-1); }
.styles { display: grid; gap: 8px; max-height: 360px; overflow-y: auto; padding: 2px; }
.style-opt { display: flex; justify-content: space-between; align-items: center; gap: 16px; text-align: left; padding: 10px 16px; min-height: 68px; border-radius: 12px; font-weight: 400; }
.style-opt[aria-checked=true], .style-opt[aria-checked=true]:hover { border-color: var(--brand); background: #F5F9FF; box-shadow: 0 0 0 3px rgba(0, 112, 229, .14); }
.s-sig { font-size: 2rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); } .s-ini { font-size: 1.6rem; flex: none; color: var(--ink); }
.pads { display: flex; gap: 12px; flex-wrap: wrap; } .pad-col { flex: 1 1 260px; } .pad-col.ini { flex: 0 1 170px; }
.pad-label { font-weight: 600; font-size: .875rem; margin-bottom: 6px; }
.sig-pad-wrap { border: 1px solid var(--line-strong); border-radius: 12px; position: relative; touch-action: none;
  background: linear-gradient(transparent calc(100% - 38px), var(--line) calc(100% - 38px), var(--line) calc(100% - 37px), transparent calc(100% - 37px)), #FCFDFE; }
.sig-pad { width: 100%; height: 150px; display: block; cursor: crosshair; }
.up-prev { max-width: 100%; max-height: 120px; display: block; margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
.legal { color: var(--muted); margin: 18px 0 0; line-height: 1.5; }
.modal-actions { margin-top: 18px; }

/* ---------- the seal ---------- */
.seal { display: block; width: 100%; height: auto; filter: drop-shadow(0 2px 2px rgba(0, 40, 100, .25)) drop-shadow(0 10px 18px rgba(0, 50, 120, .2)); }
/* The press: the seal comes down out of the screen, tilted, its shadow on the page sharpening as it nears;
   it squashes on contact, rebounds, and settles. A mint ring ripples from the moment of impact. */
.seal-stage { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; pointer-events: none; perspective: 900px;
  background: rgba(243, 245, 248, 0); animation: stage 1700ms var(--ease) forwards; }
.seal-stage .seal-press { width: 190px; height: 190px; position: relative; transform-style: preserve-3d; }
.seal-stage .seal { filter: none; position: relative; z-index: 1; animation: press 1150ms cubic-bezier(.3, .0, .2, 1) both; transform-origin: 50% 55%; }
.seal-stage .seal-shadow { position: absolute; left: 6%; right: 6%; top: 14%; bottom: 0; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 45, 110, .5), rgba(0, 45, 110, 0)); animation: shadow 1150ms cubic-bezier(.3, .0, .2, 1) both; }
.seal-stage .seal-ring { position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--mint); opacity: 0; animation: ring 900ms 520ms var(--ease) both; }
@keyframes stage { 0% { background: rgba(243, 245, 248, 0); } 30%, 100% { background: rgba(243, 245, 248, .74); } }
@keyframes press {
  0%   { transform: translate3d(0, -40px, 420px) rotateX(38deg) rotateY(-22deg) rotateZ(-16deg); opacity: 0; }
  14%  { opacity: 1; }
  46%  { transform: translate3d(0, 0, 0) rotateX(0) rotateY(0) rotateZ(0) scale(1.07, .93); animation-timing-function: cubic-bezier(.2, .8, .3, 1); }
  60%  { transform: scale(.97, 1.03); }
  74%  { transform: scale(1.012, .99); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes shadow {
  0%   { transform: translateY(46px) scale(1.5); opacity: 0; filter: blur(16px); }
  46%  { transform: translateY(8px) scale(.98); opacity: 1; filter: blur(2px); }
  100% { transform: translateY(10px) scale(1); opacity: .8; filter: blur(4px); }
}
@keyframes ring { 0% { transform: scale(.92); opacity: .95; } 100% { transform: scale(1.75); opacity: 0; } }
.done-card { text-align: center; padding: 40px 24px 32px; } .done-card .row { justify-content: center; margin-top: 8px; }
.done-seal { width: 120px; height: 120px; margin: 0 auto 16px; animation: settle 500ms var(--ease) both; }
@keyframes settle { from { transform: scale(1.12); } }
.done-card h1 { font-size: 1.75rem; }
.sealed-pill { display: inline-flex; align-items: center; gap: 6px; margin: 4px auto 0 !important; padding: 5px 12px 5px 9px; border-radius: 99px;
  background: var(--mint-wash); color: var(--mint-deep) !important; font-weight: 650; font-size: .85rem; font-variant-numeric: tabular-nums; }
.sealed-pill .icon { width: 15px; height: 15px; stroke-width: 2.4; }
.done-card p { max-width: 46ch; margin: 8px auto 18px; color: var(--muted); }

/* ---------- certificate ---------- */
.cert { font-size: .9rem; }
.cert h2 { margin-top: 0; }
.cert-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.cert-head .seal-mini { width: 76px; height: 76px; flex: none; }
.cert-head h2 { margin: 0; } .cert-head p { margin: 2px 0 0; }
.cert dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0 0 16px; }
.cert dt { color: var(--muted); } .cert dd { margin: 0; overflow-wrap: anywhere; }
.cert-sig { height: 36px; vertical-align: middle; }
.audit { width: 100%; border-collapse: collapse; font-size: .85rem; font-variant-numeric: tabular-nums; }
.audit th { white-space: nowrap; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; }
.audit th, .audit td { text-align: left; padding: 8px; border-top: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.audit td:nth-child(3) { white-space: nowrap; }
.mono { font-family: var(--font-mono); font-size: .8rem; overflow-wrap: anywhere; }

/* ---------- owner status tracker ---------- */
.tracker { list-style: none; padding: 0; margin: 18px 0 8px; display: flex; }
.step { flex: 1; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; position: relative; font-variant-numeric: tabular-nums; }
.step::after { content: ""; position: absolute; left: 18px; right: -2px; top: 6px; height: 2px; border-radius: 2px; background: var(--line); }
.step:last-child::after { display: none; }
.step.done::after { background: var(--mint); }
.step > div { position: relative; padding-right: 12px; }
.step .dot { position: relative; z-index: 1; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--paper); flex: none; }
.step.done .dot { background: var(--mint); border-color: var(--mint); box-shadow: 0 0 0 3px var(--mint-wash); }
.step.bad .dot { background: var(--bad); border-color: var(--bad); box-shadow: 0 0 0 3px #FBE9E7; }

@media (max-width: 1000px) {
  .site-tabs:not([hidden]) { position: absolute; left: 0; right: 0; top: 84px; margin: 0; padding: 6px 16px 6px 140px; background: #fff; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
  body:has(.site-tabs:not([hidden])) main { padding-top: 100px; }
}
@media (max-width: 700px) {
  .doc.card { padding: 28px 20px; }
  .doc.signing { padding-left: 20px; padding-right: 20px; }
  /* On a phone the guide becomes a floating button above the thumb. */
  .guide { position: fixed; left: auto; right: 16px; top: auto !important; bottom: calc(18px + env(safe-area-inset-bottom)); width: auto; height: 48px; min-width: 112px;
    padding: 0 26px 0 18px; font-size: .95rem; border-radius: 12px 0 0 12px; transition: background var(--fast) var(--ease); }
  main { padding-bottom: 120px; }
}
@media (max-width: 560px) {
  main { padding-top: 40px; }
  .topbar { height: 64px; padding: 0 16px 0 100px; }
  .site-tabs:not([hidden]) { top: 64px; padding-left: 100px; }
  body:has(.site-tabs:not([hidden])) main { padding-top: 84px; }
  .brand-name { font-size: 1.22rem; }
  .brand-badge { left: 14px; top: 8px; width: 76px; height: 76px; } .brand-mark { width: 60px; height: 60px; }
  .land { margin: 16px auto; padding: 32px 22px 24px; } .trust { margin: 20px -22px -24px; }
  .tracker { flex-direction: column; gap: 12px; } .step { flex-direction: row; gap: 10px; } .step .dot { margin-top: 4px; } .step::after { display: none; }
  .sign-bar { top: 8px; padding: 10px; }
  .sbar-actions { width: 100%; } .sbar-actions .menu { flex: none; } .sbar-actions .menu > button { padding: 10px 12px; } #finish { flex: 1; }
  .lbl-long { display: none; } .lbl-short { display: inline !important; }
  .done-card .row { flex-direction: column; align-items: stretch; max-width: 320px; margin-inline: auto; } .done-card .row button { width: 100%; }
  .modal { padding: 22px 18px; border-radius: 18px; }
  .cert dl { grid-template-columns: 1fr; } .cert dt { margin-top: 8px; }
  .audit thead { display: none; } .audit tr, .audit td { display: block; } .audit tr { border-top: 1px solid var(--line); padding: 8px 0; } .audit td { border: 0; padding: 2px 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
  .ink-in { animation: none; }
}
@media print {
  body { background: #fff; } main { max-width: none; padding: 0; }
  .no-print { display: none !important; }
  .card { border: 0; padding: 0; margin: 0 0 18px; box-shadow: none; }
  .doc.card { padding: 0; }
  .cert { break-before: page; }
  .tag:not(.filled) { border-style: solid; }
  .seal { filter: none; }
}

/* Views card: who looked, when, where */
.views .last-view { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 8px 0 10px; display: grid; gap: 3px; }
.views .lv-when { font-size: 1.15rem; font-weight: 650; }
.views .audit td:nth-child(3) { white-space: normal; }
.doc-list .last-line { margin-top: 2px; }

/* Parchment: the same handmade paper as the booking app's envelope (laid lines, fibers, oatmeal tone; photo
   texture in paper.webp, deckled sheet in paper-deckle.webp). Used by the fold and the hero. */
:root {
  --parchment: url(/paper.webp) center / cover;
  --parchment-under: linear-gradient(rgba(60, 45, 25, .07), rgba(60, 45, 25, .13)), url(/paper.webp) center / cover;
}

/* ---------- the fold: the signed contract folds in thirds at full size, the seal presses on the flap's edge ----------
   Sized from JS: --w width, --ph panel height, --th top flap (a touch short, so its edge lands above the bottom
   crease and overlaps the panel beneath it), --s seal. Bottom folds up first, then the top folds down over it. */
.fold-stage { perspective: 1800px; }
.fold-stage .letter { position: relative; width: var(--w); height: calc(var(--th) + 2 * var(--ph)); transform-style: preserve-3d;
  animation: letter-in 420ms var(--ease) both; }
.fold-stage .lp { position: absolute; left: 0; right: 0; transform-style: preserve-3d; }
.fold-stage .lp-top { top: 0; height: var(--th); transform-origin: 50% 100%; animation: fold-down 700ms 1050ms cubic-bezier(.55, .05, .3, 1) both; }
.fold-stage .lp-mid { top: var(--th); height: var(--ph); }
.fold-stage .lp-bot { top: calc(var(--th) + var(--ph)); height: var(--ph); transform-origin: 50% 0; animation: fold-up 700ms 400ms cubic-bezier(.55, .05, .3, 1) both; }
.fold-stage .lf { position: absolute; inset: 0; background: var(--parchment); backface-visibility: hidden; -webkit-backface-visibility: hidden;
  overflow: hidden; box-shadow: 0 0 0 1px rgba(110, 75, 25, .18); }
.fold-stage .lf.back { transform: rotateX(180deg); background: var(--parchment-under); }
.fold-stage .lp-top .lf.back { background: var(--parchment); box-shadow: 0 0 0 1px rgba(110, 75, 25, .16), inset 0 -1px 0 rgba(120, 80, 25, .35), 0 2px 2px rgba(70, 45, 10, .22), 0 10px 16px -6px rgba(70, 45, 10, .5); }
.fold-stage .lp-mid .lf { box-shadow: 0 0 0 1px rgba(110, 75, 25, .18), 0 24px 50px -16px rgba(40, 30, 15, .4); }
.lt-clip { transform-origin: 0 0; pointer-events: none; }
.lt-clip > .doc { margin: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; color: #3b3428; }
.lt-clip > .doc h1, .lt-clip > .doc h2, .lt-clip > .doc strong { color: #2a251c; }
.fold-stage .lt-seal { position: absolute; left: 50%; top: calc(var(--th) * 2); width: var(--s); height: var(--s);
  margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2); transform: translateZ(6px); transform-style: preserve-3d; }
.fold-stage .seal { animation-duration: 900ms; animation-delay: 1850ms; }
.fold-stage .seal-shadow { animation-duration: 900ms; animation-delay: 1850ms; }
.fold-stage .seal-ring { animation-delay: 2250ms; animation-fill-mode: forwards; }
@keyframes letter-in { from { opacity: 0; transform: translateY(24px) scale(.96); } }
@keyframes fold-up   { from { transform: translateZ(0) rotateX(0deg); }  to { transform: translateZ(1px) rotateX(180deg); } }
@keyframes fold-down { from { transform: translateZ(0) rotateX(0deg); }  to { transform: translateZ(2px) rotateX(-180deg); } }

/* The sealed letter at rest (done screen hero): same proportions as the fold, the flap's edge overlapping, the
   seal across it. The signed copy sits beneath it, a little narrower. */
.sealed-letter { position: relative; width: var(--w, 560px); max-width: 100%; aspect-ratio: 1 / .42; margin: 0 auto calc(var(--s, 100px) / 2 + 18px); }
.sealed-letter .sl-body { position: absolute; inset: 0; background: url(/paper-deckle.webp) center / 100% 100% no-repeat;
  filter: drop-shadow(0 1px 1.5px rgba(60, 45, 25, .25)) drop-shadow(0 18px 26px rgba(40, 30, 15, .3)); }
.sealed-letter .sl-flap { position: absolute; left: 0; right: 0; top: 0; height: 33.333%; border-radius: 2px; background: var(--parchment);
  box-shadow: 0 0 0 1px rgba(110, 75, 25, .16), inset 0 -1px 0 rgba(120, 80, 25, .35), 0 2px 2px rgba(70, 45, 10, .22), 0 10px 16px -6px rgba(70, 45, 10, .5); }
.sealed-letter .sl-seal { position: absolute; left: 50%; top: 33.333%; width: var(--s, 100px); height: var(--s, 100px); transform: translate(-50%, -50%); }
.done-card:has(.sealed-letter) { padding-top: 28px; }
.signed-under { width: 94%; margin: 0 auto; }
@media (max-width: 560px) { .signed-under { width: 100%; } }

/* The flap's edge, made visible: a crisp line and the soft shadow it casts on the paper beneath. */
.sealed-letter .sl-flap::after, .fold-stage .lt-edge { content: ''; position: absolute; left: 0; right: 0; height: 16px;
  border-top: 1.5px solid rgba(110, 70, 20, .5); background: linear-gradient(rgba(70, 45, 10, .3), rgba(70, 45, 10, 0)); }
.sealed-letter .sl-flap::after { top: 100%; }
.fold-stage .lt-edge { top: calc(var(--th) * 2); transform: translateZ(3px); opacity: 0; animation: edge-in 200ms 1700ms forwards; }
@keyframes edge-in { to { opacity: 1; } }
