:root {
  --navy: #191919;
  --accent: #245bff;
  --muted: #596d7e;
  --line: #dce5eb;
  --paper: #fff;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #f1f5f7;
  color: var(--navy);
  font: 15px/1.5 system-ui;
}
header {
  background: var(--navy);
  color: white;
  padding: 18px 30px;
  display: flex;
  align-items: center;
  gap: 30px;
}
.brand {
  color: white;
  font-size: 28px;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -1px;
}
.brand span {
  color: #63dbba;
}
.strap {
  flex: 1;
  opacity: 0.8;
}
h1 {
  font-size: 24px;
  line-height: 1.25;
  margin: 0 0 16px;
}
h2 {
  font-size: 17px;
  margin: 22px 0 10px;
}
p {
  margin: 10px 0;
}
button {
  border: 0;
  background: var(--accent);
  color: white;
  border-radius: 8px;
  padding: 10px 15px;
  font: 600 14px system-ui;
  cursor: pointer;
  white-space: normal;
}
button:hover {
  filter: brightness(0.94);
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
.quiet {
  background: #e8eef2;
  color: var(--navy);
}
.danger {
  background: #fff0ec;
  color: #a33322;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 12px 0;
}
input,
select,
textarea {
  font: 15px system-ui;
  border: 1px solid #b7c6d0;
  border-radius: 7px;
  background: white;
  color: var(--navy);
  padding: 10px;
  width: 100%;
  margin-top: 5px;
  min-width: 0;
}
input[type="file"] {
  padding: 8px;
  font-size: 12px;
}
input[type="checkbox"],
input[type="radio"] {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}
textarea {
  resize: vertical;
  min-height: 130px;
  line-height: 1.45;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  line-height: 1.6;
}
.check input {
  margin-top: 4px;
}
.muted {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
}
.workspace {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 260px;
  gap: 18px;
  padding: 0 24px 24px;
}
.workspace aside {
  align-self: start;
}
.row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.steps {
  padding: 20px 26px;
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 13px;
  color: var(--muted);
}
.steps strong {
  color: var(--accent);
}
.steps button {
  margin-left: auto;
}
.actions {
  margin-bottom: 14px;
}
.paging {
  justify-content: center;
  margin: 10px 0 18px;
  font-size: 13px;
}
#notice {
  padding: 12px 26px;
  background: #edf1ff;
  color: #23469e;
  min-height: 46px;
  font-size: 14px;
}
#notice.error {
  background: #ffeae5;
  color: #842d22;
}
.palette {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.palette button {
  text-align: left;
  font-size: 12px;
  background: #eff4f7;
  color: var(--navy);
  padding: 10px;
}
.palette button.active {
  background: #dfe7ff;
  box-shadow: inset 0 0 0 2px var(--accent);
}
.field-list {
  margin-top: 20px;
  max-height: 270px;
  overflow: auto;
}
.field-list button {
  display: block;
  width: 100%;
  margin: 5px 0;
  text-align: left;
  background: #f3f6f8;
  color: var(--navy);
  font-size: 12px;
}
.document {
  min-width: 0;
  overflow: auto;
}
.empty {
  text-align: center;
  background: white;
  border: 2px dashed var(--line);
  border-radius: 14px;
  padding: 80px 20px;
}
.document-icon {
  font-size: 40px;
  color: var(--accent);
}
#sheet,
.sign-page {
  position: relative;
  margin: 0 auto 24px;
  box-shadow: 0 8px 30px #19191914;
  max-width: 100%;
  background: white;
}
canvas#pdf,
.sign-page > canvas {
  display: block;
  width: 100%;
  height: auto;
}
#overlays,
.sign-overlays {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.field {
  position: absolute;
  pointer-events: auto;
  border: 1.5px solid var(--field-color, #245bff);
  background: color-mix(in srgb, var(--field-color, #245bff) 13%, transparent);
  color: #191919;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  overflow: visible;
  touch-action: none;
  padding: 2px;
  cursor: move;
}
.field.selected {
  outline: 2px solid var(--field-color);
  outline-offset: 2px;
}
.field img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.resize {
  position: absolute;
  width: 14px;
  height: 14px;
  bottom: -4px;
  right: -4px;
  background: var(--field-color);
  border: 2px solid white;
  border-radius: 3px;
  cursor: nwse-resize;
}
.field span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}
.field input {
  height: 100%;
  margin: 0;
  padding: 2px;
  font-size: 12px;
  border: 0;
  background: #ffffffdb;
  border-radius: 0;
}
.field input[type="checkbox"] {
  width: 18px;
  height: 18px;
}
.field.sign-field {
  cursor: pointer;
  touch-action: auto;
}
.field.readonly {
  border-color: transparent;
  background: transparent;
  pointer-events: none;
}
.field.completed {
  background: #e5edff;
}
.field.focused {
  outline: 3px solid #e9b24a;
  outline-offset: 3px;
}
.auth {
  max-width: 540px;
  margin: 20px auto;
}
.auth form {
  display: flex;
  align-items: end;
  gap: 10px;
}
.auth label {
  flex: 1;
  margin: 0;
}
.auth button {
  margin-bottom: 0;
}
.signer-shell {
  max-width: 1300px;
  margin: 28px auto;
  padding: 0 22px;
}
#verification {
  max-width: 480px;
  margin: 50px auto;
}
.sign-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 24px;
}
.sign-toolbar h1 {
  margin: 6px 0;
}
.eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
}
.sign-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 24px;
}
.sign-controls {
  align-self: start;
  position: sticky;
  top: 20px;
}
.sign-controls button {
  margin: 5px 0;
  width: 100%;
}
dialog {
  border: 0;
  border-radius: 16px;
  padding: 25px;
  max-width: min(600px, 95vw);
  width: 560px;
  box-shadow: 0 20px 80px #19191933;
}
dialog::backdrop {
  background: #19191980;
}
.send-dialog {
  width: min(720px, 94vw);
  max-width: 720px;
  padding: 0;
  overflow: hidden;
}
.send-dialog-header {
  padding: 26px 28px 18px;
  border-bottom: 1px solid var(--line);
  background: #fffdf8;
}
.send-dialog-header h2 {
  margin: 5px 0 6px;
  font-size: 24px;
}
.send-dialog-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.send-section {
  padding: 18px 28px 0;
}
.send-section h3 {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: .1px;
}
.send-section label {
  margin: 8px 0;
}
.delivery-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.delivery-option {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 0 !important;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
.delivery-option:has(input:checked) {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  background: #f7f9ff;
}
.delivery-option input {
  margin-top: 3px;
  flex: 0 0 auto;
}
.delivery-option span {
  display: block;
}
.delivery-option strong {
  display: block;
  font-size: 13px;
  margin-bottom: 3px;
}
.delivery-option small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}
.token-help {
  margin-top: 6px;
}
.send-confirm {
  margin-top: 16px;
  padding-bottom: 4px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.send-confirm .check {
  font-size: 12px;
  font-weight: 500;
  margin: 10px 0;
}
.send-actions {
  display: flex;
  gap: 9px;
  padding: 20px 28px 26px;
}
.send-actions #confirmIssue {
  min-width: 160px;
}
@media (max-width: 600px) {
  .send-dialog {
    width: 96vw;
  }
  .send-dialog-header,
  .send-section,
  .send-actions {
    padding-left: 18px;
    padding-right: 18px;
  }
  .delivery-options {
    grid-template-columns: 1fr;
  }
  .send-actions {
    flex-direction: column;
  }
  .send-actions button {
    width: 100%;
  }
}
#ink {
  width: 100%;
  height: 180px;
  border: 1px solid #b7c6d0;
  border-radius: 8px;
  touch-action: none;
}
.close {
  float: right;
}
#links input {
  font-size: 12px;
}
#documents button {
  display: block;
  width: 100%;
  text-align: left;
  margin: 8px 0;
  font-size: 12px;
  background: #edf3f5;
  color: var(--navy);
}
#recordActions button {
  margin: 4px 0;
}
footer {
  text-align: center;
  padding: 25px;
  color: var(--muted);
  font-size: 11px;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #e9b24a;
  outline-offset: 2px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 240px minmax(0, 1fr);
  }
  .properties {
    grid-column: 1/-1;
  }
  .properties #props {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
  }
}
@media (max-width: 700px) {
  header {
    padding: 14px 18px;
  }
  .strap {
    display: none;
  }
  .workspace {
    display: flex;
    flex-direction: column;
    padding: 0 12px;
  }
  .workspace aside {
    width: 100%;
  }
  .document {
    width: 100%;
  }
  .steps {
    padding: 15px 12px;
    gap: 12px;
    font-size: 11px;
  }
  .steps button {
    font-size: 11px;
  }
  .card {
    padding: 18px;
  }
  .sign-layout {
    display: flex;
    flex-direction: column;
  }
  .sign-controls {
    position: static;
  }
  .sign-toolbar {
    display: block;
  }
  .signer-shell {
    padding: 0 10px;
  }
  .field {
    font-size: 9px;
  }
  .field input {
    font-size: 10px;
  }
  .auth {
    margin: 12px;
  }
  .auth form {
    display: block;
  }
  .auth button {
    margin-top: 10px;
  }
  .properties #props {
    display: block;
  }
  #notice {
    padding: 12px;
  }
  .sign-page {
    margin-bottom: 15px;
  }
}

