:root {
  color-scheme: light;
  --blue: #0055ff;
  --blue-dark: #003bb3;
  --navy: #061d49;
  --ink: #152238;
  --muted: #607087;
  --quiet: #8793a5;
  --line: #dce3ec;
  --line-strong: #c8d2df;
  --wash: #f3f6fa;
  --wash-blue: #edf4ff;
  --white: #ffffff;
  --green: #16845b;
  --green-wash: #e9f7f1;
  --amber: #a76813;
  --amber-wash: #fff5e6;
  --red: #bd3737;
  --red-wash: #fff0f0;
  --font-sans: "Avenir Next", Avenir, "Avenir LT Std", "Nunito Sans", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Avenir Next", Avenir, "Avenir LT Std", "Nunito Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Berkeley Mono", "SFMono-Regular", Consolas, monospace;
  font-family: var(--font-sans);
}

* { box-sizing: border-box; }
/* An author `display` rule outranks the UA's [hidden] rule, so state it explicitly.
   Without this a styled element with a hidden attribute renders anyway. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--wash); color: var(--ink); font-size: 14px; letter-spacing: 0; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select { color: inherit; font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }

.topbar, .landing-header {
  height: 68px; padding: 0 34px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.97);
  position: sticky; top: 0; z-index: 30;
}
.brand { display: inline-flex; align-items: center; gap: 11px; width: max-content; color: var(--navy); font-size: 16px; font-weight: 700; }
.brand-mark { width: 29px; height: 26px; display: block; object-fit: contain; }
.mini-brand { width: 18px; height: 16px; display: block; object-fit: contain; }
.brand small { color: var(--quiet); text-transform: uppercase; font-size: 9px; letter-spacing: .13em; margin-left: 3px; }
.topbar-context { color: var(--muted); font-size: 12px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 16px; }
.topbar nav, .landing-header nav { justify-self: end; display: flex; align-items: center; gap: 20px; color: #35445b; font-size: 12px; white-space: nowrap; }
.topbar nav a:hover, .landing-header nav a:hover, .text-link:hover, .table-toolbar a:hover { color: var(--blue); }
.theme-toggle { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 3px; background: var(--white); cursor: pointer; }
.theme-toggle span { width: 14px; height: 14px; display: block; position: relative; border: 2px solid var(--navy); border-radius: 50%; }
.theme-toggle span::after { content: ""; width: 10px; height: 10px; position: absolute; top: -3px; right: -5px; border-radius: 50%; background: var(--white); }
.theme-toggle:hover { border-color: #91b2f3; background: var(--wash-blue); }

.flash { width: min(1180px, calc(100% - 40px)); margin: 9px auto; padding: 12px 15px; border: 1px solid; border-radius: 3px; background: white; }
.flash.success { color: #176947; border-color: #9fd7bf; background: var(--green-wash); }
.flash.error { color: #9d2d2d; border-color: #e2abab; background: var(--red-wash); }

.page { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 52px 0 76px; }
.page.narrow { width: min(920px, calc(100% - 40px)); }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 44px; margin-bottom: 30px; }
.page-heading.split { align-items: center; }
.page-heading h1 { margin: 7px 0 8px; max-width: 100%; overflow-wrap: anywhere; color: var(--navy); font-size: 40px; line-height: 1.08; font-weight: 650; }
.page-heading p { color: var(--muted); margin: 0; max-width: 510px; overflow-wrap: anywhere; line-height: 1.55; }
.doc-filename { margin: 7px 0 4px; color: var(--muted); overflow-wrap: anywhere; font-size: 12px; }
.doc-meta { margin: 0; color: var(--quiet); font-size: 11px; }
.doc-meta .mono { color: var(--muted); }
.eyebrow, .section-kicker { display: block; color: var(--blue); text-transform: uppercase; font-size: 10px; letter-spacing: .15em; font-weight: 700; }
.mono, code { font-family: var(--font-mono); letter-spacing: 0; }
.subtle { color: var(--quiet); }

.primary, .secondary, .danger-button, .header-action, .button-light {
  min-height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: 3px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 12px; font-weight: 700;
}
.primary, .header-action { background: var(--blue); color: white; }
.primary:hover, .header-action:hover { background: var(--blue-dark); color: white !important; }
.secondary { color: #263851; background: white; border-color: var(--line-strong); }
.secondary:hover { color: var(--blue); border-color: #91b2f3; background: var(--wash-blue); }
.secondary.compact { min-height: 32px; padding: 0 11px; }
.primary.full { width: 100%; min-height: 46px; }
.button-row { display: flex; gap: 9px; }
.text-link { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 8px; }
.icon-button { width: 32px; height: 32px; border: 0; border-radius: 2px; background: transparent; color: var(--muted); font-size: 17px; line-height: 1; cursor: pointer; }
.icon-button:hover { color: var(--navy); background: var(--wash); }
.icon-button.danger:hover { color: var(--red); background: var(--red-wash); }

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.table-shell, .panel, .section-block, .verify-drop, .verification-result {
  border: 1px solid var(--line); border-radius: 3px; background: white; box-shadow: 0 8px 28px rgba(25,52,87,.04);
}
.table-toolbar { padding: 14px 18px; border-bottom: 1px solid var(--line); color: var(--quiet); font-size: 11px; display: flex; justify-content: space-between; }
.table-toolbar a { color: #41536c; }
.table-row { min-height: 70px; display: grid; grid-template-columns: minmax(240px, 2fr) 150px 110px 140px 24px; gap: 16px; align-items: center; padding: 12px 18px; border-bottom: 1px solid #e9edf2; }
.table-row:last-child { border-bottom: 0; }
a.table-row:hover { background: #f8faff; }
.table-row > span:first-child { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.table-row strong { color: var(--navy); white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.table-row small { color: var(--quiet); white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.table-head { min-height: 38px; color: var(--quiet); text-transform: uppercase; font-size: 9px; letter-spacing: .12em; }
.row-arrow { display: flex; justify-content: flex-end; color: var(--blue); }
.row-arrow svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.empty-state { text-align: center; padding: 82px 20px; }
.empty-mark { width: 42px; height: 42px; margin: 0 auto 16px; display: grid; place-items: center; border: 1px solid #a9c3f8; border-radius: 3px; background: var(--wash-blue); color: var(--blue); }
.empty-mark svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.empty-state h2 { color: var(--navy); margin: 0 0 7px; }
.empty-state p { color: var(--muted); margin: 0 0 24px; }

.status { display: inline-flex; align-items: center; width: max-content; border-radius: 2px; padding: 5px 7px; text-transform: uppercase; font-size: 8px; letter-spacing: .1em; font-weight: 700; border: 1px solid #ccd5e0; color: #536278; background: #f5f7fa; }
.status.completed, .status.signed { color: #176947; background: var(--green-wash); border-color: #a6d9c2; }
.status.in_progress, .status.opened { color: #8c570e; background: var(--amber-wash); border-color: #e9c58f; }
.status.voided, .status.declined { color: #9d2d2d; background: var(--red-wash); border-color: #e1aaaa; }

.form-stack { display: grid; gap: 16px; }
.section-block { padding: 25px; }
.section-title { display: grid; grid-template-columns: 30px 1fr; gap: 13px; align-items: start; margin-bottom: 21px; }
.section-title > span { width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid #b9cdf7; border-radius: 2px; background: var(--wash-blue); color: var(--blue); font-size: 9px; font-weight: 700; }
.section-title h2, .panel-header h2 { color: var(--navy); font-size: 15px; margin: 2px 0 4px; }
.section-title p, .panel-header p { margin: 0; color: var(--quiet); font-size: 11px; }
.section-title.row-title { grid-template-columns: 30px 1fr auto; }
.field-grid { display: grid; gap: 16px; }
.field-grid.two { grid-template-columns: 1fr 1fr; }
label { display: flex; flex-direction: column; gap: 7px; color: #43536a; font-size: 11px; font-weight: 650; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input:not([type]), select {
  width: 100%; height: 43px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 2px; outline: none; background: white; color: var(--ink);
}
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,85,255,.1); }
.file-field { position: relative; }
.file-field input { position: absolute; opacity: 0; pointer-events: none; }
.file-field span { height: 43px; padding: 0 12px; display: flex; align-items: center; border: 1px dashed #9baabd; border-radius: 2px; color: #43536a; background: #fbfcfe; cursor: pointer; }
.file-field.has-file span { border-style: solid; border-color: var(--green); color: #176947; background: var(--green-wash); }
.field-hint { color: var(--quiet); font-size: 11px; font-weight: 500; line-height: 1.45; }

.auth-page { width: min(430px, calc(100% - 40px)); margin: 0 auto; padding: 64px 0 76px; }
.auth-head { margin-bottom: 20px; }
.auth-head h1 { margin: 8px 0 9px; color: var(--navy); font-size: 30px; line-height: 1.12; font-weight: 650; }
.auth-head p { margin: 0; color: var(--muted); line-height: 1.55; }
.auth-card { padding: 24px; }
.auth-card .form-stack { gap: 15px; }
.auth-card .primary { margin-top: 3px; }
.auth-foot { margin: 16px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; text-align: center; }
.auth-foot a { color: var(--blue); font-weight: 650; }
.auth-foot a:hover { text-decoration: underline; }

.recipient-list { display: grid; gap: 10px; }
.recipient-row { display: grid; grid-template-columns: 28px 1.1fr 1.35fr 1fr 34px; gap: 10px; align-items: end; padding: 14px; border: 1px solid var(--line); background: #fafbfd; border-radius: 2px; }
.recipient-number { width: 26px; height: 43px; display: grid; place-items: center; color: var(--quiet); font-family: monospace; }
.inline-section { display: flex; align-items: center; justify-content: space-between; }
.inline-section .section-title { margin: 0; }
.segmented { display: inline-flex; padding: 3px; gap: 3px; border: 1px solid var(--line-strong); border-radius: 3px; background: var(--wash); }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; }
.segmented span, .segmented button { min-width: 94px; height: 32px; padding: 0 12px; border: 0; border-radius: 2px; display: grid; place-items: center; background: transparent; color: var(--muted); cursor: pointer; }
.segmented input:checked + span, .segmented button.active { color: white; background: var(--navy); }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 8px; }

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 18px; border: 1px solid var(--line); border-radius: 3px; background: white; }
.metrics div { display: flex; flex-direction: column; gap: 5px; padding: 19px 20px; border-right: 1px solid var(--line); }
.metrics div:last-child { border-right: 0; }
.metrics strong { color: var(--navy); font-size: 18px; }
.metrics span { color: var(--quiet); text-transform: uppercase; font-size: 9px; letter-spacing: .12em; }
.content-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; align-items: start; }
.panel-header { min-height: 68px; padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.subtle-key-link { padding-bottom: 2px; border-bottom: 1px solid var(--line-strong); color: var(--muted); font-size: 10px; }
.subtle-key-link:hover { color: var(--blue); }
.recipient-cards { padding: 8px 18px; }
.recipient-card { display: grid; grid-template-columns: 38px minmax(160px, 1fr) auto; gap: 12px; align-items: center; padding: 15px 0; border-bottom: 1px solid #e9edf2; }
.recipient-card:last-child { border-bottom: 0; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--blue); background: var(--wash-blue); border: 1px solid #b9cdf7; font-size: 11px; font-weight: 700; }
.avatar.large { width: 43px; height: 43px; }
.recipient-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.recipient-main strong { color: var(--navy); }
.recipient-main span { color: var(--muted); font-size: 11px; }
.recipient-main small { color: var(--quiet); }
.invite-control { grid-column: 2 / 4; display: flex; gap: 7px; align-items: center; }
.invite-control small { color: var(--quiet); font-size: 10px; white-space: nowrap; }
.invite-control input { flex: 1; height: 34px; font-family: monospace; font-size: 10px; color: #526178; }
.signed-time { color: var(--quiet); font-size: 10px; }
.audit-list { padding: 8px 18px; max-height: 480px; overflow: auto; }
.audit-event { display: grid; grid-template-columns: 12px 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid #e9edf2; }
.event-dot { width: 7px; height: 7px; margin-top: 5px; border: 2px solid var(--blue); border-radius: 50%; }
.audit-event div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.audit-event strong { color: var(--navy); font-size: 11px; }
.audit-event span, .audit-event small { color: var(--quiet); font-size: 9px; line-height: 1.45; }
.audit-event small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.danger-zone { display: flex; justify-content: flex-end; margin-top: 18px; }
.danger-button { color: var(--red); border-color: #dda3a3; background: white; }
.danger-button:hover { background: var(--red-wash); }

/* The signing and prepare layouts own the viewport and scroll inside their own panes.
   Laying them out as flex children means a flash banner shortens them rather than
   pushing them off-screen; below the mobile breakpoint the page scrolls normally. */