:root {
  --navy: #191919;
  --accent: #245bff;
  --muted: #66635f;
  --line: #e3dfd6;
}
body {
  background: #faf7f0;
}
header {
  background: #fff;
  color: var(--navy);
  border-bottom: 1px solid var(--line);
  padding: 17px 36px;
}
.brand {
  color: var(--navy);
  font-size: 29px;
}
.brand span {
  color: #245bff;
}
.strap {
  font-size: 10px;
  letter-spacing: 1.7px;
}
.header-links {
  display: flex;
  gap: 22px;
  font-size: 12px;
}
.header-links a,
a {
  color: var(--accent);
  text-underline-offset: 4px;
}
.beta {
  font-size: 9px;
  letter-spacing: 1px;
  border: 1px solid #d6dff9;
  border-radius: 20px;
  padding: 5px 9px;
  color: #40537b;
}
.dashboard {
  max-width: 1340px;
  padding: 45px 38px;
  margin: auto;
}
.dash-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  margin-bottom: 32px;
}
.dash-heading h1 {
  font-size: clamp(32px, 4vw, 49px);
  font-weight: 550;
  letter-spacing: -2px;
  line-height: 1.08;
  margin: 12px 0 16px;
}
.dash-heading p {
  color: var(--muted);
}
.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.5fr;
  gap: 16px;
  margin: 28px 0;
}
.metrics article {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.metrics article > span {
  font-size: 12px;
  color: var(--muted);
}
.metrics strong {
  font-size: 38px;
  line-height: 1.3;
  font-weight: 550;
}
.metrics small {
  color: var(--muted);
  font-size: 11px;
}
.metrics .trust-tile {
  background: #eaf0ff;
  border-color: #d1dcff;
}
.trust-tile strong {
  font-family: Georgia, serif;
  font-size: 25px;
  letter-spacing: -0.8px;
}
.trust-tile a {
  font-size: 12px;
  margin-top: 8px;
}
.agreements {
  padding: 10px 24px;
}
.agreements h2 {
  margin: 0;
  font-size: 18px;
}
.spacer {
  flex: 1;
}
.search-label {
  width: 260px;
}
.agreement-row {
  display: grid;
  grid-template-columns: 42px 1fr 160px 90px;
  width: 100%;
  align-items: center;
  gap: 14px;
  padding: 21px 0;
  text-align: left;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: white;
  color: var(--navy);
  font-weight: 400;
}
.agreement-row strong {
  font-size: 14px;
  font-weight: 600;
}
.agreement-row small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 5px;
}
.agreement-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--accent);
  font-size: 22px;
}
.status {
  justify-self: start;
  font-size: 10px;
  text-transform: capitalize;
  padding: 5px 9px;
  border-radius: 20px;
  background: #f0ede7;
  color: #625e57;
}
.status-issued {
  background: #fff1d9;
  color: #78551a;
}
.status-completed {
  background: #e8eeff;
  color: #2047b3;
}
.status-voided,
.status-declined {
  background: #f8e9e4;
  color: #884535;
}
.row-progress {
  font-size: 11px;
  color: var(--muted);
}
.welcome {
  padding: 42px 15px;
  text-align: center;
  color: var(--muted);
}
.welcome h3 {
  font-size: 21px;
  font-weight: 500;
  color: var(--navy);
}
.welcome p {
  max-width: 520px;
  margin: 12px auto 24px;
}
.dash-note {
  font-size: 11px;
  margin: 22px 0;
  color: var(--muted);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.geometry {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 8px;
}
.activity {
  max-height: 220px;
  overflow: auto;
}
.activity p {
  border-left: 2px solid #c5d3ff;
  padding-left: 10px;
  text-transform: capitalize;
}
.steps {
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.steps button:first-child {
  margin-left: 0;
}
.steps button:last-child {
  margin-left: auto;
}
#notice {
  background: #edf1ff;
  color: #23469e;
  font-size: 12px;
  min-height: 40px;
}
.auth {
  max-width: 700px;
  background: #fffefa;
  margin-top: 24px;
}
.auth h2 {
  margin-top: 0;
}
.quiet {
  background: #eeece6;
}
.empty {
  padding: 85px 25px;
  background: #fffdf8;
}
.card {
  box-shadow: 0 2px 4px #253f2903;
}
button {
  min-height: 42px;
}
.field-list button,
.palette button {
  min-height: 36px;
}
#useTyped {
  margin-bottom: 15px;
}
#confirmInputLabel {
  font-size: 13px;
}
#capture p {
  font-size: 13px;
}
.sign-controls {
  border-top: 4px solid var(--accent);
}
.sign-toolbar {
  border: none;
  background: transparent;
  padding-left: 0;
  padding-right: 0;
}
.sign-toolbar h1 {
  font-size: 30px;
  letter-spacing: -0.7px;
}
.sign-controls h2 {
  margin-top: 0;
}
.workspace-tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 14px;
  border-bottom: 1px solid var(--line);
}
.workspace-tab {
  background: transparent;
  color: var(--muted);
  border-radius: 8px 8px 0 0;
  min-height: 40px;
  padding: 10px 18px;
  border-bottom: 3px solid transparent;
}
.workspace-tab.active {
  color: var(--navy);
  border-bottom-color: var(--accent);
  background: white;
}
.library-list {
  margin-top: 14px;
}
.library-row {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.library-row strong {
  display: block;
  font-size: 14px;
}
.library-row small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}
.template-role {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 14px;
}
.template-role > strong {
  font-size: 14px;
}
#panelContacts .search-label {
  display: block;
  margin: 16px 0 8px;
}
@media (max-width: 1000px) {
  .metrics {
    grid-template-columns: 1fr 1fr;
  }
  .strap {
    display: none;
  }
  .dashboard {
    padding: 30px 22px;
  }
  .dash-heading {
    align-items: flex-start;
  }
  .agreement-row {
    grid-template-columns: 36px 1fr 140px;
  }
  .row-progress {
    display: none;
  }
}
@media (max-width: 650px) {
  header {
    padding: 14px 16px;
    gap: 12px;
    flex-wrap: wrap;
  }
  .header-links {
    margin-left: auto;
    gap: 12px;
    font-size: 11px;
  }
  .beta {
    display: none;
  }
  .dashboard {
    padding: 28px 14px;
  }
  .dash-heading {
    display: block;
  }
  .workspace-tabs {
    overflow-x: auto;
  }
  .workspace-tab {
    flex: 1 0 auto;
  }
  .library-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .dash-heading > .row {
    margin-top: 24px;
  }
  .metrics {
    gap: 10px;
  }
  .metrics article {
    padding: 17px;
  }
  .metrics strong {
    font-size: 30px;
  }
  .trust-tile strong {
    font-size: 20px;
  }
  .metrics small {
    font-size: 10px;
  }
  .agreements {
    padding: 8px 15px;
  }
  .search-label {
    width: 100%;
    margin-bottom: 0;
  }
  .agreements > .row {
    gap: 0;
  }
  .agreement-row {
    grid-template-columns: 30px 1fr;
    gap: 10px;
  }
  .agreement-icon {
    width: 28px;
    height: 35px;
  }
  .status {
    grid-column: 2;
  }
  .steps {
    flex-wrap: wrap;
  }
  .steps span {
    display: none;
  }
  .sign-toolbar h1 {
    font-size: 25px;
  }
  .sign-controls button {
    min-height: 48px;
  }
  .sign-field[role="button"] {
    min-height: 22px;
  }
  .geometry {
    grid-template-columns: 1fr 1fr;
  }
}

.concepts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 30px;
}
.concept h2 {
  font-size: 24px;
  letter-spacing: -0.6px;
}
.concept p {
  font-size: 13px;
  color: var(--muted);
}
.mock {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  margin: 24px 0;
  min-height: 310px;
  background: #faf7f0;
}
.mock h3 {
  font-size: 27px;
  line-height: 1.15;
  letter-spacing: -1px;
  margin: 20px 0;
}
.mock-metrics {
  display: flex;
  gap: 8px;
}
.mock-metrics span {
  background: white;
  border-radius: 5px;
  padding: 12px;
  flex: 1;
  font-size: 10px;
}
.mock-metrics b {
  font-size: 23px;
  font-weight: 500;
}
.mock p {
  border-top: 1px solid #dce4dd;
  padding-top: 15px;
  font-size: 10px;
}
.mock .status {
  font-size: 8px;
  float: right;
}
.command .mock {
  background: #192c33;
  color: #e7f3ed;
}
.command .mock p {
  color: #d2e4df;
  border-color: #3a4e55;
  padding: 16px 0 0;
}
.command .mock p span {
  color: #8cac9e;
  margin-right: 15px;
}
.mock-label {
  font-size: 9px;
  letter-spacing: 1px;
}
.mock-footer {
  font-size: 10px;
  color: #91aaa3;
  margin-top: 30px;
}
.journey .mock {
  background: #ede4db;
  color: #4d463b;
}
.journey .mock h3 {
  font-family: Georgia, serif;
  font-weight: 400;
  font-size: 33px;
}
.mock-progress {
  height: 5px;
  background: #d8cebf;
  margin: 25px 0;
}
.mock-progress i {
  display: block;
  width: 50%;
  height: 5px;
  background: #74664e;
}
.mock-button {
  display: block;
  background: #625744;
  color: white;
  padding: 12px;
  font-size: 10px;
  border-radius: 6px;
}
@media (max-width: 1000px) {
  .concepts {
    grid-template-columns: 1fr;
  }
  .mock {
    min-height: auto;
  }
  .concept {
    max-width: 650px;
    margin: auto;
    width: 100%;
  }
}