body:has(.signing-shell), body:has(.prepare-page) { display: flex; flex-direction: column; }
body:has(.signing-shell) #field-sign-form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
@media (min-width: 681px) {
  body:has(.signing-shell), body:has(.prepare-page) { height: 100vh; overflow: hidden; }
  body:has(.signing-shell) .signing-shell, body:has(.prepare-page) .prepare-page { flex: 1; height: auto; min-height: 0; }
}

.signing-shell { height: calc(100vh - 68px); display: grid; grid-template-columns: 172px minmax(0, 1fr) 336px; grid-template-rows: minmax(0, 1fr); overflow: hidden; background: white; }
.document-rail, .action-panel { background: white; }
.document-rail { padding: 18px 14px; border-right: 1px solid var(--line); overflow-y: auto; }
.rail-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 13px; color: var(--quiet); text-transform: uppercase; font-size: 9px; letter-spacing: .15em; font-weight: 700; }
.rail-label span { color: var(--muted); letter-spacing: .04em; }
.page-thumb { width: 100%; margin-bottom: 11px; padding: 0; display: block; position: relative; border: 1px solid var(--line-strong); border-radius: 2px; background: #f7f5ee; overflow: hidden; cursor: pointer; }
.page-thumb img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1.29; object-fit: contain; background: #f7f5ee; }
.page-thumb small { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 5px 7px; border-top: 1px solid var(--line); color: #64718a; background: white; font-size: 9px; }
.page-thumb small b { min-width: 15px; height: 15px; padding: 0 4px; display: grid; place-items: center; border-radius: 8px; color: white; background: var(--blue); font-size: 8px; }
.page-thumb:hover { border-color: #91b2f3; }
.page-thumb.active { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(0,85,255,.18); }
.rail-hash { display: flex; flex-direction: column; gap: 5px; margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); color: var(--quiet); font-size: 9px; }
.rail-hash code { color: #536278; }

.document-stage { min-width: 0; padding: 14px 20px 20px; display: flex; flex-direction: column; background: #e9edf2; }
.viewer-toolbar { min-height: 44px; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-bottom: 10px; color: #536278; font-size: 11px; }
.viewer-file { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.viewer-file strong { color: var(--navy); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-file small { color: var(--quiet); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.page-stepper { display: inline-flex; align-items: center; border: 1px solid #bec8d5; border-radius: 2px; background: white; overflow: hidden; }
.page-stepper button { width: 24px; height: 28px; border: 0; background: transparent; color: #41536c; cursor: pointer; font-size: 15px; line-height: 1; }
.page-stepper button:hover:not(:disabled) { color: var(--blue); background: var(--wash-blue); }
.page-stepper button:disabled { color: var(--quiet); cursor: default; }
.page-indicator { color: var(--muted); font-size: 10px; white-space: nowrap; }
.page-stepper .page-indicator { padding: 0 8px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.page-indicator b { color: var(--navy); }
.zoom-group { display: inline-flex; align-items: center; border: 1px solid #bec8d5; border-radius: 2px; background: white; overflow: hidden; }
.zoom-group button { width: 26px; height: 28px; border: 0; background: transparent; color: #41536c; cursor: pointer; font-size: 14px; line-height: 1; }
.zoom-group button:hover { color: var(--blue); background: var(--wash-blue); }
.zoom-group b { min-width: 42px; padding: 0 4px; text-align: center; border-left: 1px solid var(--line); border-right: 1px solid var(--line); color: var(--muted); font-size: 10px; font-weight: 600; }
.toolbar-button { height: 28px; padding: 0 10px; display: inline-flex; align-items: center; border: 1px solid #bec8d5; border-radius: 2px; background: white; color: #41536c; font-size: 11px; cursor: pointer; }
.toolbar-button:hover { color: var(--blue); border-color: #91b2f3; }
.page-preview { flex: 1; min-height: 0; padding: 18px; display: flex; justify-content: center; align-items: flex-start; overflow: auto; border: 1px solid #c9d1dc; border-radius: 2px; background: #dfe4ea; }
.pdf-frame { display: block; width: min(100%, 1020px); height: auto; border: 0; background: #f8f6f0; box-shadow: 0 12px 32px rgba(35,52,75,.18); }

.action-panel { display: flex; flex-direction: column; min-height: 0; padding: 0; border-left: 1px solid var(--line); }
.signer-identity { display: flex; gap: 12px; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.signer-identity div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.signer-identity small, .signer-identity span { color: var(--quiet); font-size: 10px; overflow: hidden; text-overflow: ellipsis; }
.signer-identity strong { color: var(--navy); font-size: 12px; }
.progress-block { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.progress-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; color: var(--muted); font-size: 11px; font-weight: 650; }
.progress-badge { padding: 4px 7px; border: 1px solid var(--line-strong); border-radius: 2px; color: #536278; background: var(--wash); text-transform: uppercase; font-size: 8px; letter-spacing: .1em; font-weight: 700; }
.progress-badge.ready { color: #176947; border-color: #a6d9c2; background: var(--green-wash); }
.progress-track { height: 5px; overflow: hidden; border-radius: 3px; background: #e3e8ef; }
.progress-track span { display: block; height: 100%; background: var(--blue); transition: width .3s ease; }
.progress-foot { display: flex; justify-content: space-between; margin-top: 8px; color: var(--quiet); font-size: 10px; }
.field-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px 20px 0; }
.field-nav button { width: 100%; }
.sign-field-list { flex: 1; min-height: 0; display: grid; align-content: start; gap: 8px; padding: 14px 20px; overflow-y: auto; }
.sign-field-entry { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; padding: 11px; border: 1px solid var(--line); border-radius: 3px; cursor: pointer; }
.sign-field-entry:hover { border-color: #a9c3f8; background: #fbfcff; }
.sign-field-entry.active { border-color: var(--blue); background: var(--wash-blue); box-shadow: 0 0 0 2px rgba(0,85,255,.12); }
.sign-field-entry.done { border-color: #8fcbb0; background: var(--green-wash); }
.field-icon { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 3px; color: var(--blue); background: var(--wash-blue); border: 1px solid #c3d5f8; }
.field-icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sign-field-entry.done .field-icon { color: var(--green); border-color: #a6d9c2; background: #d9f0e6; }
.sign-field-entry.active .field-icon { color: white; border-color: var(--blue); background: var(--blue); }
.sign-field-control { min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.sign-field-head { display: flex; flex-direction: column; gap: 3px; }
.sign-field-control strong { color: var(--navy); font-size: 11px; }
.sign-field-control small, .signature-pending { color: var(--quiet); font-size: 9px; }
.field-recorded { color: #176947; font-size: 10px; overflow-wrap: anywhere; }
.sign-field-control input[type="text"], .sign-field-control input[type="date"] { height: 34px; font-size: 11px; }
.date-control { display: flex; gap: 6px; align-items: center; }
.date-control input { flex: 1; min-width: 0; }
.date-control button { flex: none; }
.secondary.full { width: 100%; min-height: 40px; margin-bottom: 8px; }
.check-field { min-height: 30px; flex-direction: row; align-items: center; gap: 8px; font-size: 10px; }
.check-field input { accent-color: var(--blue); }
.panel-footer { padding: 14px 20px 18px; border-top: 1px solid var(--line); background: white; }
.sign-trigger.ready { background: var(--green); }
.sign-trigger.ready:hover { background: #10704c; }
.panel-note { margin: 12px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.notice { margin-bottom: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 2px; }
.notice strong { color: var(--navy); font-size: 11px; }
.notice p { margin: 6px 0 0; color: var(--muted); line-height: 1.45; font-size: 10px; }
.notice.success { border-color: #8fcbb0; background: var(--green-wash); }
.notice.warning { border-color: #dfbb84; background: var(--amber-wash); }

.mobile-action-bar { display: none; }

dialog { color: var(--ink); }
.signature-dialog { width: min(560px, calc(100% - 30px)); max-height: min(880px, calc(100vh - 40px)); padding: 0; border: 1px solid var(--line-strong); border-radius: 3px; background: white; box-shadow: 0 30px 90px rgba(10,31,67,.24); }
.signature-dialog::backdrop { background: rgba(5,25,58,.66); backdrop-filter: blur(3px); }
.signature-form { padding: 24px; }
.dialog-header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 18px; }
.dialog-header h2 { margin: 4px 0 0; color: var(--navy); font-size: 20px; }
.document-binding { display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; padding: 12px; border: 1px solid var(--line); border-radius: 2px; background: var(--wash); }
.document-binding span { color: var(--quiet); text-transform: uppercase; font-size: 8px; letter-spacing: .12em; }
.document-binding code { color: #526178; overflow-wrap: anywhere; font-size: 9px; }
.signature-tabs { margin-bottom: 16px; }
.typed-preview { height: 112px; margin: 12px 0 16px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 2px; background: #f7f5ee; color: #1f2a3c; font-family: Georgia, "Times New Roman", serif; font-size: 36px; font-style: italic; }
#signature-canvas { width: 100%; height: 150px; display: block; border: 1px solid var(--line); border-radius: 2px; background: #f7f5ee; touch-action: none; }
.mark-size { margin-top: 16px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 2px; background: var(--wash); }
.mark-size label { flex-direction: row; justify-content: space-between; align-items: center; margin-bottom: 9px; }
.mark-size output { color: var(--navy); font-family: var(--font-mono); font-size: 11px; }
.mark-size input[type="range"] { width: 100%; height: 20px; padding: 0; accent-color: var(--blue); cursor: pointer; }
.mark-size p { margin: 9px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.consent { flex-direction: row; align-items: flex-start; gap: 10px; margin: 18px 0 10px; font-size: 11px; line-height: 1.45; }
.consent input { margin-top: 2px; accent-color: var(--blue); }
.legal-note { padding: 10px; border-left: 2px solid #b8c4d3; color: var(--muted); font-size: 9px; line-height: 1.5; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.dialog-actions .primary:disabled { opacity: .45; cursor: not-allowed; background: var(--blue); }
.history-dialog { width: min(560px, calc(100% - 30px)); max-height: calc(100vh - 40px); padding: 22px 24px; border: 1px solid var(--line-strong); border-radius: 3px; background: white; box-shadow: 0 30px 90px rgba(10,31,67,.24); }
.history-dialog::backdrop { background: rgba(5,25,58,.66); backdrop-filter: blur(3px); }
.history-dialog .audit-list { padding: 0; margin-top: 4px; max-height: 46vh; }

.verify-drop { padding: 24px; display: flex; gap: 18px; align-items: end; }
.verify-drop .file-field { flex: 1; gap: 10px; }
.verify-drop .file-field strong { color: var(--navy); font-size: 12px; }
.verification-result { margin-top: 18px; overflow: hidden; }
.verification-result.valid { border-color: #8fcbb0; }
.verification-result.invalid { border-color: #dda3a3; }
.verification-heading { padding: 18px; display: flex; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); }
.verification-heading > span, .check-state { padding: 5px 7px; border-radius: 2px; font-size: 8px; letter-spacing: .1em; font-weight: 800; }
.verification-heading > span, .check-state.pass { background: var(--green-wash); color: #176947; }
.verification-result.invalid .verification-heading > span, .check-state.fail { background: var(--red-wash); color: #9d2d2d; }
.verification-heading h2 { margin: 0 0 3px; color: var(--navy); font-size: 15px; }
.verification-heading p { margin: 0; color: var(--quiet); font-size: 10px; }
.check-list > div { display: grid; grid-template-columns: 48px 190px 1fr; gap: 10px; align-items: center; padding: 12px 18px; border-bottom: 1px solid #e9edf2; }
.check-list strong { color: var(--navy); font-family: monospace; font-size: 10px; }
.check-list p { margin: 0; color: var(--muted); font-size: 10px; }
.verification-note { margin: 12px 18px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.error-page { padding: 10px 0 10px 24px; border-left: 3px solid var(--red); }
.error-page > span { color: var(--red); text-transform: uppercase; font-size: 9px; letter-spacing: .13em; }
.error-page h1 { max-width: 700px; color: var(--navy); font-size: 28px; }
.error-page p { margin-bottom: 24px; color: var(--muted); }

.prepare-page { height: calc(100vh - 68px); overflow: hidden; }
.prepare-shell { height: 100%; display: grid; grid-template-columns: 250px minmax(0, 1fr) 310px; grid-template-rows: minmax(0, 1fr); }
.prepare-tools, .prepare-summary { min-width: 0; background: var(--white); overflow-y: auto; }
.prepare-tools { padding: 24px 20px; border-right: 1px solid var(--line); }
.prepare-tools > div:first-child { margin-bottom: 24px; }
.prepare-tools h1 { margin: 7px 0 8px; color: var(--navy); font-size: 21px; line-height: 1.18; overflow-wrap: anywhere; }
.prepare-tools p { color: var(--muted); line-height: 1.5; }
.prepare-tools > label { margin-top: 15px; }
.prepare-tools .primary { margin-top: 18px; }
.prepare-stage { min-height: 0; }
.prepare-preview { align-items: flex-start; }
.pdf-surface { width: 100%; max-width: 1020px; position: relative; flex: 1 1 100%; }
.pdf-surface .pdf-frame { width: 100%; }
.field-overlay-layer { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
/* The outline is an inset shadow rather than a border so it never shrinks the content
   box: a mark must be free to fill the exact field the PDF renderer will fill. */
.placed-field, .sign-field-overlay {
  position: absolute; z-index: 2; min-width: 8px; min-height: 8px; padding: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: flex-start; line-height: 1;
  border: 0; border-radius: 2px; box-shadow: inset 0 0 0 1px #427bdf;
  color: #073485; background: rgba(222,235,255,.85);
  font-weight: 400; text-align: left; white-space: nowrap; cursor: move; pointer-events: auto; touch-action: none;
}
/* Placed labels and adopted marks are drawn in the same families the PDF renderer
   prefers, at the same point size, so the page on screen matches the page it makes. */
.placed-field, .adopted-mark, .sign-field-overlay .field-value {
  font-family: "DejaVu Serif", "Liberation Serif", Georgia, "Times New Roman", serif;
}
.placed-field.field-text, .placed-field.field-date,
.sign-field-overlay.field-text .field-value, .sign-field-overlay.field-date .field-value {
  font-family: "DejaVu Sans", "Liberation Sans", Helvetica, Arial, sans-serif; font-style: normal;
}
.placed-field.field-signature, .placed-field.field-initials { font-style: italic; }
.placed-field.selected { background: rgba(0,85,255,.16); box-shadow: inset 0 0 0 1px var(--navy), 0 0 0 2px rgba(0,85,255,.3); }
.placed-field.field-checkbox, .sign-field-overlay.field-checkbox { justify-content: center; }
.prepared-field-row.selected { background: var(--wash-blue); box-shadow: inset 3px 0 0 var(--blue); }
.prepared-field-row.selected strong { color: var(--blue-dark); }
.sign-field-overlay { cursor: pointer; }
.sign-field-overlay.complete { color: #116547; box-shadow: inset 0 0 0 1px #4eb18a; background: rgba(227,247,238,.94); }
.sign-field-overlay.active:not(.complete) { color: white; background: rgba(0,85,255,.92); box-shadow: inset 0 0 0 1px var(--blue-dark), 0 0 0 4px rgba(0,85,255,.22); }
.sign-field-overlay.adopted { background: rgba(255,255,255,.55); box-shadow: inset 0 0 0 1px rgba(78,177,138,.7); }
.sign-field-overlay img { display: block; flex: none; }
.sign-field-overlay .field-label { padding: 0; overflow: hidden; text-overflow: ellipsis; font-size: 10px; font-weight: 700; }
.sign-field-overlay .field-value { color: #16233c; line-height: 1; }
.sign-field-overlay.field-signature .field-value, .sign-field-overlay.field-initials .field-value { font-style: italic; }

.check-mark { width: 100%; height: 100%; fill: none; stroke: #16233c; stroke-width: 11; stroke-linecap: round; stroke-linejoin: round; }

/* Review mode: the same marks, without any of the editing chrome around them. */
.review-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; padding: 10px 14px; border: 1px solid #a6d9c2; border-radius: 3px; background: var(--green-wash); }
.review-banner strong { display: block; color: #14603f; font-size: 12px; }
.review-banner span { color: #2f7255; font-size: 10px; }
.signing-shell.reviewing .sign-field-overlay { box-shadow: none; background: transparent; cursor: default; }
.signing-shell.reviewing .sign-field-overlay.adopted { background: transparent; }
.signing-shell.reviewing .field-nav, .signing-shell.reviewing .sign-field-entry { opacity: .55; pointer-events: none; }
.sign-field-overlay span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-switcher { min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.page-switcher button { width: 30px; height: 30px; border: 1px solid var(--line-strong); border-radius: 2px; background: var(--white); color: var(--muted); cursor: pointer; }
.page-switcher button.active { color: white; border-color: var(--blue); background: var(--blue); }
.prepare-summary { display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.prepared-field-list { flex: 1; padding: 8px 18px; overflow-y: auto; }
.empty-fields { padding: 28px 6px; color: var(--quiet); font-size: 11px; line-height: 1.5; }
.prepared-field-row { min-height: 58px; display: grid; grid-template-columns: 26px 1fr 32px; gap: 9px; align-items: center; border-bottom: 1px solid var(--line); }
.prepared-field-row > div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.prepared-field-row strong { color: var(--navy); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prepared-field-row small { color: var(--quiet); font-size: 9px; }
.prepare-actions { padding: 18px; display: grid; gap: 8px; border-top: 1px solid var(--line); }
.upload-preview { min-height: 96px; margin: 12px 0 0; display: grid; place-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 2px; background: #f7f5ee; color: var(--quiet); font-size: 10px; }
.upload-preview:empty::before { content: attr(data-empty); }
.upload-preview.error { color: #9d2d2d; border-color: #e1aaaa; background: var(--red-wash); text-align: center; line-height: 1.5; }
.upload-preview img { max-width: 100%; max-height: 120px; }
.upload-note { margin: 12px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.prepare-warning { margin: 0 0 4px; padding: 9px 11px; border: 1px solid #e1aaaa; border-radius: 2px; color: #9d2d2d; background: var(--red-wash); font-size: 10px; line-height: 1.45; }
.prepare-actions .text-link { text-align: center; }

html[data-theme="dark"] {
  color-scheme: dark;
  --navy: #f2f6ff;
  --ink: #e2e9f4;
  --muted: #aab6c9;
  --quiet: #8492a8;
  --line: #293a51;
  --line-strong: #3b4d66;
  --wash: #09121f;
  --wash-blue: #10264a;
  --white: #111d2d;
  --green-wash: #102d26;
  --amber-wash: #302612;
  --red-wash: #321a20;
}
html[data-theme="dark"] body { background: var(--wash); }
html[data-theme="dark"] .topbar { background: rgba(13,25,41,.98); }
html[data-theme="dark"] .topbar nav { color: #b7c2d2; }
html[data-theme="dark"] .theme-toggle span { border-color: #f5c75c; background: #f5c75c; box-shadow: 0 -6px 0 -5px #f5c75c, 0 6px 0 -5px #f5c75c, 6px 0 0 -5px #f5c75c, -6px 0 0 -5px #f5c75c; }
html[data-theme="dark"] .theme-toggle span::after { display: none; }
html[data-theme="dark"] .flash,
html[data-theme="dark"] .table-shell,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .section-block,
html[data-theme="dark"] .verify-drop,
html[data-theme="dark"] .verification-result,
html[data-theme="dark"] .metrics,
html[data-theme="dark"] .secondary,
html[data-theme="dark"] .danger-button,
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input:not([type]),
html[data-theme="dark"] select,
html[data-theme="dark"] .document-rail,
html[data-theme="dark"] .action-panel,
html[data-theme="dark"] .signature-dialog { background: var(--white); }
html[data-theme="dark"] .table-toolbar a,
html[data-theme="dark"] label,
html[data-theme="dark"] .file-field span { color: #b8c4d5; }
html[data-theme="dark"] .secondary { color: #c9d4e4; }
html[data-theme="dark"] .danger-button { color: #ef969f; }
html[data-theme="dark"] .table-row,
html[data-theme="dark"] .recipient-card,
html[data-theme="dark"] .audit-event,
html[data-theme="dark"] .check-list > div { border-bottom-color: var(--line); }
html[data-theme="dark"] a.table-row:hover { background: #142238; }
html[data-theme="dark"] .recipient-row,
html[data-theme="dark"] .file-field span { background: #0d1928; }
html[data-theme="dark"] .status { color: #b6c2d3; background: #182538; border-color: #42536b; }
html[data-theme="dark"] .status.completed,
html[data-theme="dark"] .status.signed { color: #77d5ae; }
html[data-theme="dark"] .status.in_progress,
html[data-theme="dark"] .status.opened { color: #ebbd70; }
html[data-theme="dark"] .status.voided,
html[data-theme="dark"] .status.declined { color: #ef969f; }
html[data-theme="dark"] .segmented { background: #0b1726; }
html[data-theme="dark"] .segmented input:checked + span,
html[data-theme="dark"] .segmented button.active { background: #e7eefb; color: #07162d; }
html[data-theme="dark"] .signing-shell { background: var(--white); }
html[data-theme="dark"] .document-stage { background: #101a28; }
html[data-theme="dark"] .page-preview { border-color: #314158; background: #0a1320; }
html[data-theme="dark"] .viewer-toolbar { color: #a9b5c7; }
html[data-theme="dark"] .viewer-toolbar a,
html[data-theme="dark"] .document-binding { background: #0d1928; }
html[data-theme="dark"] .typed-preview,
html[data-theme="dark"] .upload-preview,
html[data-theme="dark"] .mark-size,
html[data-theme="dark"] #signature-canvas,
html[data-theme="dark"] .page-thumb { background: #f5f1e8; color: #1f2a3c; }
html[data-theme="dark"] .legal-note { border-left-color: #52627a; }
html[data-theme="dark"] .prepare-tools,
html[data-theme="dark"] .prepare-summary { background: var(--white); }
html[data-theme="dark"] .placed-field,
html[data-theme="dark"] .sign-field-overlay { color: #c7daff; box-shadow: inset 0 0 0 1px #4f7bd0; background: rgba(20,50,96,.94); }
html[data-theme="dark"] .sign-field-overlay.complete { color: #79d9b2; box-shadow: inset 0 0 0 1px #3d8e71; background: rgba(15,49,40,.95); }
html[data-theme="dark"] .page-thumb small,
html[data-theme="dark"] .panel-footer,
html[data-theme="dark"] .mobile-action-bar,
html[data-theme="dark"] .history-dialog,
html[data-theme="dark"] .zoom-group,
html[data-theme="dark"] .page-stepper,
html[data-theme="dark"] .toolbar-button { color: #c2cddd; background: var(--white); border-color: var(--line-strong); }
html[data-theme="dark"] .zoom-group button, html[data-theme="dark"] .page-stepper button { color: #c2cddd; }
html[data-theme="dark"] .page-stepper .page-indicator { border-color: var(--line); }
html[data-theme="dark"] .zoom-group b { color: var(--muted); border-color: var(--line); }
html[data-theme="dark"] .progress-badge { color: #b6c2d3; background: #182538; border-color: #42536b; }
html[data-theme="dark"] .progress-badge.ready { color: #77d5ae; border-color: #2f7f60; background: var(--green-wash); }
html[data-theme="dark"] .progress-track { background: #1d2b40; }
html[data-theme="dark"] .sign-field-entry:hover { border-color: #3f5f96; background: #142238; }
html[data-theme="dark"] .sign-field-entry.active { border-color: #4d84e8; background: var(--wash-blue); }
html[data-theme="dark"] .sign-field-entry.done { border-color: #2f7f60; background: var(--green-wash); }
html[data-theme="dark"] .field-icon { color: #9dbbff; border-color: #35507d; background: #16243c; }
html[data-theme="dark"] .sign-field-entry.done .field-icon { color: #77d5ae; border-color: #2f7f60; background: #123328; }
html[data-theme="dark"] .field-recorded { color: #77d5ae; }
html[data-theme="dark"] .sign-field-overlay.adopted { background: rgba(255,255,255,.5); }
html[data-theme="dark"] .review-banner { border-color: #2f7f60; background: var(--green-wash); }
html[data-theme="dark"] .review-banner strong { color: #77d5ae; }
html[data-theme="dark"] .review-banner span { color: #9fc7b4; }

.landing { background: white; }
.landing-header { grid-template-columns: 1fr auto; height: 78px; position: relative; padding: 0 64px; }
.landing-header nav { gap: 36px; color: #7a8798; font-size: 14px; font-weight: 700; }
.landing-header .header-action { min-height: 42px; padding: 0 18px; font-size: 13px; font-weight: 700; }
.product-hero { min-height: min(760px, calc(100svh - 116px)); padding: 68px 56px 0; display: flex; flex-direction: column; justify-content: space-between; color: white; background: var(--navy); }
.hero-inner { width: min(1180px, 100%); margin: 0 auto; }
.hero-brand { display: block; margin-bottom: 26px; color: #9dbbff; text-transform: uppercase; font-size: 11px; letter-spacing: .11em; font-weight: 700; }
.product-hero h1 { max-width: 1080px; margin: 0; color: #f6f8fc; font-family: var(--font-display); font-size: 84px; line-height: .98; font-weight: 500; }
.product-hero p { max-width: 580px; margin: 28px 0 0; color: #c7d3e7; font-size: 19px; line-height: 1.5; }
.hero-actions { display: flex; align-items: center; gap: 28px; margin-top: 32px; }
.button-light { min-height: 50px; gap: 34px; background: white; color: var(--navy); }
.button-light:hover { background: #e8efff; }
.button-link-light { padding-bottom: 4px; border-bottom: 1px solid #7698db; color: #dbe5f8; font-size: 13px; font-weight: 700; }
.hero-workflow { width: min(1180px, 100%); margin: 58px auto 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid #36517e; }
.hero-workflow div { min-height: 126px; padding: 22px 22px 22px 0; display: grid; align-content: start; border-right: 1px solid #36517e; }
.hero-workflow div + div { padding-left: 22px; }
.hero-workflow div:last-child { border-right: 0; }
.hero-workflow strong { color: white; font-size: 14px; font-weight: 700; }
.hero-workflow small { margin-top: 7px; color: #9eafc9; font-size: 11px; line-height: 1.45; }
.how-section { width: min(1180px, calc(100% - 64px)); margin: 0 auto; padding: 104px 0 112px; }
.how-heading { display: grid; grid-template-columns: 1.1fr .9fr; gap: 90px; align-items: end; margin: 20px 0 55px; }
.how-heading h2 { max-width: 680px; margin: 0; color: var(--navy); font-family: var(--font-display); font-size: 48px; line-height: 1.08; font-weight: 600; }
.how-heading p { margin: 0; color: var(--muted); line-height: 1.7; }
.product-window { border: 1px solid #cdd7e4; background: #e8edf3; box-shadow: 0 24px 64px rgba(19,48,91,.13); }
.window-bar { height: 56px; padding: 0 20px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); background: white; }
.mini-brand { width: 22px; height: 20px; }
.window-bar strong { color: var(--navy); font-size: 12px; }
.window-bar small { margin-left: auto; padding: 4px 7px; border: 1px solid #a8d5c0; color: var(--green); background: var(--green-wash); text-transform: uppercase; font-size: 8px; letter-spacing: .08em; }
.window-body { min-height: 500px; padding: 38px; display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; }
.document-sheet { width: min(640px, 100%); min-height: 420px; margin: 0 auto; padding: 58px 64px; background: #fffefa; box-shadow: 0 12px 30px rgba(31,48,73,.15); }
.sheet-title { width: 62%; height: 20px; margin: 28px 0 48px; background: #193560; }
.sheet-rule { height: 5px; margin: 14px 0; background: #d4dae1; }
.sheet-rule.short { width: 24%; background: var(--blue); }
.sheet-rule.medium { width: 72%; }
.sheet-signatures { margin-top: 125px; display: grid; grid-template-columns: 1fr 1fr; gap: 36px; color: #7b8798; font-size: 9px; }
.sheet-signatures span { padding-top: 8px; border-top: 1px solid #68788d; }
.window-panel { padding: 24px; border: 1px solid var(--line); background: white; }
.window-label { display: block; margin-bottom: 18px; color: var(--quiet); text-transform: uppercase; font-size: 9px; letter-spacing: .13em; }
.person-line { padding: 14px 0; display: grid; grid-template-columns: 32px 1fr 20px; gap: 10px; align-items: center; border-bottom: 1px solid var(--line); }
.person-line b { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: var(--blue); background: var(--wash-blue); font-size: 9px; }
.person-line span { display: flex; flex-direction: column; gap: 3px; }
.person-line strong { color: var(--navy); font-size: 10px; }
.person-line small { color: var(--quiet); font-size: 9px; }
.person-line i { color: var(--blue); font-style: normal; font-size: 10px; }
.window-button { height: 43px; margin-top: 28px; display: grid; place-items: center; border-radius: 2px; color: white; background: var(--blue); font-size: 11px; font-weight: 700; }
/* --- Landing walkthrough: one document, four states ---------------------- */
.walkthrough { display: grid; gap: 14px; }
.walkthrough .product-window { margin: 0; }
.window-bar small.walk-status { transition: color .25s ease, background .25s ease, border-color .25s ease; }
.window-bar small.walk-status.is-draft { color: #536278; background: var(--wash); border-color: #ccd5e0; }
.window-bar small.walk-status.is-ready { color: var(--blue); background: var(--wash-blue); border-color: #b9cdf7; }
.window-bar small.walk-status.is-awaiting { color: #8c570e; background: var(--amber-wash); border-color: #e9c58f; }
.window-bar small.walk-status.is-done { color: var(--green); background: var(--green-wash); border-color: #a8d5c0; }

.window-body { position: relative; }
.walk-panel { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; animation: walk-in .45s cubic-bezier(.16,1,.3,1) both; }
@keyframes walk-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.walk-panel:focus-visible { outline: 2px solid var(--blue); outline-offset: 6px; }

.walk-file { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.walk-file b { height: 34px; display: grid; place-items: center; border-radius: 2px; color: var(--blue); background: var(--wash-blue); border: 1px solid #b9cdf7; font-size: 8px; letter-spacing: .06em; }
.walk-file span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.walk-file strong { color: var(--navy); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.walk-file small { color: var(--quiet); font-size: 9px; }
.walk-fact { display: flex; flex-direction: column; gap: 5px; padding: 12px 0; }
.walk-fact span { color: var(--quiet); text-transform: uppercase; font-size: 8px; letter-spacing: .12em; }
.walk-fact code { color: #536278; font-size: 9px; }
.walk-note { margin: 14px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }

.walk-progress-block { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.walk-progress-block > div:first-child { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; color: var(--muted); font-size: 10px; }
.walk-progress-block b { color: var(--navy); font-family: var(--font-mono); font-size: 10px; }
.walk-track { height: 4px; border-radius: 2px; background: #e3e8ef; overflow: hidden; }
.walk-track i { display: block; height: 100%; background: var(--blue); }
.walk-check { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid #eef1f5; }
.walk-check:last-of-type { border-bottom: 0; }
.walk-check b { height: 20px; display: grid; place-items: center; border-radius: 2px; color: #536278; background: var(--wash); border: 1px solid #ccd5e0; font-size: 8px; font-weight: 800; letter-spacing: .06em; }
.walk-check span { color: #43536a; font-size: 10px; }
.walk-check.done b, .walk-check.pass b { color: #176947; background: var(--green-wash); border-color: #a6d9c2; }
.walk-check.done span, .walk-check.pass span { color: var(--navy); }

.sheet-field { height: 34px; margin: 18px 0 14px; display: flex; align-items: center; padding: 0 10px; border-radius: 2px; color: #073485; background: rgba(222,235,255,.85); box-shadow: inset 0 0 0 1px #427bdf; font-size: 9px; font-weight: 700; }
.sheet-signatures .marked { border-top-color: var(--blue); color: var(--blue); }
.document-sheet.signed .sheet-signatures span { border-top-color: #8fcbb0; }
.sheet-signatures .signed-mark { color: #1f2a3c; font-family: Georgia, "Times New Roman", serif; font-size: 15px; font-style: italic; }

.walk-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 0; padding: 0; list-style: none; }
.walk-steps button { position: relative; width: 100%; padding: 15px 16px 17px; display: grid; gap: 4px; text-align: left; border: 1px solid var(--line); border-radius: 3px; background: white; cursor: pointer; transition: border-color .2s ease, background .2s ease; }
.walk-steps button:hover { border-color: #a9c3f8; background: #fbfcff; }
.walk-steps button strong { color: var(--navy); font-size: 12px; }
.walk-steps button small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.walk-steps button.active { border-color: #7ea5f4; background: var(--wash-blue); }
.walk-steps button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
/* The bar is a full-width active marker by default; auto-advance animates it filling,
   which is what tells the reader the panel is about to change. A keyframe rather than a
   transition, so re-adding the class restarts it cleanly. */
.walk-bar { position: absolute; inset: auto 0 0 0; height: 2px; background: var(--blue); transform: scaleX(0); transform-origin: left; }
.walk-steps button.active .walk-bar { transform: scaleX(1); }
.walk-steps button.running .walk-bar { animation: walk-fill 4.5s linear forwards; }
@keyframes walk-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.paused .walk-steps button.running .walk-bar { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .walk-panel { animation: none; }
  .walk-steps button.running .walk-bar { animation: none; transform: scaleX(1); }
}

.proof-band { padding: 82px max(56px, calc((100% - 1180px) / 2)); display: grid; grid-template-columns: 1fr 1fr auto; gap: 70px; align-items: end; color: white; background: #0d315f; }
.proof-band span { color: #9dbbff; text-transform: uppercase; font-size: 9px; letter-spacing: .14em; }
.proof-band h2 { max-width: 460px; margin: 14px 0 0; font-family: var(--font-display); font-size: 34px; line-height: 1.15; font-weight: 600; }
.proof-band p { margin: 0; color: #c3d1e4; line-height: 1.65; }
.proof-band > a { padding-bottom: 5px; border-bottom: 1px solid #7597c6; white-space: nowrap; font-size: 12px; font-weight: 700; }
.landing-footer { min-height: 112px; padding: 28px 56px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; background: white; }
.landing-footer p { color: var(--quiet); font-size: 10px; }
.landing-footer > a:last-child { justify-self: end; color: var(--blue); font-size: 11px; }

@media (max-width: 920px) {
  .topbar { grid-template-columns: auto auto; padding: 0 22px; }
  .topbar-workspace { max-width: 120px; }
  .topbar-context { display: none; }
  .topbar nav { gap: 15px; }
  .recipient-row { grid-template-columns: 28px 1fr 1fr 34px; }
  .prepare-shell { grid-template-columns: 220px minmax(0,1fr) 270px; }
  .content-grid { grid-template-columns: 1fr; }
  .manage-grid > .signers-panel,
  .manage-grid > .audit-panel,
  .manage-grid > .attestation-panel { grid-column: 1; grid-row: auto; }
  .signing-shell { grid-template-columns: minmax(0,1fr) 300px; }
  .document-rail { display: none; }
  .landing-header { padding: 0 28px; }
  .product-hero { padding-left: 32px; padding-right: 32px; }
  .product-hero h1 { font-size: 68px; }
  .how-heading { gap: 40px; }
  .window-body { grid-template-columns: 1fr 240px; padding: 24px; }
  .proof-band { padding-left: 32px; padding-right: 32px; grid-template-columns: 1fr 1fr; }
  .proof-band > a { grid-column: 2; }
}

@media (max-width: 680px) {
  .topbar { height: 58px; padding: 0 14px; }
  .topbar nav a:nth-child(2) { display: none; }
  .topbar nav { gap: 12px; }
  .brand small { display: none; }
  .page, .page.narrow { width: min(100% - 24px, 920px); padding-top: 32px; }
  .page-heading, .page-heading.split { min-width: 0; align-items: flex-start; flex-direction: column; gap: 16px; }
  .page-heading h1 { font-size: 30px; }
  .button-row { width: 100%; }
  .button-row > * { flex: 1; min-width: 0; padding-left: 8px; padding-right: 8px; text-align: center; white-space: normal; }
  .field-grid.two { grid-template-columns: 1fr; }
  .section-block { padding: 18px; }
  .section-title.row-title { grid-template-columns: 30px 1fr; }
  .section-title.row-title button { grid-column: 2; width: max-content; }
  .recipient-row { grid-template-columns: 26px 1fr 32px; }
  .recipient-row label { grid-column: 2; }
  .recipient-row .icon-button { grid-column: 3; grid-row: 1; }
  .inline-section { flex-direction: column; align-items: flex-start; gap: 18px; }
  .table-row { grid-template-columns: 1fr auto; }
  .table-row > span:nth-child(3), .table-row > span:nth-child(4), .table-row > span:nth-child(5), .table-head { display: none; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metrics div:nth-child(2) { border-right: 0; }
  .metrics div:last-child { grid-column: span 2; border-top: 1px solid var(--line); }
  .recipient-card { grid-template-columns: 38px 1fr auto; }
  .invite-control { grid-column: 1 / 4; }
  .signing-shell { height: auto; min-height: calc(100vh - 58px); display: flex; flex-direction: column; }
  .document-stage { height: 58vh; padding: 10px 12px; }
  .viewer-toolbar { flex-wrap: wrap; gap: 8px; }
  .action-panel { padding-bottom: 78px; border-left: 0; border-top: 1px solid var(--line); }
  .sign-field-list { overflow: visible; }
  .panel-footer .sign-trigger { display: none; }
  .mobile-action-bar { display: flex; align-items: center; gap: 14px; position: fixed; inset: auto 0 0; z-index: 25; padding: 11px 16px; border-top: 1px solid var(--line); background: white; box-shadow: 0 -8px 26px rgba(15,35,66,.12); }
  .mobile-action-bar > div { flex: 1; min-width: 0; }
  .mobile-action-bar small { display: block; margin-top: 6px; color: var(--quiet); font-size: 10px; }
  .mobile-action-bar .primary { flex: none; }
  .verify-drop { flex-direction: column; align-items: stretch; }
  .auth-page { padding: 40px 0 56px; }
  .auth-head h1 { font-size: 26px; }
  .check-list > div { grid-template-columns: 48px 1fr; }
  .check-list p { grid-column: 2; }
  .landing-header { height: 64px; padding: 0 18px; }
  .landing-header nav a:not(.header-action) { display: none; }
  .product-hero { min-height: auto; padding: 52px 22px 0; }
  .product-hero h1 { font-size: 52px; }
  .product-hero p { font-size: 16px; }
  .hero-actions { align-items: flex-start; flex-direction: column; gap: 18px; }
  .hero-workflow { margin-top: 54px; grid-template-columns: 1fr 1fr; }
  .hero-workflow div { min-height: 110px; border-bottom: 1px solid #36517e; }
  .hero-workflow div:nth-child(2) { border-right: 0; }
  .hero-workflow div:nth-child(3), .hero-workflow div:nth-child(4) { border-bottom: 0; }
  .hero-workflow div:nth-child(3) { padding-left: 0; }
  .how-section { width: calc(100% - 36px); padding: 76px 0; }
  .how-heading { grid-template-columns: 1fr; gap: 22px; margin-bottom: 36px; }
  .how-heading h2 { font-size: 36px; }
  .window-body { min-height: 440px; padding: 16px; grid-template-columns: 1fr; }
  .document-sheet { min-height: 360px; padding: 42px 36px; }
  .window-panel { display: none; }
  .proof-band { padding: 60px 22px; grid-template-columns: 1fr; gap: 28px; }
  .proof-band > a { grid-column: 1; width: max-content; }
  .landing-footer { padding: 28px 22px; grid-template-columns: 1fr auto; }
  .landing-footer p { display: none; }
  .prepare-page { height: auto; overflow: visible; }
  .prepare-shell { display: flex; flex-direction: column; }
  .prepare-tools, .prepare-summary { overflow: visible; border: 0; }
  .prepare-stage { height: 64vh; order: 2; }
  .prepare-summary { min-height: 360px; order: 3; }
}

@media print {
  body { background: #edf2f7; color: #111; }
  .topbar, .flash, .button-row, .danger-zone { display: none !important; }
  .page { width: calc(100% - 36px); padding: 20px 0; }
  .panel, .table-shell, .metrics { box-shadow: none; border-color: #c9cfd7; }
}

.topbar-workspace {
  max-width: 190px; padding: 5px 10px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--wash); color: var(--navy); font-size: 11px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar nav { gap: 30px; color: #7a8798; font-size: 14px; font-weight: 700; }
.topbar-signout { display: inline-flex; margin: 0; }
.topbar-signout button { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.topbar-signout button:hover { color: var(--blue); }
html[data-theme="dark"] .topbar-workspace { background: #142238; border-color: #35455e; color: #d6dfec; }

.attestation-panel .attestation-body { padding: 18px; }
.attestation-panel .attestation-body > p { margin: 0 0 14px; color: var(--muted); line-height: 1.5; }
.attestation-facts { margin: 0; display: grid; gap: 10px; }
.attestation-facts > div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: baseline; }
.attestation-facts dt { color: var(--quiet); font-size: 11px; font-weight: 650; }
.attestation-facts dd { margin: 0; color: var(--ink); font-size: 12px; overflow-wrap: anywhere; }
.attestation-caveat { margin: 16px 0 0; padding-top: 13px; border-top: 1px solid var(--line); color: var(--quiet); font-size: 11px; line-height: 1.5; }
.attestation-panel .status.state-anchored { color: #176947; background: var(--green-wash); border-color: #a6d9c2; }
.attestation-panel .status.state-retrying { color: #9d2d2d; background: var(--red-wash); border-color: #e1aaaa; }
.attestation-panel .status.state-committing, .attestation-panel .status.state-committed { color: #8c570e; background: var(--amber-wash); border-color: #e9c58f; }

.signer-cta { margin-top: 14px; }
.signer-cta p { margin: 6px 0 0; }
.signer-cta .primary { margin-top: 10px; }

/* Signers and the document history stack in the main column; the blockchain record sits
   beside them rather than pushing history onto a row of its own. */
.manage-grid > .signers-panel { grid-column: 1; grid-row: 1; }
.manage-grid > .audit-panel { grid-column: 1; grid-row: 2; }
.manage-grid > .attestation-panel { grid-column: 2; grid-row: 1 / span 2; align-self: start; }