/* Keep declarations and signer consent readable when their labels wrap. */
#issueDialog .check input[type="checkbox"],
.sign-controls .check input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  margin-top: 1px;
}

/* The Human Mark — cobalt ink, black lettering and warm paper. */
:root { --accent: #245bff; --ink: #191919; --paper: #faf7f0; }
.brand { display: inline-flex; align-items: center; flex: 0 0 auto; line-height: 1; }
.brand img { display: block; width: 190px; height: auto; }
header { min-height: 96px; gap: 24px; }
.strap { color: #66635f; opacity: 1; }
.dash-heading h1 { font-weight: 750; letter-spacing: -2px; }
.dash-heading h1 em { color: var(--accent); font-style: normal; }
.metrics .trust-tile { background: var(--ink); border-color: var(--ink); }
.metrics .trust-tile > span, .metrics .trust-tile small { color: #d3d4dc; }
.trust-tile strong { font-family: inherit; color: white; font-weight: 650; }
.trust-tile a { color: #b8cbff; }
input, select { border-color: #c9c5bd; }
button { border-radius: 10px; }
a:focus-visible { outline: 3px solid #245bff; outline-offset: 5px; }
.brand-showcase { padding: 40px; text-align: center; background: var(--paper); }
.brand-showcase img { max-width: 100%; width: 560px; height: auto; }
.brand-palette { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0; }
.brand-swatch { flex: 1; min-width: 180px; padding: 28px; border-radius: 12px; border: 1px solid var(--line); }
@media (max-width: 700px) {
  .brand img { width: 150px; }
  header { min-height: 78px; }
}
@media (prefers-reduced-motion: no-preference) {
  button { transition: background-color .15s ease, box-shadow .15s ease; }
}

/* A welcoming, keyboard-accessible native PDF picker. */
.pdf-upload {
  margin: 18px 0 12px;
  padding: 16px;
  border: 1.5px dashed #b6c7fb;
  border-radius: 14px;
  background: #f4f7ff;
}
.pdf-upload-heading { display: flex; align-items: center; gap: 10px; }
.pdf-upload-icon {
  display: grid; place-items: center; width: 38px; height: 44px;
  flex: 0 0 38px; border-radius: 10px; color: #245bff; background: #e5ecff;
}
.pdf-upload-icon svg { width: 23px; height: 23px; }
.pdf-upload-heading label { margin: 0; color: #191919; font-size: 14px; font-weight: 700; }
.pdf-upload-heading p { margin: 3px 0 0; color: #626775; font-size: 11px; line-height: 1.4; }
.pdf-upload input[type="file"] {
  display: block; width: 100%; margin: 16px 0 0; padding: 0;
  border: 0; border-radius: 8px; background: transparent;
  font: 11px/1.6 system-ui; color: #505b73; cursor: pointer;
}
.pdf-upload input[type="file"]::file-selector-button {
  display: block; width: 100%; margin: 0 0 8px; padding: 11px 14px;
  border: 1px solid #245bff; border-radius: 9px;
  background: #245bff; color: white; font: 650 13px system-ui;
  cursor: pointer;
}
.pdf-upload input[type="file"]:hover::file-selector-button { background: #1948da; border-color: #1948da; }
.pdf-upload:focus-within { border-color: #245bff; box-shadow: 0 0 0 3px #245bff18; }
.pdf-upload:has(input:disabled) { opacity: .55; }
.pdf-upload input:disabled, .pdf-upload input:disabled::file-selector-button { cursor: not-allowed; }
.pdf-upload-hint { margin: 7px 0 0; color: #626775; font-size: 10px; }
.workspace > aside:first-child > h2 { padding-top: 20px; border-top: 1px solid var(--line); margin-top: 24px; }
#safeCopy { width: 100%; font-size: 12px; }

/* Checkbox fields use the configured rectangle itself as the control.
   This keeps template placement, signing view and final PDF coordinates identical. */
.field-checkbox {
  padding: 0;
  overflow: hidden;
}
#overlays .field-checkbox {
  background: transparent;
  border-width: 2px;
}
.sign-field.field-checkbox {
  background: transparent;
  padding: 0;
}
.sign-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  margin: 0;
  border: 1.5px solid #536273;
  border-radius: 3px;
  background: #fff;
  color: #142b43;
  display: grid;
  place-items: center;
  font: 700 12px/1 system-ui;
  cursor: pointer;
}
.sign-checkbox[aria-checked="true"] {
  background: #fff;
}
.field-checkbox.completed {
  background: transparent;
}

.message-template-actions {
  margin: 4px 0 14px;
}
.message-template-actions button {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 12px;
}
.email-preview {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  margin-top: 12px;
}
.email-preview-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: #f3f1eb;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .7px;
}
.email-preview-meta {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.email-preview-meta strong {
  color: var(--muted);
  font-size: 11px;
}
.email-preview-body {
  white-space: pre-wrap;
  padding: 18px 16px 22px;
  min-height: 180px;
  font-size: 13px;
  line-height: 1.6;
  color: #272727;
}

.align-tools {
  margin: 14px 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.align-tools > strong {
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
}
.align-tools p {
  margin: 0 0 8px;
  font-size: 10px;
}
.align-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}
.align-grid button {
  min-height: 32px;
  padding: 6px 5px;
  font-size: 10px;
}

.new-agreement-dialog {
  width: min(620px, 94vw);
}
.new-agreement-dialog > p {
  color: var(--muted);
  margin-top: 4px;
}
.new-agreement-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 20px 0;
}
.new-agreement-option {
  min-height: 130px;
  padding: 20px;
  text-align: left;
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.new-agreement-option:hover {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  background: #f8faff;
}
.new-agreement-option strong,
.new-agreement-option span {
  display: block;
}
.new-agreement-option strong {
  font-size: 16px;
  margin-bottom: 7px;
}
.new-agreement-option span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 400;
}
#newAgreementTemplatePicker {
  margin: 18px 0;
}
.new-agreement-cancel {
  margin-top: 16px;
}
@media (max-width: 600px) {
  .new-agreement-options {
    grid-template-columns: 1fr;
  }
}

.message-builder-dialog {
  width: min(980px, 96vw);
  max-width: 980px;
  padding: 0;
  overflow: hidden;
}
.message-builder-header {
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--line);
  background: #fffdf8;
}
.message-builder-header h2 {
  margin: 5px 0 5px;
}
.message-builder-header p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.message-builder-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  gap: 0;
}
.message-builder-editor {
  padding: 22px 28px;
}
.message-builder-preview {
  padding: 22px;
  background: #f7f5ef;
  border-left: 1px solid var(--line);
}
.message-builder-preview > span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .8px;
  margin-bottom: 9px;
}
.tag-picker {
  margin: 14px 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #faf9f5;
}
.tag-picker > strong {
  display: block;
  font-size: 12px;
  margin-bottom: 10px;
}
.tag-groups {
  display: grid;
  gap: 10px;
}
.tag-groups > div {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.tag-groups > div > span {
  width: 74px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.tag-chip {
  min-height: 30px;
  padding: 6px 9px;
  border-radius: 999px;
  background: #edf1ff;
  color: #23469e;
  font-size: 11px;
}
.tag-picker p {
  margin: 10px 0 0;
  font-size: 10px;
}
.builder-email-preview {
  margin-top: 0;
}
.message-builder-actions {
  padding: 18px 28px 24px;
  border-top: 1px solid var(--line);
  background: #fff;
}
@media (max-width: 780px) {
  .message-builder-grid {
    grid-template-columns: 1fr;
  }
  .message-builder-preview {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

/* Compact document workspace. */
body { background: #faf9f6; }
body > header { min-height: 76px; padding: 8px 36px; }
body > header .header-links { margin-left: auto; }
.brand img { width: 168px; }
.dashboard { max-width: 1280px; padding: 32px 36px; }
.dash-heading { margin: 0 0 24px; gap: 20px; }
.dash-heading h1 { font-size: 28px; font-weight: 650; letter-spacing: -.6px; line-height: 1.25; margin: 0 0 6px; }
.dash-heading p { margin: 0; font-size: 14px; color: #6b6b66; }
.metrics { display: flex; gap: 0; margin: 0 0 28px; flex-wrap: wrap; }
.metrics article { display: flex; flex-direction: row; align-items: center; gap: 14px; padding: 0 24px; border: 0; border-right: 1px solid #d5d5d1; border-radius: 0; background: transparent; }
.metrics article:first-child { padding-left: 0; }
.metrics article:last-child { border: 0; }
.metrics article > span { font-size: 13px; }
.metrics strong { font-size: 14px; font-weight: 650; line-height: 1.5; }
.workspace-tabs { display: flex; gap: 24px; margin: 0 0 22px; padding: 0; border-bottom: 1px solid #deded9; overflow-x: auto; }
.workspace-tabs .workspace-tab { background: transparent; color: #676762; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 10px 0; min-height: 42px; font-size: 13px; white-space: nowrap; }
.workspace-tabs .workspace-tab.active { color: #191919; border-bottom-color: #191919; box-shadow: none; }
.dashboard-panel.card { border-radius: 6px; box-shadow: none; padding: 0 22px; }
.dashboard-panel > .row { min-height: 70px; gap: 12px; padding: 12px 0; }
.document-filters { display: flex; align-items: center; gap: 20px; align-self: stretch; }
.document-filters button { background: transparent; color: #6b6b66; border-radius: 0; border-bottom: 2px solid transparent; padding: 8px 0; font-size: 12px; font-weight: 500; white-space: nowrap; }
.document-filters button.active { color: #191919; border-bottom-color: #245bff; font-weight: 650; }
.agreements .search-label { width: 200px; margin: 0; }
.agreements input, .agreements select { font-size: 12px; min-height: 36px; margin: 0; border-color: #deded9; border-radius: 5px; }
.agreements label:has(#filterDocuments) { margin: 0; }
#filterDocuments { max-width: 140px; }
.document-columns, .agreement-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.25fr) minmax(150px, 1fr) 85px; gap: 22px; }
.document-columns { padding: 15px 0; border-top: 1px solid var(--line); color: #6b6b66; font-size: 12px; }
.agreement-row { min-height: 74px; padding: 17px 0; font-size: 13px; }
.agreement-row:hover { background: #fafaf8; filter: none; }
.document-cell { display: flex; align-items: center; gap: 16px; min-width: 0; }
.document-cell > span:last-child { min-width: 0; }
.agreement-row strong { display: block; overflow-wrap: anywhere; font-size: 13px; font-weight: 500; }
.agreement-row small { font-size: 11px; color: #7b7b76; }
.agreement-icon { width: 23px; height: 28px; border: 0; color: #727570; flex: 0 0 23px; }
.agreement-icon svg { width: 23px; height: 26px; }
.recipient-cell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.updated-cell { color: #6b6b66; font-size: 12px; }
.status { background: transparent; color: #70716d; border-radius: 0; padding: 0; font-size: 12px; }
.status::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 8px; }
.status-issued { color: #92620a; background: transparent; }
.status-completed { color: #245bff; background: transparent; }
.status-declined, .status-voided { color: #9b4838; background: transparent; }
.document-count { border-top: 1px solid var(--line); padding: 15px 0; font-size: 12px; color: #6b6b66; }
.welcome { padding: 42px 16px; font-size: 14px; }
.welcome h3 { font-size: 18px; }
.dashboard button { border-radius: 6px; }
.dashboard .workspace-tab, .dashboard .document-filters button, .dashboard .agreement-row { border-radius: 0; }
@media(max-width:1000px) {
  .document-filters { flex-wrap: wrap; gap: 12px; }
  .document-columns, .agreement-row { grid-template-columns: minmax(0,1.6fr) minmax(0,1fr) 145px 65px; gap: 12px; }
}
@media(max-width:650px) {
  .dashboard { padding: 24px 16px; }
  .dash-heading { display: flex; flex-wrap: wrap; }
  .dash-heading > .row { margin-top: 0; }
  .metrics { gap: 12px 0; }
  .metrics article { padding: 0 12px; gap: 8px; }
  .metrics article > span { font-size: 11px; }
  .metrics strong { font-size: 13px; }
  .dashboard-panel.card { padding: 0 14px; }
  .document-filters { width: 100%; gap: 16px; overflow-x: auto; flex-wrap: nowrap; }
  .document-filters button { font-size: 11px; }
  .agreements .search-label { width: auto; flex: 1; }
  .document-columns { display: none; }
  .agreement-row { grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
  .document-cell { grid-column: 1; grid-row: 1; }
  .recipient-cell { grid-column: 1; grid-row: 2; padding-left: 39px; font-size: 11px; color: #6b6b66; }
  .status { grid-column: 2; grid-row: 1; font-size: 10px; }
  .updated-cell { grid-column: 2; grid-row: 2; font-size: 11px; }
}

/* Mobile signer: enlarge the interactive hit area without moving PDF field geometry. */
@media (pointer: coarse) {
  #signPages .sign-field.field-checkbox {
    overflow: visible;
    z-index: 3;
  }
  #signPages .sign-field.field-checkbox .sign-checkbox {
    position: relative;
    overflow: visible;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  #signPages .sign-field.field-checkbox .sign-checkbox::after {
    content: "";
    position: absolute;
    width: max(44px, 100%);
    height: max(44px, 100%);
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }
  #signPages .sign-field.field-checkbox:focus-within {
    outline: 3px solid #e9b24a;
    outline-offset: 3px;
  }
}

/* Signing status: completed fields stay interactive but lose the editing halo. */
#signPages .sign-field.field-checkbox.completed {
  border-color: transparent;
  box-shadow: none;
  outline: none;
}
#signPages .sign-field.field-checkbox .sign-checkbox[aria-checked="true"] {
  background: transparent;
  border-color: transparent;
  color: #152b43;
  font-weight: 800;
}
#signPages .sign-field.field-checkbox .sign-checkbox[aria-checked="false"] {
  background: rgba(36,91,255,.08);
  border-color: #245bff;
}
#signPages .sign-field.field-checkbox.focused,
#signPages .sign-field.field-checkbox:focus-within {
  outline: 2px solid #e5a638;
  outline-offset: 2px;
}

/* Draw a centred check with CSS rather than a font glyph, whose baseline
   varies by browser and can extend below the original PDF checkbox. */
#signPages .sign-field.field-checkbox .sign-checkbox {
  font-size: 0;
  line-height: 0;
}
#signPages .sign-field.field-checkbox .sign-checkbox[aria-checked="true"]::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 32%;
  height: 55%;
  border: solid #142b43;
  border-width: 0 2.5px 2.5px 0;
  transform: translate(-50%, -62%) rotate(45deg);
  pointer-events: none;
}

/* Field palette drag-and-drop feedback for document setup */
#palette button[draggable="true"]{cursor:grab}
#palette button[draggable="true"]:active{cursor:grabbing}
#sheet.pdf-drop-active{outline:3px dashed #245bff;outline-offset:5px}
