:root {
  --bg: #f2f5fb;
  --card: #ffffff;
  --ink: #0a1225;
  --muted: #697589;
  --line: #dfe5ef;
  --accent: #5a5cf6;
  --accent-dark: #4143d6;
  --accent-2: #18b7a7;
  --soft: #eeefff;
  --success: #07875a;
  --success-soft: #eaf8f0;
  --warning: #8a5d00;
  --warning-soft: #fff7df;
  --danger: #b42318;
  --danger-soft: #fff0ef;
  --radius: 26px;
  --shadow: 0 22px 70px rgba(16, 28, 54, .075);
}

* { box-sizing: border-box; }
html { overflow-x: clip; scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: clip;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 4%, rgba(90, 92, 246, .09), transparent 26rem),
    radial-gradient(circle at 94% 26%, rgba(24, 183, 167, .075), transparent 28rem),
    linear-gradient(180deg, #f8faff 0, var(--bg) 48rem, #eef2f8 100%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
a { color: var(--accent-dark); }
.hidden { display: none !important; }
.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;
}

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px clamp(20px, 4vw, 58px);
  background: rgba(243, 245, 248, .92);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(215, 220, 228, .8);
}
.brand {
  display: inline-flex;
  align-items: baseline;
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -1px;
  text-decoration: none;
  white-space: nowrap;
}
.brand span { color: var(--accent); }
.brand small {
  margin-left: 7px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.topbar nav, footer nav { display: flex; gap: 24px; }
.topbar nav a, footer nav a, .auth-foot a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.topbar nav a:hover, footer nav a:hover, .auth-foot a:hover { color: var(--ink); }
.account { display: flex; align-items: center; gap: 12px; }
.account-copy { display: grid; text-align: right; }
.account-copy strong { font-size: 13px; }
.account-copy small { color: var(--muted); font-size: 10px; }

.shell { max-width: 1260px; margin: auto; padding: 0 28px 80px; }
.hero {
  min-height: 338px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
}
.eyebrow {
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.eyebrow.light { color: #9dbaff; }
.hero h1, .sign-info h1, .auth-brand-panel h1, .legal-shell h1 {
  margin: 0;
  line-height: 1;
  letter-spacing: -.055em;
}
.hero h1 { font-size: clamp(44px, 6vw, 76px); }
.hero h1 span { color: #98a0ae; }
.hero p {
  max-width: 610px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}
.hero-actions { display: flex; align-items: stretch; gap: 10px; margin-top: 25px; }
.hero-actions .hero-primary {
  width: 270px;
  min-width: 0;
  flex: 0 0 auto;
  justify-content: center;
  gap: 22px;
  margin: 0;
  white-space: nowrap;
}
.hero-secondary { width: auto; min-height: 48px; flex: 0 0 auto; padding-inline: 17px; }
.trust-row { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 24px; }
.trust-row span { color: #4d5665; font-size: 11px; font-weight: 750; }
.hero-badge {
  width: 250px;
  aspect-ratio: 1.25;
  display: flex;
  flex: none;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px;
  color: white;
  background: #111827;
  border-radius: 28px;
  box-shadow: 0 25px 70px rgba(17, 24, 39, .18);
}
.hero-badge small { color: #9dbaff; font-weight: 750; }
.hero-badge strong { margin-top: 4px; font-size: 26px; letter-spacing: -.03em; }
.hero-badge span { margin-top: 7px; color: #b7bec9; font-size: 11px; line-height: 1.5; }

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .7fr);
  gap: 22px;
  align-items: start;
}
.panel, .status-section, .doc-panel, .signature-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.form-panel { padding: 29px; }
.side-panel { padding: 14px; position: sticky; top: 92px; }
.quick-start-grid { grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); margin-top: 12px; }
.launch-panel {
  min-height: 360px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  align-content: center;
  padding: clamp(28px, 5vw, 54px);
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at 93% 8%, rgba(36, 94, 232, .12), transparent 30%),
    white;
}
.launch-panel::after {
  width: 160px;
  height: 160px;
  position: absolute;
  right: -80px;
  bottom: -95px;
  content: "";
  border: 28px solid rgba(36, 94, 232, .06);
  border-radius: 50%;
}
.launch-icon {
  width: 56px;
  height: 56px;
  display: grid;
  grid-row: 1 / span 2;
  place-items: center;
  color: white;
  background: var(--accent);
  border-radius: 18px;
  box-shadow: 0 14px 35px rgba(36, 94, 232, .24);
  font-size: 27px;
}
.launch-panel h2 { max-width: 620px; margin: 0; font-size: clamp(27px, 3vw, 39px); letter-spacing: -.045em; line-height: 1.08; }
.launch-panel p { max-width: 650px; margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.launch-steps {
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin: 7px 0 0;
  padding: 0;
  list-style: none;
}
.launch-steps li {
  display: grid;
  gap: 7px;
  padding: 12px;
  color: #545e6c;
  background: #f6f8fb;
  border: 1px solid #e8ebf0;
  border-radius: 12px;
  font-size: 9px;
  font-weight: 800;
}
.launch-steps span { color: var(--accent); font-size: 8px; letter-spacing: .08em; }
.launch-button { width: min(260px, 100%); grid-column: 2; margin-top: 2px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.section-head > div { display: flex; align-items: center; gap: 12px; }
.section-head > div > span {
  padding: 6px 8px;
  color: white;
  background: var(--ink);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
}
.section-head h2 { margin: 0; font-size: 23px; letter-spacing: -.03em; }
.section-head p { margin: 0; color: var(--muted); font-size: 12px; }

fieldset {
  min-width: 0;
  margin: 0 0 24px;
  padding: 20px;
  border: 1px solid #e6e9ee;
  border-radius: 16px;
}
legend {
  padding: 0 7px;
  color: #3e4653;
  font-size: 12px;
  font-weight: 850;
}
label { display: grid; gap: 8px; margin-bottom: 16px; font-size: 12px; font-weight: 750; }
input, select, textarea {
  width: 100%;
  padding: 13px 14px;
  color: var(--ink);
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  background: white;
  border-color: #92afea;
  box-shadow: 0 0 0 4px var(--soft);
}
input:disabled, select:disabled, textarea:disabled { color: #7b8390; background: #f0f2f5; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-note, .signature-legal {
  margin: -4px 0 16px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
}
.dropzone {
  min-height: 166px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  margin-bottom: 22px;
  text-align: center;
  background: #fafbfc;
  border: 1.5px dashed #c5cbd5;
  border-radius: 16px;
  cursor: pointer;
  transition: border-color .18s, background .18s;
}
.dropzone:hover, .dropzone.dragging { background: var(--soft); border-color: var(--accent); }
.upload-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  color: white;
  background: var(--ink);
  border-radius: 12px;
  font-size: 23px;
}
.dropzone small { margin-top: 5px; color: var(--muted); font-weight: 500; }
.recipients-head { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 14px; }
.recipients-head > div { display: grid; }
.recipients-head strong { font-size: 12px; }
.recipients-head small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.recipient-row {
  display: grid;
  grid-template-columns: 138px 1fr 1.4fr 42px;
  gap: 9px;
  position: relative;
  margin-bottom: 22px;
}
.recipient-row select { font-size: 12px; font-weight: 700; }
.recipient-row button {
  color: #9299a5;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  font-size: 20px;
}
.required-role { position: absolute; top: 49px; left: 3px; color: #7d8490; font-size: 9px; }

.primary, .ghost, .link-button {
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}
.primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
  padding: 15px 18px;
  color: white;
  background: var(--ink);
}
.primary:hover { background: #252c39; }
.primary:disabled, .ghost:disabled { cursor: not-allowed; opacity: .55; }
.ghost, .link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  color: #3f4753;
  background: #f1f3f6;
  font-size: 11px;
}
.ghost:hover, .link-button:hover { background: #e7eaf0; }
.ghost.compact { padding: 7px 10px; font-size: 10px; }
.danger-ghost { color: var(--danger); background: var(--danger-soft); }
.inline-primary { width: auto; margin: 0; white-space: nowrap; }
.wide { width: 100%; justify-content: center; margin-top: 10px; }
.check {
  display: flex;
  grid-template-columns: 18px 1fr;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0;
  color: #505967;
  font-weight: 500;
  line-height: 1.45;
}
.check input { width: auto; flex: none; margin-top: 2px; }
.review-check { padding: 0 6px; }
.result { margin-top: 14px; padding: 13px 14px; border-radius: 12px; font-size: 12px; line-height: 1.5; }
.result p { margin: 6px 0; }
.result.success { color: #075f3c; background: var(--success-soft); }
.result.error { color: var(--danger); background: var(--danger-soft); }
.result a { color: inherit; font-weight: 800; }
.preview-warning { margin: 10px 0; font-size: 10px; }
.debug-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.debug-links a {
  padding: 8px 10px;
  color: #174c9d;
  background: white;
  border: 1px solid #cddcf6;
  border-radius: 9px;
  text-decoration: none;
  font-weight: 750;
}
.warning-text, .error-text { color: var(--danger) !important; }

.security-state { display: flex; align-items: center; gap: 12px; padding: 15px 18px; background: #101827; border-radius: 15px; }
.security-state-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--success);
  border-radius: 50%;
}
.security-state div { display: grid; }
.security-state small { color: #a6b4c9; font-size: 9px; }
.security-state strong { color: white; font-size: 13px; }
.mini-card { display: flex; gap: 14px; padding: 18px; border-bottom: 1px solid var(--line); }
.mini-card:last-of-type { border-bottom: 0; }
.mini-icon {
  width: 34px;
  height: 34px;
  display: grid;
  flex: none;
  place-items: center;
  background: #f0f3f7;
  border-radius: 10px;
  font-weight: 900;
}
.mini-card strong { font-size: 12px; }
.mini-card p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.notice { margin-top: 10px; padding: 14px; color: #656e7c; background: #f6f8fa; border-radius: 14px; font-size: 10px; line-height: 1.55; }
.secure-notice { border-left: 3px solid var(--success); }

.analysis-panel {
  margin: -4px 0 24px;
  padding: 18px;
  overflow: hidden;
  background: linear-gradient(145deg, #f6f9ff, #fff);
  border: 1px solid #dce4f0;
  border-radius: 17px;
}
.analysis-scan { display: flex; align-items: center; gap: 12px; }
.analysis-scan > span, .ai-mark {
  width: 36px;
  height: 36px;
  display: grid;
  flex: none;
  place-items: center;
  color: white;
  background: var(--ink);
  border-radius: 11px;
  font-size: 17px;
}
.analysis-scan > div { display: grid; gap: 3px; }
.analysis-scan small { color: var(--muted); font-size: 10px; }
.analysis-progress { height: 3px; margin-top: 15px; overflow: hidden; background: #e3e9f2; border-radius: 20px; }
.analysis-progress i {
  width: 42%;
  height: 100%;
  display: block;
  background: var(--accent);
  border-radius: 20px;
  animation: analysisScan 1.1s ease-in-out infinite;
}
@keyframes analysisScan { from { transform: translateX(-110%); } to { transform: translateX(340%); } }
.analysis-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.analysis-head > div { display: flex; align-items: center; gap: 11px; }
.analysis-head h3 { margin: 2px 0 0; font-size: 18px; letter-spacing: -.03em; }
.analysis-head small { color: #5f6b7d; font-size: 9px; }
.analysis-ok { padding: 6px 8px; color: var(--success); background: var(--success-soft); border-radius: 999px; font-size: 9px; font-weight: 800; }
.analysis-summary { margin: 15px 0; color: #596272; font-size: 11px; line-height: 1.5; }
.document-conversion-note {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 10px;
  margin: -3px 0 10px;
  padding: 9px 10px;
  color: #245d4c;
  background: #edf8f4;
  border: 1px solid #d5ece4;
  border-radius: 11px;
}
.document-conversion-note > span {
  padding: 6px 4px;
  color: white;
  background: #18765b;
  border-radius: 7px;
  font-size: 7px;
  font-weight: 900;
  text-align: center;
}
.document-conversion-note > div { min-width: 0; display: grid; gap: 1px; }
.document-conversion-note strong { font-size: 9.5px; }
.document-conversion-note small { color: #607a72; font-size: 8px; line-height: 1.35; }
.document-conversion-note > i { font-size: 11px; font-style: normal; font-weight: 900; text-align: center; }
.analysis-facts { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 8px; }
.analysis-facts > div, .signature-map > div:not(.map-title) {
  display: grid;
  gap: 3px;
  padding: 11px;
  background: white;
  border: 1px solid #e4e9f0;
  border-radius: 11px;
}
.analysis-facts span, .signature-map span {
  color: #7b8492;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.analysis-facts strong, .signature-map strong { font-size: 10.5px; line-height: 1.35; }
.analysis-facts small, .signature-map small { overflow: hidden; color: #858c97; font-size: 9px; text-overflow: ellipsis; }
.signature-map { display: grid; grid-template-columns: 1.4fr repeat(2, 1fr); gap: 8px; margin-top: 8px; }
.signature-map .map-title { display: grid; align-content: center; gap: 3px; padding: 8px 4px; }
.analysis-note { display: flex; align-items: flex-start; gap: 9px; margin-top: 9px; padding: 9px 10px; color: #596374; background: #f0f4f9; border-radius: 10px; }
.analysis-note > span { width: 17px; height: 17px; display: grid; flex: none; place-items: center; background: #dce4ef; border-radius: 50%; font-size: 9px; font-weight: 900; }
.analysis-note p, .analysis-error p { margin: 0; font-size: 9.5px; line-height: 1.45; }
.analysis-error { color: #74591a; background: #fff8e9; border-color: #f1dfad; }

.status-section { margin-top: 22px; padding: 28px; }
.envelopes { display: grid; gap: 12px; }
.envelope-card { padding: 18px; border: 1px solid var(--line); border-radius: 16px; }
.envelope-title { display: flex; justify-content: space-between; gap: 20px; }
.envelope-title h3 { margin: 8px 0 2px; font-size: 16px; }
.envelope-title small { color: var(--muted); font-size: 10px; }
.status {
  display: inline-block;
  padding: 6px 8px;
  color: #555e6b;
  background: #eef1f5;
  border-radius: 999px;
  font-size: 8.5px;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.status.completed, .status.signed { color: var(--success); background: var(--success-soft); }
.status.partially_signed { color: var(--warning); background: var(--warning-soft); }
.status.revoked, .status.expired { color: var(--danger); background: var(--danger-soft); }
.count { font-size: 27px; font-weight: 900; text-align: right; }
.count span { display: block; color: var(--muted); font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
.recipient-list { display: grid; margin-top: 16px; }
.recipient-list > div {
  display: grid;
  grid-template-columns: 12px 1fr 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid #eef1f4;
  font-size: 10px;
}
.recipient-list small { color: var(--muted); }
.recipient-list em { color: var(--muted); font-style: normal; text-align: right; }
.dot { width: 7px; height: 7px; background: #c0c6cf; border-radius: 50%; }
.dot.signed { background: #11a568; }
.dot.revoked, .dot.expired { background: var(--danger); }
.role-tag {
  display: inline-block;
  margin-left: 5px;
  padding: 3px 5px;
  color: #53667f;
  background: #ebf0f6;
  border-radius: 999px;
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.empty { padding: 30px; color: var(--muted); text-align: center; }
.user-form { display: grid; grid-template-columns: 1.1fr 1.4fr .8fr 1.2fr auto; gap: 10px; align-items: end; }
.user-form label { margin: 0; }
.users-list { display: grid; margin-top: 20px; }
.user-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto minmax(160px, auto);
  gap: 14px;
  align-items: center;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}
.user-row > div { display: grid; }
.user-row small { color: var(--muted); font-size: 10px; }
.user-actions { display: flex !important; justify-content: flex-end; gap: 6px; }
.security-dashboard { margin-bottom: 24px; padding: 16px; background: #f7f9fb; border: 1px solid var(--line); border-radius: 14px; }
.security-dashboard-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.security-dashboard-head > div { display: grid; }
.security-dashboard-head strong { font-size: 12px; }
.security-dashboard-head small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.security-checks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin: 13px 0; }
.security-checks > div { display: flex; align-items: center; gap: 7px; padding: 9px; background: white; border: 1px solid #e5e9ef; border-radius: 9px; }
.security-checks span { width: 18px; height: 18px; display: grid; flex: none; place-items: center; color: white; border-radius: 50%; font-size: 8px; font-weight: 900; }
.security-checks .ok span { background: var(--success); }
.security-checks .open span { background: #d18a00; }
.security-checks strong { font-size: 8.5px; }
.retention-action { display: flex; gap: 8px; }
.retention-action select { min-width: 180px; }

.detail-dialog {
  width: min(760px, calc(100vw - 28px));
  max-height: calc(100vh - 40px);
  padding: 28px;
  border: 0;
  border-radius: 20px;
  box-shadow: 0 30px 100px rgba(10, 17, 28, .25);
}
.detail-dialog::backdrop { background: rgba(15, 23, 42, .55); backdrop-filter: blur(3px); }
.detail-dialog h2 { margin: 0 40px 22px 0; font-size: 30px; letter-spacing: -.04em; }
.detail-dialog h3 { margin: 24px 0 10px; font-size: 13px; }
.dialog-close { position: absolute; top: 18px; right: 18px; border: 0; background: none; cursor: pointer; font-size: 25px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.detail-grid > div { display: grid; gap: 4px; padding: 12px; background: #f6f8fa; border-radius: 11px; }
.detail-grid span { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.detail-grid strong { font-size: 11px; }
.detail-recipients { display: grid; gap: 8px; }
.detail-recipients > div { display: grid; grid-template-columns: 1fr 1.5fr auto auto; gap: 10px; align-items: center; padding: 11px; border: 1px solid var(--line); border-radius: 10px; font-size: 10px; }
.detail-recipients span, .detail-recipients em { color: var(--muted); font-style: normal; }
.audit-list { list-style: none; display: grid; gap: 7px; margin: 0; padding: 0; }
.audit-list li { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid #eff1f4; }
.audit-list li > span { width: 25px; height: 25px; display: grid; flex: none; place-items: center; color: white; background: var(--ink); border-radius: 8px; font-size: 9px; }
.audit-list li > div { display: grid; }
.audit-list strong { font-size: 10px; }
.audit-list small { color: var(--muted); font-size: 8.5px; }

.secure-pill { padding: 8px 11px; color: var(--success); background: var(--success-soft); border-radius: 999px; font-size: 10px; font-weight: 750; }
.sign-page { background: #edf0f4; }
.sign-shell { max-width: 1440px; margin: auto; padding: 28px; }
.sign-info { min-height: 120px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 10px 0 24px; }
.sign-info h1 { font-size: clamp(34px, 4vw, 54px); }
.sign-info p { color: var(--muted); font-size: 12px; }
.sign-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(340px, .7fr); gap: 18px; align-items: start; }
.doc-panel, .signature-panel { overflow: hidden; }
.doc-panel iframe { width: 100%; height: calc(100vh - 220px); min-height: 620px; display: block; background: #cfd4dc; border: 0; }
.signature-panel { padding: 24px; position: sticky; top: 92px; overflow: visible; }
.signature-panel h2 { margin: 0 0 8px; font-size: 28px; letter-spacing: -.04em; }
.muted { color: var(--muted); font-size: 11px; line-height: 1.55; }
.canvas-wrap { height: 180px; overflow: hidden; background: repeating-linear-gradient(0deg, #fff, #fff 35px, #f0f2f5 36px); border: 1px solid var(--line); border-radius: 14px; }
.canvas-wrap canvas { width: 100%; height: 180px; cursor: crosshair; touch-action: none; }
.consent-box { margin-top: 16px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; }
.consent-box .check { margin: 0; padding: 13px; font-size: 10px; }
.consent-box .check + .check { border-top: 1px solid var(--line); }
.consent-box .optional-check { background: #f7f9fb; }
.consent-box .optional-check strong { color: #667085; font-size: 8px; letter-spacing: .05em; text-transform: uppercase; }
.signature-legal { margin: 12px 2px 0; }
.placement-status {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0 14px;
  padding: 11px 12px;
  color: #174f9d;
  background: #edf4ff;
  border: 1px solid #d7e5ff;
  border-radius: 13px;
}
.placement-status > span { font-size: 18px; line-height: 1; }
.placement-status div { display: grid; gap: 2px; }
.placement-status strong { font-size: 10px; }
.placement-status small { color: #5476a5; font-size: 9px; line-height: 1.4; }
.placement-status.fallback { color: #7a5800; background: #fff8e6; border-color: #f4e2a7; }
.placement-status.fallback small { color: #8b7338; }
.sign-steps { margin-bottom: 16px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; }
.sign-steps-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.sign-steps-title strong { font-size: 10px; }
.sign-steps-title small { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.sign-steps ol { list-style: none; display: grid; gap: 7px; margin: 0; padding: 0; }
.sign-steps li { display: flex; align-items: center; gap: 9px; }
.sign-steps li > span { width: 23px; height: 23px; display: grid; flex: none; place-items: center; color: white; background: var(--ink); border-radius: 8px; font-size: 9px; font-weight: 800; }
.sign-steps li > div { display: grid; }
.sign-steps li strong { font-size: 9.5px; }
.sign-steps li small { color: var(--muted); font-size: 8px; }
.sign-steps li.optional > span { color: #67707c; background: #edf0f4; }
.fatal { max-width: 700px; margin: auto; padding: 80px 20px; text-align: center; }
.fatal h1 { margin: 25px 0 10px; font-size: 40px; letter-spacing: -.04em; }
.fatal p { color: var(--muted); line-height: 1.6; }
.skeleton { width: 100%; height: 80px; background: linear-gradient(90deg, #e3e6ea, #f2f4f7, #e3e6ea); background-size: 220% 100%; border-radius: 18px; animation: pulse 1.2s infinite; }
@keyframes pulse { to { background-position: -120% 0; } }

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #e9edf3; }
.auth-shell {
  width: min(1040px, 100%);
  min-height: 620px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  overflow: hidden;
  background: white;
  border: 1px solid #dbe0e7;
  border-radius: 28px;
  box-shadow: 0 35px 100px rgba(19, 28, 43, .14);
}
.auth-brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 46px;
  color: white;
  background:
    radial-gradient(circle at 10% 10%, rgba(43, 102, 237, .6), transparent 34%),
    linear-gradient(145deg, #0c1321, #172338);
}
.brand-inverse { color: white; }
.auth-brand-panel h1 { max-width: 470px; font-size: clamp(40px, 5vw, 62px); }
.auth-brand-panel p { max-width: 480px; color: #b7c0ce; font-size: 15px; line-height: 1.65; }
.auth-brand-panel > small { color: #8290a5; }
.auth-card { align-self: center; padding: 50px clamp(30px, 6vw, 68px); }
.auth-card h2 { margin: 0 0 8px; font-size: 36px; letter-spacing: -.045em; }
.auth-card form { margin-top: 28px; }
.auth-foot { display: flex; gap: 18px; margin-top: 30px; }

.legal-page { background: white; }
.legal-shell { max-width: 860px; min-height: calc(100vh - 180px); margin: auto; padding: 72px 28px 90px; }
.legal-shell h1 { margin-bottom: 20px; font-size: clamp(44px, 7vw, 74px); }
.legal-lead { max-width: 720px; margin-bottom: 42px; color: var(--muted); font-size: 17px; line-height: 1.6; }
.legal-shell section { padding: 24px 0; border-top: 1px solid var(--line); }
.legal-shell h2 { margin: 0 0 12px; font-size: 19px; letter-spacing: -.02em; }
.legal-shell h3 { margin: 20px 0 6px; font-size: 13px; }
.legal-shell p, .legal-shell li { color: #4e5764; font-size: 13px; line-height: 1.7; }
.legal-shell ul { padding-left: 20px; }
.legal-item { padding-left: 17px; border-left: 3px solid #dce6fa; }
.legal-version { color: var(--muted) !important; font-size: 10px !important; }

.invisible { visibility: hidden; }
.workflow-dialog {
  width: min(920px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 28px);
  padding: 0;
  overflow: visible;
  background: transparent;
  border: 0;
}
.workflow-dialog::backdrop,
.action-dialog::backdrop,
.notice-dialog::backdrop {
  background: rgba(10, 17, 28, .62);
  backdrop-filter: blur(6px);
  animation: backdropIn .22s ease both;
}
.workflow-shell {
  max-height: calc(100vh - 28px);
  overflow: auto;
  position: relative;
  background: white;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 25px;
  box-shadow: 0 35px 120px rgba(8, 15, 28, .32);
}
.workflow-dialog[open] .workflow-shell,
.action-dialog[open],
.notice-dialog[open],
.detail-dialog[open] { animation: dialogIn .3s cubic-bezier(.2, .8, .2, 1) both; }
.workflow-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 34px 19px;
  border-bottom: 1px solid #edf0f4;
}
.workflow-header .eyebrow { margin-bottom: 6px; }
.workflow-header h2 { margin: 0; font-size: 29px; letter-spacing: -.04em; }
.workflow-header > small {
  margin: 11px 38px 0 0;
  padding: 7px 10px;
  color: #526071;
  background: #f2f5f9;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
}
.workflow-progress {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto 1fr auto;
  align-items: center;
  padding: 18px 34px;
  background: #fafbfd;
  border-bottom: 1px solid #edf0f4;
}
.workflow-progress button {
  display: grid;
  grid-template-columns: 26px auto;
  gap: 8px;
  align-items: center;
  padding: 0;
  color: #8a929e;
  background: none;
  border: 0;
  cursor: pointer;
}
.workflow-progress button:disabled { cursor: default; }
.workflow-progress button span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: #77808d;
  background: #e9edf2;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 900;
  transition: color .2s, background .2s, transform .2s;
}
.workflow-progress button small { font-size: 9px; font-weight: 800; }
.workflow-progress button.active { color: var(--ink); }
.workflow-progress button.active span {
  color: white;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(36, 94, 232, .1);
  transform: scale(1.05);
}
.workflow-progress button.complete { color: var(--success); }
.workflow-progress button.complete span { color: white; background: var(--success); }
.workflow-progress i { height: 1px; margin: 0 12px; background: #dfe4ea; }
.wizard-step { min-height: 390px; padding: 30px 34px 20px; }
.wizard-step.step-enter { animation: stepIn .28s cubic-bezier(.2, .75, .25, 1) both; }
.wizard-copy { margin-bottom: 22px; }
.wizard-copy h3 { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.wizard-copy p { max-width: 650px; margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.wizard-step .dropzone { min-height: 205px; }
.workflow-actions {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 14px 34px;
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: rgba(255, 255, 255, .95);
  border-top: 1px solid #e7eaf0;
  backdrop-filter: blur(14px);
}
.workflow-actions > div { min-width: 0; display: flex; flex: 0 1 auto; gap: 9px; }
.workflow-actions .primary {
  width: auto;
  min-width: 220px;
  max-width: 100%;
  grid-column: auto;
  flex: 0 1 auto;
  white-space: nowrap;
}
.dropzone.attention { animation: attention .38s ease both; border-color: var(--danger); }
.review-summary { display: grid; gap: 10px; }
.review-document,
.review-grid > div,
.review-recipients {
  padding: 14px;
  background: #f7f9fc;
  border: 1px solid #e6eaf0;
  border-radius: 14px;
}
.review-document { display: flex; align-items: center; gap: 13px; }
.review-file-icon {
  width: 42px;
  height: 48px;
  display: grid;
  flex: none;
  place-items: center;
  color: white;
  background: var(--accent);
  border-radius: 10px;
  font-size: 8px;
  font-weight: 900;
}
.review-document > div,
.review-grid > div { display: grid; gap: 3px; min-width: 0; }
.review-summary small { color: #7a8492; font-size: 8px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.review-summary strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; }
.review-summary span, .review-summary em { overflow: hidden; color: var(--muted); font-size: 9px; font-style: normal; text-overflow: ellipsis; }
.review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.review-recipients > small { display: block; margin-bottom: 8px; }
.review-recipients > div {
  display: grid;
  grid-template-columns: 95px 1fr 1.4fr;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid #e4e8ee;
}
.review-recipients > div > span { color: var(--accent-dark); font-weight: 800; }

.action-dialog,
.notice-dialog {
  width: min(480px, calc(100vw - 28px));
  max-width: none;
  height: fit-content;
  max-height: calc(100dvh - 32px);
  padding: 30px;
  overflow-y: auto;
  border: 0;
  border-radius: 23px;
  box-shadow: 0 35px 120px rgba(8, 15, 28, .33);
}
.action-dialog form { display: grid; gap: 19px; }
.sign-confirm-content { display: grid; gap: 19px; }
.sign-confirm-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(100px, .8fr) minmax(112px, .8fr);
  gap: 7px;
}
.sign-confirm-summary > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 11px;
  background: #f5f7fa;
  border: 1px solid #e6eaf0;
  border-radius: 11px;
}
.sign-confirm-summary small { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.sign-confirm-summary strong { min-width: 0; overflow-wrap: anywhere; font-size: 10px; line-height: 1.35; }
.sign-success-dialog .primary { text-decoration: none; }
.action-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--accent);
  border-radius: 15px;
  box-shadow: 0 10px 28px rgba(36, 94, 232, .22);
  font-size: 19px;
  font-weight: 900;
}
.action-dialog.danger .action-icon { background: var(--danger); box-shadow: 0 10px 28px rgba(180, 35, 24, .2); }
.action-dialog .eyebrow { margin-bottom: 6px; }
.action-dialog h2, .notice-dialog h2 { margin: 0; font-size: 27px; letter-spacing: -.04em; }
.action-dialog p, .notice-dialog p { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.action-dialog label { margin: 0; }
.action-buttons { display: flex; justify-content: flex-end; gap: 9px; margin-top: 3px; }
.danger-primary { background: var(--danger); }
.danger-primary:hover { background: #8f1f17; }
.notice-dialog { text-align: center; }
.notice-dialog .dialog-close { top: 15px; right: 15px; }
.notice-dialog .eyebrow { margin: 17px 0 7px; }
.notice-dialog .debug-links { justify-content: center; }
.success-orbit {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  position: relative;
  color: white;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 10px var(--success-soft);
}
.success-orbit::after {
  width: 100%;
  height: 100%;
  position: absolute;
  content: "";
  border: 1px solid rgba(8, 118, 74, .35);
  border-radius: 50%;
  animation: successPulse 1.8s ease-out infinite;
}
.success-orbit span { font-size: 29px; font-weight: 900; animation: successTick .4s .15s cubic-bezier(.2, 1.5, .4, 1) both; }
.toast-region {
  width: min(390px, calc(100vw - 28px));
  display: grid;
  gap: 9px;
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 15px;
  color: white;
  background: #172131;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  box-shadow: 0 18px 55px rgba(10, 17, 28, .28);
  animation: toastIn .28s cubic-bezier(.2, .8, .2, 1) both;
}
.toast > span {
  width: 25px;
  height: 25px;
  display: grid;
  flex: none;
  place-items: center;
  background: rgba(255, 255, 255, .13);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 900;
}
.toast.success > span { background: var(--success); }
.toast.error > span { background: var(--danger); }
.toast p { margin: 0; font-size: 11px; line-height: 1.45; }
.toast.leaving { animation: toastOut .22s ease both; }

.app-ready .hero > div:first-child { animation: heroIn .55s cubic-bezier(.2, .8, .2, 1) both; }
.app-ready .hero-stage { animation: badgeIn .65s .08s cubic-bezier(.2, .8, .2, 1) both; }
.app-ready .quick-start-grid { animation: heroIn .55s .12s cubic-bezier(.2, .8, .2, 1) both; }
.launch-button span, .hero-primary span, .workflow-actions .primary span { transition: transform .18s; }
.launch-button:hover span, .hero-primary:hover span, .workflow-actions .primary:hover span { transform: translateX(4px); }
.envelope-card { transition: transform .18s, border-color .18s, box-shadow .18s; }
.envelope-card:hover { border-color: #cfd7e4; box-shadow: 0 12px 35px rgba(22, 29, 40, .06); transform: translateY(-2px); }

@keyframes heroIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes badgeIn {
  from { opacity: 0; transform: translateY(18px) rotate(2deg) scale(.96); }
  to { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
}
@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes dialogIn {
  from { opacity: 0; transform: translateY(18px) scale(.975); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes stepIn {
  from { opacity: 0; transform: translateX(14px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes attention {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-7px); }
  60% { transform: translateX(6px); }
}
@keyframes successPulse {
  from { opacity: .7; transform: scale(1); }
  to { opacity: 0; transform: scale(1.42); }
}
@keyframes successTick {
  from { opacity: 0; transform: scale(.45) rotate(-12deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(8px); }
}
body > footer {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px clamp(22px, 4vw, 58px);
  color: var(--muted);
  background: #e9edf3;
  font-size: 11px;
}

/* Premium visual refresh */
.topbar {
  min-height: 78px;
  padding-inline: max(24px, calc((100vw - 1320px) / 2));
  background: rgba(248, 250, 255, .78);
  border-bottom: 1px solid rgba(210, 218, 233, .72);
  box-shadow: 0 8px 36px rgba(18, 30, 58, .025);
}
.brand {
  align-items: center;
  letter-spacing: -.055em;
}
.brand::before {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-right: 10px;
  content: "S";
  color: white;
  background: linear-gradient(145deg, #7577ff, #4546df 58%, #292b9f);
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 11px;
  box-shadow: 0 10px 24px rgba(77, 78, 226, .24), inset 0 1px rgba(255, 255, 255, .34);
  font-size: 15px;
  letter-spacing: 0;
}
.topbar nav {
  gap: 4px;
  padding: 4px;
  background: rgba(255, 255, 255, .68);
  border: 1px solid rgba(220, 226, 237, .78);
  border-radius: 999px;
}
.topbar nav a {
  padding: 9px 14px;
  border-radius: 999px;
  transition: color .18s, background .18s, box-shadow .18s;
}
.topbar nav a:hover {
  color: var(--ink);
  background: white;
  box-shadow: 0 5px 16px rgba(15, 24, 46, .07);
}
.account { gap: 10px; }
.account-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  flex: none;
  place-items: center;
  color: #3e3fc9;
  background: linear-gradient(145deg, #f0f0ff, #dedfff);
  border: 1px solid #d7d8fb;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 900;
  box-shadow: inset 0 1px white;
}
.account-copy strong { letter-spacing: -.01em; }
.account .ghost {
  background: rgba(255, 255, 255, .78);
  border: 1px solid var(--line);
}

.shell { max-width: 1376px; padding: 24px 28px 96px; }
.hero {
  min-height: 570px;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(430px, .96fr);
  gap: clamp(30px, 5vw, 76px);
  align-items: center;
  padding: clamp(44px, 6vw, 78px);
  overflow: hidden;
  position: relative;
  color: white;
  background:
    radial-gradient(circle at 79% 20%, rgba(112, 116, 255, .38), transparent 31%),
    radial-gradient(circle at 96% 89%, rgba(26, 190, 174, .2), transparent 32%),
    linear-gradient(138deg, #080d1d 0%, #111a37 52%, #171c54 100%);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 38px;
  box-shadow: 0 38px 100px rgba(13, 20, 50, .2);
}
.hero::before {
  width: 470px;
  height: 470px;
  position: absolute;
  top: -250px;
  left: 36%;
  content: "";
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 50%;
  box-shadow:
    0 0 0 74px rgba(255, 255, 255, .018),
    0 0 0 150px rgba(255, 255, 255, .012);
  pointer-events: none;
}
.hero-copy { min-width: 0; position: relative; z-index: 2; }
.hero-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 20px;
  color: #c4c7ff;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.hero-kicker > span {
  width: 7px;
  height: 7px;
  position: relative;
  background: #5ce0c9;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(92, 224, 201, .11);
}
.hero h1 {
  max-width: 680px;
  font-size: clamp(51px, 5.7vw, 82px);
  line-height: .96;
  letter-spacing: -.064em;
}
.hero h1 span {
  color: transparent;
  background: linear-gradient(90deg, #b6b8ff, #f5f5ff 48%, #80eadc);
  -webkit-background-clip: text;
  background-clip: text;
}
.hero p {
  max-width: 620px;
  margin: 24px 0 0;
  color: #b8c0d4;
  font-size: 16px;
  line-height: 1.7;
}
.hero-actions { margin-top: 31px; }
.hero-actions .hero-primary {
  width: 278px;
  min-height: 54px;
  color: #0c1530;
  background: white;
  border: 1px solid rgba(255, 255, 255, .75);
  box-shadow: 0 16px 38px rgba(0, 0, 0, .18);
}
.hero-actions .hero-primary:hover {
  color: #171952;
  background: #ededff;
}
.hero-secondary {
  min-height: 54px;
  color: #e5e8f6;
  background: rgba(255, 255, 255, .075);
  border: 1px solid rgba(255, 255, 255, .15);
  backdrop-filter: blur(8px);
}
.hero-secondary:hover {
  color: white;
  background: rgba(255, 255, 255, .14);
}
.trust-row { gap: 14px 22px; margin-top: 27px; }
.trust-row span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #aeb7cc;
  font-size: 10px;
  font-weight: 700;
}
.trust-row i {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  color: #8fe6d7;
  background: rgba(78, 209, 187, .1);
  border: 1px solid rgba(105, 225, 205, .2);
  border-radius: 50%;
  font-size: 8px;
  font-style: normal;
}
.hero-stage {
  min-height: 420px;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 2;
  perspective: 1000px;
}
.hero-glow {
  width: 390px;
  height: 390px;
  position: absolute;
  background: radial-gradient(circle, rgba(110, 114, 255, .3), rgba(110, 114, 255, 0) 69%);
  filter: blur(5px);
  animation: glowDrift 6s ease-in-out infinite alternate;
}
.hero-document {
  width: min(390px, 86%);
  min-height: 386px;
  padding: 22px;
  overflow: hidden;
  position: relative;
  isolation: isolate;
  background: linear-gradient(152deg, rgba(255, 255, 255, .98), rgba(239, 242, 255, .94));
  border: 1px solid rgba(255, 255, 255, .82);
  border-radius: 27px;
  box-shadow: 0 42px 90px rgba(1, 4, 18, .42), inset 0 1px white;
  transform: rotateY(-5deg) rotateX(2deg) rotate(1.4deg);
}
.hero-document::after {
  position: absolute;
  inset: -25% 0;
  content: "";
  background: linear-gradient(112deg, transparent 37%, rgba(255, 255, 255, .42) 49%, rgba(255, 255, 255, .18) 54%, transparent 66%);
  border-radius: 0;
  transform: translate3d(-150%, 0, 0);
  animation: documentShine 5.2s linear infinite;
  will-change: transform;
  pointer-events: none;
}
.hero-document-head {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 12px;
  align-items: center;
  padding-bottom: 18px;
  color: var(--ink);
  border-bottom: 1px solid #e4e7f1;
}
.hero-filemark {
  width: 46px;
  height: 52px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(145deg, #6769fa, #4446d9);
  border-radius: 13px;
  box-shadow: 0 9px 22px rgba(77, 79, 226, .24);
  font-size: 9px;
  font-weight: 900;
}
.hero-document-head > div { display: grid; gap: 3px; }
.hero-document-head small {
  color: #7b8498;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.hero-document-head strong { font-size: 12px; }
.hero-doc-status {
  padding: 6px 8px;
  color: #06744d;
  background: #e6f8f0;
  border: 1px solid #cef0e2;
  border-radius: 999px;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.hero-document-lines { display: grid; gap: 11px; padding: 25px 4px 22px; }
.hero-document-lines i {
  height: 7px;
  display: block;
  background: #e7eaf1;
  border-radius: 999px;
}
.hero-document-lines i:nth-child(1) { width: 92%; }
.hero-document-lines i:nth-child(2) { width: 74%; }
.hero-document-lines i:nth-child(3) { width: 84%; }
.hero-document-lines i:nth-child(4) { width: 56%; }
.hero-route {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  align-items: start;
  padding: 18px 14px;
  color: #929aac;
  background: rgba(244, 246, 251, .9);
  border: 1px solid #e6e9f1;
  border-radius: 18px;
}
.hero-route div {
  display: grid;
  justify-items: center;
  gap: 6px;
}
.hero-route div > span {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  color: #737d91;
  background: white;
  border: 1px solid #dde2eb;
  border-radius: 9px;
  font-size: 8px;
  font-weight: 900;
}
.hero-route div > small { font-size: 7px; font-weight: 800; }
.hero-route > i {
  height: 2px;
  margin: 13px 8px 0;
  overflow: hidden;
  position: relative;
  background: #dfe4ed;
  border-radius: 99px;
}
.hero-route > i::after {
  width: 44%;
  height: 100%;
  display: block;
  content: "";
  background: #696bfa;
  animation: routePulse 2s ease-in-out infinite;
}
.hero-route .done > span {
  color: white;
  background: var(--accent-2);
  border-color: var(--accent-2);
}
.hero-route .active > span {
  color: white;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 5px rgba(90, 92, 246, .11);
}
.hero-route .done small, .hero-route .active small { color: #4e586b; }
.hero-complete {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 14px;
  padding: 12px 14px;
  color: #243044;
  background: linear-gradient(90deg, #e8fbf6, #f4fffc);
  border: 1px solid #d3f2e9;
  border-radius: 15px;
}
.hero-complete > span {
  width: 27px;
  height: 27px;
  display: grid;
  flex: none;
  place-items: center;
  color: white;
  background: var(--success);
  border-radius: 9px;
  font-size: 10px;
  font-weight: 900;
}
.hero-complete > div { display: grid; gap: 2px; }
.hero-complete small { color: #73847e; font-size: 7px; text-transform: uppercase; }
.hero-complete strong { font-size: 9px; }
.hero-float {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  position: absolute;
  color: #111a31;
  background: rgba(255, 255, 255, .9);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 15px;
  box-shadow: 0 20px 48px rgba(1, 5, 23, .23);
  backdrop-filter: blur(12px);
  animation: heroFloat 4.4s ease-in-out infinite;
}
.hero-float > span {
  width: 29px;
  height: 29px;
  display: grid;
  flex: none;
  place-items: center;
  color: white;
  background: var(--accent);
  border-radius: 9px;
  font-size: 10px;
  font-weight: 900;
}
.hero-float > div { display: grid; gap: 2px; }
.hero-float small { color: #7b8497; font-size: 7px; }
.hero-float strong { font-size: 9px; }
.hero-float-top { top: 18px; right: 0; }
.hero-float-bottom { left: -10px; bottom: 28px; animation-delay: -2.2s; }
.hero-float-bottom > span { background: #e6fbf6; }
.hero-float-bottom > span::after {
  width: 8px;
  height: 8px;
  content: "";
  background: #13ad8e;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(19, 173, 142, .13);
}

.quick-start-grid {
  grid-template-columns: minmax(0, 1.42fr) minmax(320px, .58fr);
  gap: 24px;
  margin-top: 26px;
}
.panel, .status-section, .doc-panel, .signature-panel {
  border-color: rgba(216, 224, 237, .9);
  box-shadow: var(--shadow);
}
.launch-panel {
  min-height: 410px;
  padding: clamp(32px, 5vw, 58px);
  background:
    linear-gradient(127deg, rgba(255, 255, 255, .99), rgba(247, 248, 255, .94)),
    white;
}
.launch-panel::before {
  width: 260px;
  height: 260px;
  position: absolute;
  top: -170px;
  right: -65px;
  content: "";
  background: radial-gradient(circle, rgba(90, 92, 246, .16), transparent 68%);
  border-radius: 50%;
}
.launch-panel::after {
  right: -72px;
  bottom: -93px;
  border-color: rgba(90, 92, 246, .055);
}
.launch-icon {
  width: 61px;
  height: 61px;
  background: linear-gradient(145deg, #7476ff, #4a4ce2);
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 19px;
  box-shadow: 0 16px 38px rgba(75, 77, 224, .25), inset 0 1px rgba(255, 255, 255, .35);
  font-size: 22px;
}
.launch-panel .eyebrow { color: #5557e7; }
.launch-panel h2 { max-width: 690px; font-size: clamp(31px, 3.2vw, 44px); }
.launch-steps { gap: 9px; margin-top: 13px; }
.launch-steps li {
  min-height: 78px;
  align-content: space-between;
  padding: 14px;
  color: #4d5870;
  background: rgba(246, 248, 252, .82);
  border-color: #e4e8f0;
  border-radius: 15px;
  transition: transform .2s, border-color .2s, background .2s;
}
.launch-steps li:hover {
  background: white;
  border-color: #d4d5fa;
  transform: translateY(-2px);
}
.launch-steps span { color: #585af0; }
.launch-button {
  min-height: 52px;
  background: linear-gradient(100deg, #10182c, #242054);
  box-shadow: 0 15px 35px rgba(15, 22, 44, .14);
}
.launch-button:hover { background: linear-gradient(100deg, #171f35, #34306d); }
.side-panel {
  padding: 13px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(12px);
}
.security-state {
  padding: 18px;
  background:
    radial-gradient(circle at 10% 0, rgba(90, 92, 246, .22), transparent 43%),
    linear-gradient(135deg, #0b1327, #151c38);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 18px;
}
.security-state-icon {
  background: linear-gradient(145deg, #1bb995, #087d5f);
  box-shadow: 0 8px 20px rgba(9, 142, 103, .2);
}
.mini-card { padding: 19px 16px; }
.mini-icon {
  color: #494bd2;
  background: #eff0ff;
  border: 1px solid #dfe0fa;
}
.secure-notice {
  color: #546176;
  background: linear-gradient(100deg, #f0faf7, #f7fbfa);
  border: 1px solid #ddf0ea;
  border-left: 3px solid var(--success);
}

.status-section {
  margin-top: 26px;
  padding: 32px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(14px);
}
.section-head > div > span {
  color: #5557e7;
  background: #eeefff;
  border: 1px solid #dddffd;
}
.envelopes { gap: 13px; }
.envelope-card {
  padding: 20px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(115deg, #fff, #fbfcff);
  border-color: #e2e7ef;
  border-radius: 19px;
}
.envelope-card::before {
  width: 3px;
  position: absolute;
  top: 17px;
  bottom: 17px;
  left: 0;
  content: "";
  background: linear-gradient(var(--accent), var(--accent-2));
  border-radius: 0 4px 4px 0;
  opacity: .72;
}
.envelope-card:hover {
  border-color: #d1d3f4;
  box-shadow: 0 18px 44px rgba(31, 36, 76, .075);
  transform: translateY(-3px);
}
.count {
  width: 64px;
  height: 64px;
  display: grid;
  flex: none;
  place-items: center;
  position: relative;
  border-radius: 50%;
}
.count svg {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  overflow: visible;
  transform: rotate(-90deg);
}
.count circle {
  fill: none;
  stroke-width: 3.5;
}
.count-track { stroke: #e8ebf2; }
.count-progress {
  stroke: var(--accent);
  stroke-linecap: round;
}
.count > div {
  width: calc(100% - 10px);
  height: calc(100% - 10px);
  display: grid;
  align-content: center;
  justify-items: center;
  position: relative;
  background: white;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px #f0f2f6;
}
.count strong { font-size: 14px; line-height: 1; }
.count span { margin-top: 3px; font-size: 6px; }
.status {
  border: 1px solid rgba(112, 122, 139, .08);
}
.recipient-list > div { padding-block: 11px; }
.dot {
  box-shadow: 0 0 0 4px rgba(192, 198, 207, .16);
}
.dot.signed { box-shadow: 0 0 0 4px rgba(17, 165, 104, .12); }

.primary {
  background: linear-gradient(110deg, #11192e, #25204f);
  box-shadow: 0 10px 24px rgba(13, 20, 42, .1);
  transition: transform .18s, background .18s, box-shadow .18s;
}
.primary:hover {
  background: linear-gradient(110deg, #1a233a, #36306b);
  box-shadow: 0 13px 30px rgba(13, 20, 42, .16);
  transform: translateY(-1px);
}
.primary.danger-primary {
  background: linear-gradient(110deg, #c3382d, #941f18);
  box-shadow: 0 10px 24px rgba(180, 35, 24, .16);
}
.primary.danger-primary:hover { background: linear-gradient(110deg, #af2c23, #7f1914); }
.ghost {
  transition: color .18s, background .18s, border-color .18s, transform .18s;
}
input, select, textarea {
  background: #fafbfe;
  border-color: #dce2ec;
  border-radius: 13px;
}
input:focus, select:focus, textarea:focus {
  border-color: #8d8ff8;
  box-shadow: 0 0 0 4px rgba(90, 92, 246, .11);
}
.dropzone {
  background:
    radial-gradient(circle at 50% 0, rgba(90, 92, 246, .07), transparent 50%),
    #fafbff;
  border-color: #cfd4e2;
  border-radius: 19px;
}
.dropzone:hover, .dropzone.dragging {
  background: #f2f2ff;
  border-color: #7779f4;
}
.upload-icon {
  background: linear-gradient(145deg, #6d6ffa, #4749d9);
  box-shadow: 0 10px 25px rgba(72, 74, 220, .2);
}

.workflow-shell {
  background: linear-gradient(180deg, #fff, #fcfdff);
  border-radius: 30px;
  box-shadow: 0 40px 130px rgba(7, 12, 32, .38);
}
.workflow-header {
  padding-top: 31px;
}
.workflow-header::before {
  width: 120px;
  height: 4px;
  position: absolute;
  top: 0;
  left: 34px;
  content: "";
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 0 0 4px 4px;
}
.workflow-progress {
  background: linear-gradient(90deg, #f9faff, #f6f8fc);
}
.workflow-progress button.active span {
  background: linear-gradient(145deg, #6d6ffb, #4749df);
  box-shadow: 0 0 0 5px rgba(90, 92, 246, .1);
}
.workflow-progress button.complete span {
  background: linear-gradient(145deg, #19b58f, #087a5d);
}
.action-dialog,
.notice-dialog,
.detail-dialog {
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 28px;
}
.action-icon {
  background: linear-gradient(145deg, #6d6ffa, #4749db);
  box-shadow: 0 12px 30px rgba(72, 74, 220, .24);
}
.success-orbit {
  background: linear-gradient(145deg, #18b58f, #087b5e);
}

.sign-page {
  background:
    radial-gradient(circle at 8% 0, rgba(90, 92, 246, .1), transparent 30rem),
    linear-gradient(180deg, #f7f9fe, #edf1f7);
}
.sign-info {
  min-height: 145px;
  align-items: center;
  margin-top: 0;
  padding: 28px 31px;
  color: white;
  background:
    radial-gradient(circle at 90% 20%, rgba(102, 105, 255, .34), transparent 32%),
    linear-gradient(132deg, #0a1123, #171c4b);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 29px;
  box-shadow: 0 24px 70px rgba(15, 23, 54, .16);
}
.sign-info p { color: #b8c1d5; }
.sign-info .eyebrow { color: #b6b8ff; }
.secure-pill {
  color: #9be7d8;
  background: rgba(23, 183, 150, .11);
  border: 1px solid rgba(105, 225, 203, .2);
}
.doc-panel, .signature-panel { border-radius: 24px; }
.signature-panel { padding: 27px; }
.canvas-wrap {
  background: repeating-linear-gradient(0deg, #fff, #fff 35px, #f0f1fa 36px);
  border-color: #d9dfeb;
  border-radius: 17px;
  box-shadow: inset 0 1px 6px rgba(19, 30, 53, .035);
}
.sign-steps { background: #fafbfe; border-radius: 16px; }
.sign-steps li > span { background: linear-gradient(145deg, #6062ef, #4143cb); }

.auth-page {
  background:
    radial-gradient(circle at 12% 12%, rgba(90, 92, 246, .14), transparent 30rem),
    radial-gradient(circle at 90% 88%, rgba(24, 183, 167, .1), transparent 28rem),
    #eef2f8;
}
.auth-shell {
  border-color: rgba(218, 224, 235, .9);
  border-radius: 34px;
  box-shadow: 0 42px 120px rgba(14, 23, 50, .16);
}
.auth-brand-panel {
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at 18% 14%, rgba(106, 109, 255, .62), transparent 31%),
    radial-gradient(circle at 90% 92%, rgba(26, 189, 171, .2), transparent 34%),
    linear-gradient(145deg, #080e1f, #151b46);
}
.auth-brand-panel::after {
  width: 330px;
  height: 330px;
  position: absolute;
  right: -190px;
  bottom: -190px;
  content: "";
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 50%;
  box-shadow: 0 0 0 65px rgba(255, 255, 255, .022), 0 0 0 130px rgba(255, 255, 255, .012);
}
.auth-brand-panel > * { position: relative; z-index: 1; }
.auth-card h2 { color: #0b1428; }

@keyframes heroFloat {
  0%, 100% { transform: translateY(0) rotate(-.5deg); }
  50% { transform: translateY(-9px) rotate(.5deg); }
}
@keyframes glowDrift {
  from { opacity: .72; transform: translate(-12px, 8px) scale(.94); }
  to { opacity: 1; transform: translate(14px, -10px) scale(1.08); }
}
@keyframes documentShine {
  from { transform: translate3d(-150%, 0, 0); }
  to { transform: translate3d(150%, 0, 0); }
}
@keyframes routePulse {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(330%); }
}

/* Retained as an inactive alternate theme. */
@media (max-width: 0px) {
body {
  background: #f5f7fa;
}
.topbar {
  min-height: 72px;
  background: rgba(255, 255, 255, .94);
  border-bottom-color: #e5e9f0;
  box-shadow: none;
}
.brand::before {
  background: #365cf5;
  border: 0;
  box-shadow: none;
}
.topbar nav {
  gap: 5px;
  padding: 0;
  background: transparent;
  border: 0;
}
.topbar nav a {
  padding: 8px 11px;
}
.topbar nav a:hover {
  background: #f1f3f7;
  box-shadow: none;
}
.account-avatar {
  color: #2949c8;
  background: #edf1ff;
  border-color: #dfe6ff;
  box-shadow: none;
}
.account .ghost {
  background: #f2f4f7;
  border-color: transparent;
}

.shell {
  max-width: 1280px;
  padding-top: 22px;
}
.hero {
  min-height: 390px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 330px);
  gap: clamp(36px, 6vw, 80px);
  padding: clamp(42px, 6vw, 68px);
  color: var(--ink);
  background: white;
  border-color: #e3e7ee;
  border-radius: 26px;
  box-shadow: none;
}
.hero::before { display: none; }
.hero-kicker {
  margin-bottom: 16px;
  color: #365cf5;
}
.hero-kicker > span {
  background: #365cf5;
  box-shadow: none;
}
.hero h1 {
  max-width: 700px;
  font-size: clamp(48px, 5.5vw, 72px);
  line-height: .98;
}
.hero h1 span {
  color: #365cf5;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
}
.hero p {
  max-width: 590px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}
.hero-actions { margin-top: 26px; }
.hero-actions .hero-primary {
  min-height: 50px;
  color: white;
  background: #111827;
  border: 0;
  box-shadow: none;
}
.hero-actions .hero-primary:hover {
  color: white;
  background: #273244;
}
.hero-secondary {
  min-height: 50px;
  color: #3f4a5b;
  background: #f1f3f7;
  border: 0;
  backdrop-filter: none;
}
.hero-secondary:hover {
  color: var(--ink);
  background: #e8ebf0;
}
.trust-row {
  gap: 12px 20px;
  margin-top: 23px;
}
.trust-row span { color: #6b7586; }
.trust-row i {
  color: #167456;
  background: #edf8f4;
  border-color: #d7eee6;
}
.hero-summary {
  overflow: hidden;
  color: white;
  background: #111827;
  border-radius: 20px;
}
.hero-summary-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.hero-summary-head > span {
  width: 36px;
  height: 36px;
  display: grid;
  flex: none;
  place-items: center;
  color: white;
  background: #168b67;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 900;
}
.hero-summary-head > div {
  display: grid;
  gap: 3px;
}
.hero-summary-head small {
  color: #9ca7b9;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.hero-summary-head strong {
  font-size: 13px;
}
.hero-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  font-size: 10px;
}
.hero-summary-row span { color: #9ca7b9; }
.hero-summary-row strong { font-size: 10px; }
.hero-summary-foot {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 16px 22px;
  color: #b7c0cf;
  font-size: 9px;
}
.hero-summary-foot i {
  width: 7px;
  height: 7px;
  background: #26b78b;
  border-radius: 50%;
}

.quick-start-grid {
  gap: 20px;
  margin-top: 20px;
}
.panel,
.status-section,
.doc-panel,
.signature-panel {
  border-color: #e2e7ef;
  box-shadow: none;
}
.launch-panel {
  min-height: 350px;
  background: white;
}
.launch-panel::before,
.launch-panel::after {
  display: none;
}
.launch-icon {
  width: 56px;
  height: 56px;
  background: #365cf5;
  border: 0;
  box-shadow: none;
}
.launch-panel .eyebrow { color: #365cf5; }
.launch-panel h2 {
  max-width: 650px;
  font-size: clamp(30px, 3vw, 40px);
}
.launch-steps {
  gap: 8px;
  margin-top: 10px;
}
.launch-steps li {
  min-height: 72px;
  background: #f7f8fa;
  border-color: #e7eaf0;
  border-radius: 13px;
}
.launch-steps li:hover {
  background: #f7f8fa;
  border-color: #dce1e9;
  transform: none;
}
.launch-steps span { color: #365cf5; }
.launch-button {
  min-height: 50px;
  background: #111827;
  box-shadow: none;
}
.launch-button:hover { background: #273244; }
.side-panel {
  background: white;
  backdrop-filter: none;
}
.security-state {
  background: #111827;
  border: 0;
}
.security-state-icon {
  background: #168b67;
  box-shadow: none;
}
.mini-icon {
  color: #365cf5;
  background: #edf1ff;
  border-color: #e0e6fb;
}
.secure-notice {
  background: #f5faf8;
}

.status-section {
  margin-top: 20px;
  padding: 28px;
  background: white;
  backdrop-filter: none;
}
.section-head > div > span {
  color: #365cf5;
  background: #edf1ff;
  border-color: #dfe6ff;
}
.envelope-card {
  background: white;
  border-radius: 16px;
}
.envelope-card::before {
  background: #365cf5;
}
.envelope-card:hover {
  border-color: #d5dbe5;
  box-shadow: none;
  transform: none;
}
.count-progress { stroke: #365cf5; }
.primary {
  background: #111827;
  box-shadow: none;
}
.primary:hover {
  background: #273244;
  box-shadow: none;
}
.workflow-shell {
  background: white;
  border-radius: 24px;
  box-shadow: 0 28px 80px rgba(7, 12, 32, .24);
}
.workflow-header::before { display: none; }
.workflow-progress {
  background: #f8f9fb;
}
.workflow-progress button.active span {
  background: #365cf5;
  box-shadow: none;
}
.workflow-progress button.complete span {
  background: #168b67;
}
.action-dialog,
.notice-dialog,
.detail-dialog {
  border-radius: 22px;
}
.action-icon {
  background: #365cf5;
  box-shadow: none;
}

.sign-page { background: #f5f7fa; }
.sign-info {
  min-height: 130px;
  color: var(--ink);
  background: white;
  border-color: #e2e7ef;
  border-radius: 22px;
  box-shadow: none;
}
.sign-info p { color: var(--muted); }
.sign-info .eyebrow { color: #365cf5; }
.secure-pill {
  color: #127253;
  background: #edf8f4;
  border-color: #d7eee6;
}
.sign-steps li > span {
  background: #365cf5;
}

.auth-page { background: #f2f4f7; }
.auth-shell {
  border-radius: 26px;
  box-shadow: 0 22px 70px rgba(15, 23, 42, .1);
}
.auth-brand-panel {
  background: #111827;
}
.auth-brand-panel::after { display: none; }
}

/* Focused application pages */
.quick-start-grid { display: none !important; }
.topbar nav a.active {
  color: var(--ink);
  background: white;
  box-shadow: 0 5px 16px rgba(15, 24, 46, .07);
}
.section-actions {
  display: flex;
  align-items: center;
  gap: 8px !important;
}
.section-actions .primary {
  min-height: 38px;
  padding: 9px 13px;
  font-size: 10px;
}
body[data-page="home"] #team,
body[data-page="envelopes"] .hero,
body[data-page="envelopes"] #team,
body[data-page="team"] .hero,
body[data-page="team"] #status,
body[data-page="templates"] .hero,
body[data-page="templates"] #status,
body[data-page="templates"] #team {
  display: none !important;
}
.templates-page { display: none; }
body[data-page="templates"] .templates-page {
  display: block;
  min-height: calc(100vh - 190px);
  margin-top: 24px;
}
body[data-page="home"] #refresh,
body[data-page="home"] .route-new,
body[data-page="envelopes"] #allEnvelopesLink {
  display: none;
}
body[data-page="envelopes"] #status,
body[data-page="team"] #team {
  min-height: calc(100vh - 205px);
  margin-top: 24px;
}
body[data-page="home"] #status {
  margin-top: 24px;
}

/* Global SignFlow wow pass */
.topbar {
  width: min(1340px, calc(100% - 32px));
  min-height: 70px;
  margin: 12px auto 0;
  padding: 9px 14px;
  top: 12px;
  overflow: hidden;
  background: rgba(249, 251, 255, .82);
  border: 1px solid rgba(206, 216, 232, .8);
  border-radius: 20px;
  box-shadow: 0 16px 45px rgba(16, 28, 54, .08), inset 0 1px rgba(255, 255, 255, .8);
}
.topbar::after {
  content: "";
  height: 1px;
  position: absolute;
  right: 18%;
  bottom: 0;
  left: 18%;
  opacity: .7;
  background: linear-gradient(90deg, transparent, rgba(90, 92, 246, .55), rgba(24, 183, 167, .45), transparent);
}
.topbar nav a { position: relative; }
.topbar nav a.active::after {
  content: "";
  width: 4px;
  height: 4px;
  position: absolute;
  bottom: 3px;
  left: 50%;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(90, 92, 246, .1);
  transform: translateX(-50%);
}
.account-avatar { transition: transform .2s ease, box-shadow .2s ease; }
.account:hover .account-avatar { box-shadow: 0 9px 24px rgba(77, 78, 226, .22), inset 0 1px white; transform: rotate(-4deg) scale(1.04); }
.shell { padding-top: 36px; }

.hero {
  background-size: auto, auto, auto, auto;
  transition: box-shadow .35s ease, transform .35s ease;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(255,255,255,.021) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.021) 1px, transparent 1px),
    linear-gradient(112deg, transparent 38%, rgba(255,255,255,.04) 49%, transparent 59%);
  background-size: 58px 58px, 58px 58px, auto;
  pointer-events: none;
}
.hero:hover { box-shadow: 0 44px 115px rgba(13, 20, 50, .25); }
.hero-actions .primary span, .route-new span, .launch-button span { display: inline-block; transition: transform .2s ease; }
.hero-actions .primary:hover span, .route-new:hover span, .launch-button:hover span { transform: translateX(5px); }
.trust-row span {
  padding: 6px 9px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 999px;
  backdrop-filter: blur(8px);
}
.hero-document { transition: transform .45s cubic-bezier(.2, .8, .2, 1), box-shadow .45s ease; }
.hero-stage:hover .hero-document { box-shadow: 0 50px 110px rgba(1, 4, 18, .5), inset 0 1px white; transform: rotateY(-1deg) rotateX(0deg) rotate(.3deg) translateY(-5px); }

.status-section {
  overflow: hidden;
  position: relative;
}
.status-section::before {
  content: "";
  height: 2px;
  position: absolute;
  top: 0;
  right: 9%;
  left: 9%;
  opacity: .7;
  background: linear-gradient(90deg, transparent, #6669f7, #52d6c0, transparent);
}
.section-head h2 { letter-spacing: -.04em; }
.envelope-card { isolation: isolate; }
.envelope-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
  background: radial-gradient(circle at 88% 10%, rgba(90, 92, 246, .1), transparent 34%);
  transition: opacity .25s ease;
  pointer-events: none;
}
.envelope-card > * { position: relative; z-index: 1; }
.envelope-card:hover::after { opacity: 1; }
.app-ready .envelope-card { animation: cardCascade .42s cubic-bezier(.2, .8, .2, 1) both; }
.app-ready .envelope-card:nth-child(2) { animation-delay: 55ms; }
.app-ready .envelope-card:nth-child(3) { animation-delay: 110ms; }
.app-ready .envelope-card:nth-child(4) { animation-delay: 165ms; }
.card-actions .ghost, .card-actions .link-button { transition: transform .18s ease, background .18s ease, border-color .18s ease; }
.card-actions .ghost:hover, .card-actions .link-button:hover { transform: translateY(-1px); }

.security-dashboard {
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at 92% 5%, rgba(90, 92, 246, .1), transparent 28%),
    linear-gradient(120deg, #f9faff, #f4f7fb);
  border-radius: 19px;
}
.security-checks > div, .user-row { transition: transform .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease; }
.security-checks > div:hover { transform: translateY(-2px); }
.user-row:hover { background: #fbfcff; border-color: #d4d9ed; box-shadow: 0 12px 32px rgba(24, 33, 68, .055); transform: translateY(-1px); }

.workflow-dialog::backdrop,
.action-dialog::backdrop,
.notice-dialog::backdrop,
.detail-dialog::backdrop,
.sign-confirm-dialog::backdrop,
.sign-success-dialog::backdrop {
  background: rgba(7, 12, 27, .68);
  backdrop-filter: blur(9px) saturate(.85);
}
.workflow-shell, .action-dialog, .notice-dialog, .detail-dialog {
  border: 1px solid rgba(255, 255, 255, .72);
  box-shadow: 0 42px 125px rgba(5, 10, 28, .34);
}
.dialog-close { transition: color .18s ease, background .18s ease, transform .18s ease; }
.dialog-close:hover { background: #e9edf5; transform: rotate(7deg); }
.wizard-step.step-enter { animation: contentSlide .3s cubic-bezier(.2, .8, .2, 1) both; }

.sign-info {
  overflow: hidden;
  isolation: isolate;
  position: relative;
}
.sign-info::after {
  content: "";
  position: absolute;
  inset: -50% 0;
  z-index: -1;
  background: linear-gradient(112deg, transparent 40%, rgba(255,255,255,.08) 49%, transparent 58%);
  transform: translateX(-120%);
  animation: signSheen 7s ease-in-out infinite 1.5s;
}
.doc-panel, .signature-panel { transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease; }
.signature-panel:hover { border-color: #d4d7f4; box-shadow: 0 26px 70px rgba(26, 34, 74, .09); transform: translateY(-2px); }
.signButton, #signButton { overflow: hidden; position: relative; }

.auth-shell { animation: authReveal .55s cubic-bezier(.2, .8, .2, 1) both; }
.auth-brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(135deg, black, transparent 72%);
}
.auth-card .primary span { display: inline-block; transition: transform .2s ease; }
.auth-card .primary:hover span { transform: translateX(5px); }

.app-ready .topbar { animation: navReveal .45s cubic-bezier(.2, .8, .2, 1) both; }
.app-ready .hero { animation: frameReveal .6s cubic-bezier(.2, .8, .2, 1) both; }
.app-ready .hero-copy { animation: copyReveal .55s cubic-bezier(.2, .8, .2, 1) .1s both; }
.app-ready .hero-stage { animation: visualReveal .65s cubic-bezier(.2, .8, .2, 1) .14s both; }

@keyframes navReveal {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes frameReveal {
  from { opacity: 0; transform: translateY(14px) scale(.992); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes copyReveal {
  from { opacity: 0; transform: translateX(-14px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes visualReveal {
  from { opacity: 0; transform: translateX(16px) scale(.97); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes cardCascade {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes contentSlide {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes signSheen {
  0%, 62% { transform: translateX(-120%); }
  82%, 100% { transform: translateX(120%); }
}
@keyframes authReveal {
  from { opacity: 0; transform: translateY(16px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Distinct desktop application shell */
@media (min-width: 1101px) {
  body[data-page] {
    background:
      radial-gradient(circle at 38% 0%, rgba(91, 94, 245, .11), transparent 31rem),
      radial-gradient(circle at 100% 72%, rgba(32, 188, 171, .08), transparent 29rem),
      #edf1f7;
  }
  body[data-page] .topbar {
    width: 242px;
    height: calc(100dvh - 36px);
    min-height: 620px;
    display: flex;
    align-items: stretch;
    flex-direction: column;
    justify-content: flex-start;
    margin: 0;
    padding: 25px 18px 18px;
    overflow: hidden;
    position: fixed;
    top: 18px;
    bottom: 18px;
    left: 18px;
    color: white;
    background:
      radial-gradient(circle at 13% 0%, rgba(104, 108, 255, .35), transparent 27%),
      radial-gradient(circle at 100% 100%, rgba(27, 193, 172, .13), transparent 32%),
      linear-gradient(155deg, #0a1123, #111a37 58%, #16183f);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 28px;
    box-shadow: 0 32px 90px rgba(8, 15, 35, .22), inset 0 1px rgba(255, 255, 255, .08);
  }
  body[data-page] .topbar::after {
    width: 210px;
    height: 210px;
    position: absolute;
    top: -138px;
    right: -128px;
    bottom: auto;
    left: auto;
    opacity: 1;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .085);
    border-radius: 50%;
    box-shadow: 0 0 0 37px rgba(255, 255, 255, .018), 0 0 0 74px rgba(255, 255, 255, .012);
  }
  body[data-page] .topbar > * { position: relative; z-index: 1; }
  body[data-page] .brand {
    align-self: flex-start;
    color: white;
    font-size: 23px;
  }
  body[data-page] .brand::before {
    box-shadow: 0 12px 28px rgba(84, 86, 235, .34), inset 0 1px rgba(255, 255, 255, .4);
  }
  body[data-page] .brand small { color: #8e9ab0; }
  body[data-page] .topbar nav {
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap: 7px;
    margin-top: 50px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
  }
  body[data-page] .topbar nav::before {
    margin: 0 10px 8px;
    content: "ARBEITSBEREICH";
    color: #728097;
    font-size: 7px;
    font-weight: 900;
    letter-spacing: .15em;
  }
  body[data-page] .topbar nav a {
    min-height: 47px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 13px;
    color: #aeb8ca;
    border: 1px solid transparent;
    border-radius: 14px;
    font-size: 11px;
    letter-spacing: -.01em;
  }
  body[data-page] .topbar nav a::before {
    width: 27px;
    height: 27px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    color: #9aa7bd;
    background: rgba(255, 255, 255, .055);
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 9px;
    font-size: 10px;
    transition: color .2s ease, background .2s ease, transform .2s ease;
  }
  body[data-page] .topbar nav a[data-route="home"]::before { content: "⌂"; }
  body[data-page] .topbar nav a[data-route="envelopes"]::before { content: "↗"; }
  body[data-page] .topbar nav a[data-route="templates"]::before { content: "✦"; }
  body[data-page] .topbar nav a[data-route="team"]::before { content: "◇"; }
  body[data-page] .topbar nav a:hover {
    color: white;
    background: rgba(255, 255, 255, .07);
    border-color: rgba(255, 255, 255, .08);
    box-shadow: none;
  }
  body[data-page] .topbar nav a:hover::before { color: white; transform: rotate(-4deg) scale(1.04); }
  body[data-page] .topbar nav a.active {
    color: #111a31;
    background: linear-gradient(110deg, #fff, #eef0ff);
    border-color: rgba(255, 255, 255, .85);
    box-shadow: 0 14px 30px rgba(2, 7, 22, .25);
  }
  body[data-page] .topbar nav a.active::before {
    color: white;
    background: linear-gradient(145deg, #6b6df9, #4547d9);
    border-color: rgba(255, 255, 255, .25);
    box-shadow: 0 8px 18px rgba(76, 78, 219, .24);
  }
  body[data-page] .topbar nav a.active::after {
    width: 5px;
    height: 5px;
    top: 50%;
    right: 10px;
    bottom: auto;
    left: auto;
    background: #5557e8;
    box-shadow: 0 0 0 4px rgba(90, 92, 246, .1);
    transform: translateY(-50%);
  }
  body[data-page] .account {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 9px 10px;
    margin-top: auto;
    padding: 13px;
    background: rgba(255, 255, 255, .065);
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 17px;
  }
  body[data-page] .account-avatar {
    width: 38px;
    height: 38px;
    color: white;
    background: linear-gradient(145deg, #5864ef, #243b75);
    border-color: rgba(255, 255, 255, .13);
  }
  body[data-page] .account-copy { align-content: center; text-align: left; }
  body[data-page] .account-copy strong { overflow: hidden; color: white; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
  body[data-page] .account-copy small { color: #8996aa; }
  body[data-page] .account .ghost {
    min-height: 34px;
    grid-column: 1 / -1;
    color: #aeb8c9;
    background: rgba(255, 255, 255, .055);
    border-color: rgba(255, 255, 255, .07);
  }
  body[data-page] .account .ghost:hover { color: white; background: rgba(255, 255, 255, .1); }
  body[data-page] .shell {
    width: calc(100% - 286px);
    max-width: 1500px;
    margin: 0 0 0 274px;
    padding: 18px 26px 96px 18px;
  }
  body[data-page] > footer {
    width: calc(100% - 300px);
    margin-left: 286px;
    background: transparent;
  }
  body[data-page="home"] .hero { min-height: min(650px, calc(100dvh - 118px)); }
  body[data-page="envelopes"] #status,
  body[data-page="team"] #team,
  body[data-page="templates"] .templates-page { margin-top: 0; }
}

/* Template library */
.templates-hero {
  min-height: 430px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(330px, .8fr);
  align-items: center;
  gap: clamp(28px, 5vw, 70px);
  overflow: hidden;
  position: relative;
  padding: clamp(38px, 5vw, 64px);
  color: white;
  background:
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    radial-gradient(circle at 84% 15%, rgba(126, 226, 211, .23), transparent 25rem),
    radial-gradient(circle at 43% 105%, rgba(92, 101, 255, .34), transparent 30rem),
    #0e172a;
  background-size: 52px 52px, 52px 52px, auto, auto, auto;
  border-radius: 34px;
  box-shadow: 0 30px 80px rgba(14, 23, 42, .17);
}
.templates-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(112deg, transparent 38%, rgba(255, 255, 255, .055) 48%, transparent 58%);
  transform: translateX(-120%);
  animation: heroSheen 8s ease-in-out infinite 1.5s;
}
.templates-hero::after {
  content: "";
  width: 360px;
  height: 360px;
  position: absolute;
  top: -235px;
  right: 7%;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 50%;
  box-shadow: 0 0 0 55px rgba(255, 255, 255, .025), 0 0 0 110px rgba(255, 255, 255, .018);
}
.templates-hero-copy { max-width: 720px; position: relative; z-index: 2; }
.templates-hero .eyebrow { color: #88f0df; }
.templates-hero h1 {
  margin: 0;
  font-size: clamp(42px, 6vw, 72px);
  line-height: .98;
  letter-spacing: -.06em;
}
.templates-hero h1 span { color: #9da9bc; }
.templates-hero p {
  max-width: 680px;
  margin: 22px 0 0;
  color: #c1cad8;
  font-size: 15px;
  line-height: 1.7;
}
.templates-hero-actions { display: flex; align-items: center; gap: 20px; margin-top: 28px; }
.templates-hero-actions > button {
  width: auto;
  min-width: 185px;
  margin: 0;
  z-index: 1;
  background: white;
  color: #0e172a;
}
.templates-hero-actions > button:hover { background: #eaf0ff; transform: translateY(-2px); }
.templates-hero-actions > div { display: grid; }
.templates-hero-actions > div strong { color: #8df1df; font-size: 16px; }
.templates-hero-actions > div small { color: #9eaabd; font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

.template-showcase {
  width: 100%;
  min-height: 320px;
  position: relative;
  z-index: 2;
  perspective: 1000px;
}
.showcase-orbit {
  width: 280px;
  height: 280px;
  position: absolute;
  top: 13px;
  left: 50%;
  border: 1px solid rgba(142, 242, 224, .18);
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 0 35px rgba(142, 242, 224, .035), 0 0 80px rgba(76, 227, 205, .12);
  animation: orbitPulse 5s ease-in-out infinite;
}
.showcase-sheet {
  width: min(305px, 88%);
  height: 220px;
  position: absolute;
  left: 50%;
  padding: 20px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(255, 255, 255, .58);
  border-radius: 22px;
  box-shadow: 0 28px 65px rgba(3, 9, 24, .28);
  transform-origin: 50% 100%;
}
.showcase-sheet-back {
  top: 61px;
  opacity: .28;
  transform: translateX(-61%) rotate(-10deg) translateZ(-70px);
}
.showcase-sheet-middle {
  top: 43px;
  opacity: .52;
  transform: translateX(-42%) rotate(9deg) translateZ(-38px);
}
.showcase-sheet-front {
  top: 48px;
  color: #152039;
  transform: translateX(-50%) rotateX(2deg) rotateY(-3deg);
  animation: sheetFloat 5s ease-in-out infinite;
}
.showcase-sheet-back > span, .showcase-sheet-middle > span { display: block; width: 44px; height: 44px; background: #5360ee; border-radius: 13px; }
.showcase-sheet-back > i, .showcase-sheet-middle > i { display: block; width: 76%; height: 8px; margin-top: 19px; background: #d8deea; border-radius: 99px; }
.showcase-sheet-back > i:last-child, .showcase-sheet-middle > i:last-child { width: 52%; margin-top: 9px; }
.showcase-sheet-head { display: grid; grid-template-columns: 43px 1fr 28px; align-items: center; gap: 11px; }
.showcase-sheet-head > span {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(145deg, #243a70, #616bff);
  border-radius: 13px;
  font-size: 9px;
  font-weight: 900;
}
.showcase-sheet-head small, .showcase-sheet-head strong { display: block; }
.showcase-sheet-head small { color: #818ba0; font-size: 6px; font-weight: 900; letter-spacing: .12em; }
.showcase-sheet-head strong { margin-top: 3px; font-size: 11px; }
.showcase-sheet-head > i { width: 27px; height: 27px; display: grid; place-items: center; color: white; background: var(--success); border-radius: 9px; font-size: 10px; font-style: normal; }
.showcase-lines { display: grid; gap: 7px; margin: 23px 0 16px; }
.showcase-lines i { width: 100%; height: 6px; background: #e7eaf0; border-radius: 99px; }
.showcase-lines i:nth-child(2) { width: 86%; }
.showcase-lines i:nth-child(3) { width: 61%; }
.showcase-roles { display: flex; gap: 6px; }
.showcase-roles span { padding: 6px 8px; color: #4f5b70; background: #f0f3f8; border-radius: 8px; font-size: 7px; font-weight: 800; }
.showcase-flow { display: flex; align-items: center; margin-top: 15px; }
.showcase-flow span { width: 21px; height: 21px; display: grid; place-items: center; color: white; background: #5260ed; border-radius: 50%; font-size: 7px; font-weight: 900; }
.showcase-flow i { height: 1px; flex: 1; background: #cfd6e2; }
.showcase-float {
  display: flex;
  align-items: center;
  gap: 9px;
  position: absolute;
  right: -1%;
  bottom: 13px;
  padding: 10px 13px;
  color: #172039;
  background: rgba(255, 255, 255, .95);
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 14px;
  box-shadow: 0 17px 35px rgba(3, 9, 24, .26);
  animation: badgeFloat 4s ease-in-out infinite .4s;
}
.showcase-float > span { width: 29px; height: 29px; display: grid; place-items: center; color: white; background: var(--accent); border-radius: 9px; font-size: 10px; }
.showcase-float small, .showcase-float strong { display: block; }
.showcase-float small { color: #808b9e; font-size: 6px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.showcase-float strong { margin-top: 2px; font-size: 9px; }
.template-safety-note {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 15px;
  margin: 18px 0 32px;
  padding: 16px 18px;
  color: #27344a;
  background: rgba(255, 255, 255, .75);
  border: 1px solid var(--line);
  border-radius: 20px;
  backdrop-filter: blur(15px);
}
.template-safety-note > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--success);
  border-radius: 14px;
}
.template-safety-note strong { display: block; font-size: 12px; }
.template-safety-note p { margin: 3px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.template-safety-note small {
  padding: 8px 10px;
  color: #4d5970;
  background: #edf1f7;
  border-radius: 10px;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}
.template-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.template-section-head > div { display: flex; align-items: center; gap: 10px; }
.template-section-head span {
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
}
.template-section-head h2 { margin: 0; font-size: 27px; letter-spacing: -.04em; }
.template-section-head p { color: var(--muted); font-size: 10px; }
.template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.template-card {
  min-height: 330px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
  position: relative;
  padding: 25px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--line);
  border-radius: 25px;
  box-shadow: 0 15px 45px rgba(16, 28, 54, .055);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.template-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -1px;
  opacity: 0;
  background: radial-gradient(circle at 12% 0%, rgba(86, 96, 245, .15), transparent 42%);
  transition: opacity .3s ease;
}
.template-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 28px;
  left: 28px;
  height: 2px;
  opacity: 0;
  background: linear-gradient(90deg, transparent, #6670ff, #83e8d7, transparent);
  transition: opacity .3s ease;
}
.app-ready .template-card { animation: templateRise .45s cubic-bezier(.2, .8, .2, 1) both; }
.app-ready .template-card:nth-child(2) { animation-delay: 45ms; }
.app-ready .template-card:nth-child(3) { animation-delay: 90ms; }
.app-ready .template-card:nth-child(4) { animation-delay: 135ms; }
.app-ready .template-card:nth-child(5) { animation-delay: 180ms; }
.app-ready .template-card:nth-child(n + 6) { animation-delay: 225ms; }
.template-card:hover { transform: translateY(-5px); border-color: #c5cee0; box-shadow: 0 27px 65px rgba(16, 28, 54, .12); }
.template-card:hover::before, .template-card:hover::after { opacity: 1; }
.template-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.template-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(145deg, #1a2850, #5961f4);
  border-radius: 16px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  box-shadow: 0 13px 28px rgba(79, 86, 224, .22);
}
.template-card:nth-child(2n) .template-mark { background: linear-gradient(145deg, #154c58, #22ad9d); box-shadow: 0 13px 28px rgba(20, 157, 142, .2); }
.template-card:nth-child(3n) .template-mark { background: linear-gradient(145deg, #5b3158, #a44c91); box-shadow: 0 13px 28px rgba(150, 66, 132, .18); }
.template-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.template-tags span {
  padding: 6px 8px;
  color: #5d687c;
  background: #f0f3f8;
  border-radius: 8px;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.template-card-copy { margin: 22px 0 18px; }
.template-card-copy h3 { margin: 0; font-size: 23px; letter-spacing: -.04em; }
.template-card-copy p { min-height: 43px; margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.template-meta {
  display: grid;
  grid-template-columns: 1.5fr .7fr .45fr;
  gap: 9px;
  margin-top: auto;
}
.template-meta > div { min-width: 0; padding: 12px; background: #f5f7fa; border-radius: 13px; }
.template-meta small, .template-meta strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.template-meta small { margin-bottom: 5px; color: #818b9c; font-size: 7px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.template-meta strong { font-size: 9px; }
.template-card-actions { display: flex; align-items: center; gap: 7px; margin-top: 15px; }
.template-card-actions .primary { width: auto; min-height: 39px; flex: 1; margin: 0; padding: 10px 13px; font-size: 10px; }
.template-card-actions .primary span { transition: transform .2s ease; }
.template-card-actions .primary:hover span { transform: translateX(4px); }
.template-card-actions .ghost { min-height: 39px; }
.template-viewer-note { color: var(--muted); font-size: 10px; }
.template-legal-note { margin: 18px 4px 0; color: var(--muted); font-size: 9px; line-height: 1.6; }

.template-dialog {
  width: min(820px, calc(100vw - 30px));
  max-height: min(900px, calc(100dvh - 30px));
  padding: 0;
  overflow: auto;
  color: var(--ink);
  background: white;
  border: 0;
  border-radius: 27px;
  box-shadow: 0 35px 110px rgba(6, 13, 28, .28);
}
.template-dialog::backdrop { background: rgba(10, 18, 36, .67); backdrop-filter: blur(7px); }
.template-dialog[open] { animation: dialogIn .3s cubic-bezier(.2, .8, .2, 1) both; }
.template-dialog form { padding: clamp(25px, 5vw, 46px); }
.template-dialog-head { padding-right: 34px; }
.template-dialog-head h2 { margin: 0; font-size: 34px; letter-spacing: -.05em; }
.template-dialog-head p { max-width: 650px; margin: 8px 0 25px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.template-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.template-form-grid label { margin: 0; }
.template-wide { grid-column: 1 / -1; }
.template-role-fieldset { margin: 18px 0; }
.template-roles { display: grid; gap: 7px; }
.template-role-row { display: grid; grid-template-columns: 32px 1fr 36px; align-items: center; gap: 8px; }
.template-role-row > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--accent-dark);
  background: var(--soft);
  border-radius: 9px;
  font-size: 9px;
  font-weight: 900;
}
.template-role-row button { height: 36px; color: var(--muted); background: #edf0f5; border: 0; border-radius: 10px; cursor: pointer; }
.template-signature-level, .active-template, .review-template, .detail-template {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 18px;
  padding: 14px;
  background: #f0f4fb;
  border: 1px solid #e0e6f0;
  border-radius: 15px;
}
.template-signature-level > span, .active-template > span, .review-template > span, .detail-template > span {
  width: 38px;
  height: 38px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: white;
  background: #151f35;
  border-radius: 12px;
  font-size: 9px;
  font-weight: 900;
}
.template-signature-level strong, .active-template strong, .review-template strong, .detail-template strong { display: block; font-size: 11px; }
.template-signature-level p, .active-template p { margin: 3px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.template-dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.template-dialog-actions .primary { width: auto; margin: 0; }
.active-template { margin: 0 0 15px; background: #eff4ff; border-color: #d6e0ff; }
.active-template small, .review-template small, .detail-template small { display: block; color: var(--accent-dark); font-size: 7px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.active-template > div { min-width: 0; flex: 1; }
.active-template > button { color: var(--muted); background: transparent; border: 0; font-size: 20px; cursor: pointer; }
.review-template { margin: 0; background: #eef2ff; }
.review-template > span, .detail-template > span { width: 32px; height: 32px; background: var(--accent); }
.detail-template { margin: 14px 0 0; }

@keyframes templateRise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes heroSheen {
  0%, 60% { transform: translateX(-120%); }
  78%, 100% { transform: translateX(120%); }
}
@keyframes orbitPulse {
  0%, 100% { opacity: .72; transform: translateX(-50%) scale(.97); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.03); }
}
@keyframes sheetFloat {
  0%, 100% { transform: translateX(-50%) translateY(0) rotateX(2deg) rotateY(-3deg); }
  50% { transform: translateX(-50%) translateY(-8px) rotateX(0deg) rotateY(1deg); }
}
@keyframes badgeFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@media (min-width: 1101px) {
  body[data-page="templates"] .templates-page { margin-top: 0; }
}

@media (min-width: 651px) and (max-width: 1100px) {
  body[data-page] .topbar {
    color: white;
    background:
      radial-gradient(circle at 12% 0%, rgba(104, 108, 255, .3), transparent 25%),
      linear-gradient(110deg, #0a1123, #151a43);
    border-color: rgba(255, 255, 255, .1);
    box-shadow: 0 20px 55px rgba(8, 15, 35, .2);
  }
  body[data-page] .brand { color: white; }
  body[data-page] .brand small, body[data-page] .account-copy small { color: #8e9ab0; }
  body[data-page] .account-copy strong { color: white; }
  body[data-page] .topbar nav { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .09); }
  body[data-page] .topbar nav a { color: #adb7c9; }
  body[data-page] .topbar nav a.active { color: #111a31; }
  body[data-page] .account .ghost { color: #d4dae5; background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .1); }
}

@media (max-width: 1050px) {
  .user-form { grid-template-columns: 1fr 1fr; }
  .user-form .inline-primary { width: 100%; grid-column: 1 / -1; }
  .security-checks { grid-template-columns: repeat(2, 1fr); }
  .hero {
    min-height: 520px;
    grid-template-columns: minmax(0, 1fr) minmax(360px, .85fr);
    padding: 52px;
  }
  .hero h1 { font-size: clamp(49px, 6.2vw, 68px); }
  .hero-document { width: min(350px, 90%); }
  .hero-float-top { right: -12px; }
}
@media (max-width: 900px) {
  .templates-hero { min-height: 0; grid-template-columns: 1fr; align-items: flex-start; gap: 12px; }
  .template-showcase { width: min(440px, 100%); margin: auto; }
  .template-grid { grid-template-columns: 1fr; }
  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding: clamp(38px, 7vw, 58px);
  }
  .hero-badge { display: none; }
  .hero-stage {
    min-height: 390px;
    margin-top: 6px;
  }
  .hero-document { width: min(410px, 82%); }
  .hero-float-top { right: 6%; }
  .hero-float-bottom { left: 5%; }
  .grid, .sign-layout { grid-template-columns: 1fr; }
  .side-panel, .signature-panel { position: static; }
  .sign-layout { display: flex; flex-direction: column; }
  .doc-panel, .signature-panel { width: 100%; }
  .doc-panel iframe { height: 62vh; min-height: 440px; }
  .two-col { grid-template-columns: 1fr; }
  .analysis-facts { grid-template-columns: 1fr 1fr; }
  .signature-map { grid-template-columns: 1fr 1fr; }
  .signature-map .map-title { grid-column: 1 / -1; }
  .recipient-row { grid-template-columns: 125px 1fr 1.25fr 40px; }
  .recipient-list > div { grid-template-columns: 12px 1fr auto; }
  .recipient-list small { display: none; }
  .auth-shell { min-height: 0; grid-template-columns: 1fr; }
  .auth-brand-panel { min-height: 320px; padding: 34px; }
  .auth-brand-panel h1 { max-width: 650px; font-size: 42px; }
  .launch-panel { min-height: 0; }
  .quick-start-grid { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  body[data-page] .topbar {
    overflow: visible;
    color: white;
    background: linear-gradient(110deg, #0a1123, #151a43);
    border-color: rgba(255, 255, 255, .1);
    box-shadow: 0 16px 45px rgba(8, 15, 35, .18);
  }
  body[data-page] .brand { color: white; }
  body[data-page] .brand small { color: #8e9ab0; }
  body[data-page] .account .ghost { color: white; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.1); }
  .app-ready .topbar { animation: none; }
  .topbar nav {
    display: flex;
    position: fixed;
    right: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 40;
    justify-content: space-around;
    gap: 3px;
    padding: 7px;
    overflow-x: auto;
    background: rgba(14, 23, 42, .94);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 17px;
    box-shadow: 0 18px 55px rgba(7, 13, 28, .3);
    backdrop-filter: blur(18px);
  }
  .topbar nav a { flex: 1; padding: 10px 8px; color: #b8c1d0; text-align: center; white-space: nowrap; border-radius: 11px; font-size: 10px; }
  .topbar nav a.active { color: #111827; }
  .account-copy { display: none; }
  .shell, .sign-shell { padding-left: 14px; padding-right: 14px; }
  .account-avatar { display: none; }
  .shell { padding-top: 14px; }
  .hero {
    padding: 35px 23px 27px;
    border-radius: 28px;
  }
  .hero h1 { font-size: clamp(42px, 13vw, 58px); }
  .hero p { font-size: 15px; }
  .trust-row { gap: 9px 14px; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .hero-actions .hero-primary { width: 100%; max-width: none; }
  .hero-secondary { width: 100%; }
  .hero-stage { min-height: 330px; margin-top: 7px; }
  .hero-document {
    width: min(330px, 94%);
    min-height: 330px;
    padding: 17px;
    border-radius: 22px;
    transform: rotate(1deg);
  }
  .hero-document-head { grid-template-columns: 40px 1fr; }
  .hero-filemark { width: 40px; height: 45px; }
  .hero-doc-status { display: none; }
  .hero-document-lines { padding: 19px 3px 17px; }
  .hero-route { padding: 14px 9px; }
  .hero-route > i { margin-inline: 4px; }
  .hero-float { padding: 9px 10px; }
  .hero-float-top { top: 4px; right: -5px; }
  .hero-float-bottom { left: -5px; bottom: 2px; }
  .form-panel, .status-section { padding: 18px; }
  .templates-hero { padding: 35px 24px; border-radius: 27px; }
  .templates-hero h1 { font-size: clamp(40px, 12vw, 55px); }
  .templates-hero-actions { align-items: stretch; flex-direction: column; }
  .templates-hero-actions > button { width: 100%; }
  .template-showcase { min-height: 290px; transform: scale(.92); transform-origin: top center; }
  .showcase-float { right: 0; }
  .template-safety-note { grid-template-columns: 42px 1fr; }
  .template-safety-note > small { grid-column: 2; width: max-content; }
  .template-section-head { align-items: flex-start; flex-direction: column; gap: 4px; }
  .template-section-head p { margin: 0; }
  .template-card { min-height: 0; padding: 20px; }
  .template-meta { grid-template-columns: 1fr 1fr; }
  .template-meta > div:first-child { grid-column: 1 / -1; }
  .template-card-actions { flex-wrap: wrap; }
  .template-card-actions .primary { flex-basis: 100%; }
  .template-dialog { width: 100vw; max-height: 100dvh; margin: 0; border-radius: 0; }
  .template-dialog form { min-height: 100dvh; padding: 28px 18px 100px; }
  .template-form-grid { grid-template-columns: 1fr; }
  .template-wide { grid-column: auto; }
  .template-dialog-actions { position: sticky; bottom: 0; padding: 12px 0; background: white; }
  body > footer { padding-bottom: 90px; }
  .section-actions { flex-wrap: wrap; justify-content: flex-end; }
  .launch-panel { grid-template-columns: 1fr; padding: 25px 20px; }
  .launch-icon { grid-row: auto; }
  .launch-steps, .launch-button { grid-column: 1; }
  .launch-steps { grid-template-columns: 1fr 1fr; }
  fieldset { padding: 15px; }
  .analysis-head { align-items: flex-start; }
  .analysis-ok { display: none; }
  .analysis-facts { grid-template-columns: 1fr; }
  .recipient-row { grid-template-columns: 1fr 40px; }
  .recipient-row select, .recipient-row input[data-name], .recipient-row input[data-email] { grid-column: 1; }
  .recipient-row button { grid-column: 2; grid-row: 1 / 4; }
  .required-role { position: static; grid-column: 1 / -1; }
  .recipient-list > div { grid-template-columns: 12px 1fr; }
  .recipient-list em { grid-column: 2; text-align: left; }
  .envelope-title { align-items: flex-start; }
  .user-form, .user-row { grid-template-columns: 1fr; }
  .detail-grid, .detail-recipients { grid-template-columns: 1fr; }
  .sign-info { align-items: flex-start; flex-direction: column; }
  .secure-pill { display: none; }
  .auth-page { padding: 0; }
  .auth-shell { border: 0; border-radius: 0; }
  .auth-brand-panel { min-height: 270px; padding: 28px; }
  .auth-brand-panel h1 { font-size: 34px; }
  .auth-brand-panel p { font-size: 12px; }
  .auth-card { padding: 42px 28px; }
  .legal-shell { padding-top: 52px; }
  .workflow-dialog {
    width: 100vw;
    max-height: 100dvh;
    margin: 0;
  }
  .workflow-shell { min-height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .workflow-header { padding: 22px 18px 15px; }
  .workflow-header h2 { font-size: 24px; }
  .workflow-header > small { display: none; }
  .workflow-progress { padding: 15px 18px; }
  .workflow-progress button { grid-template-columns: 25px; }
  .workflow-progress button small { display: none; }
  .workflow-progress i { margin: 0 7px; }
  .wizard-step { min-height: calc(100dvh - 225px); padding: 24px 18px 16px; }
  .workflow-actions { padding: 12px 18px; }
  .workflow-actions > div { margin-left: auto; }
  .workflow-actions .primary { min-width: 0; }
  #wizardCancel { display: none; }
  .review-grid { grid-template-columns: 1fr; }
  .review-recipients > div { grid-template-columns: 82px 1fr; }
  .review-recipients em { grid-column: 2; }
  .action-dialog, .notice-dialog { padding: 26px 20px; }
  .sign-info { padding: 25px 22px; border-radius: 23px; }
  .sign-confirm-summary { grid-template-columns: 1fr 1fr; }
  .sign-confirm-summary > div:first-child { grid-column: 1 / -1; }
  .toast-region { right: 14px; bottom: 14px; }
  body > footer { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 480px) {
  .template-dialog-actions { align-items: stretch; flex-direction: column-reverse; }
  .template-dialog-actions > * { width: 100% !important; }
  body[data-page="envelopes"] .section-head {
    align-items: stretch;
    flex-direction: column;
  }
  body[data-page="envelopes"] .section-actions {
    justify-content: flex-start;
  }
  .hero-stage { min-height: 300px; }
  .hero-document { width: 100%; }
  .hero-float-top { display: none; }
  .hero-float-bottom { bottom: -2px; }
  .launch-steps { grid-template-columns: 1fr; }
  .envelope-title { gap: 12px; }
  .count { width: 56px; height: 56px; }
  .workflow-actions { align-items: stretch; flex-direction: column-reverse; }
  .workflow-actions > div { width: 100%; margin: 0; }
  .workflow-actions > div > .primary { width: 100%; }
  #wizardBack { width: 100%; }
  .action-buttons { align-items: stretch; flex-direction: column-reverse; }
  .action-buttons > * { width: 100%; min-height: 44px; }
}

/* Quiet premium shell refinement */
@media (min-width: 1101px) {
  body[data-page] { background: #f1f4f8; }
  body[data-page] .topbar {
    width: 224px;
    height: calc(100dvh - 40px);
    min-height: 590px;
    top: 20px;
    bottom: 20px;
    left: 20px;
    padding: 24px 16px 16px;
    color: var(--ink);
    background: rgba(252, 253, 255, .94);
    border: 1px solid #dfe5ee;
    border-radius: 24px;
    box-shadow: 0 18px 55px rgba(18, 30, 58, .075), inset 0 1px white;
    backdrop-filter: blur(18px);
  }
  body[data-page] .topbar::after { display: none; }
  body[data-page] .brand { color: var(--ink); font-size: 22px; }
  body[data-page] .brand::before {
    box-shadow: 0 9px 20px rgba(77, 78, 226, .18), inset 0 1px rgba(255,255,255,.38);
  }
  body[data-page] .brand small { color: #8b95a6; }
  body[data-page] .topbar nav { gap: 5px; margin-top: 44px; }
  body[data-page] .topbar nav::before { color: #9aa3b1; }
  body[data-page] .topbar nav a {
    min-height: 44px;
    gap: 10px;
    padding: 9px 11px;
    color: #657084;
    border-radius: 12px;
  }
  body[data-page] .topbar nav a::before {
    width: 26px;
    height: 26px;
    color: #747f92;
    background: #f1f3f7;
    border-color: #e8ebf1;
    border-radius: 8px;
  }
  body[data-page] .topbar nav a:hover {
    color: var(--ink);
    background: #f5f6f9;
    border-color: #edf0f4;
  }
  body[data-page] .topbar nav a:hover::before { color: #5557dc; transform: none; }
  body[data-page] .topbar nav a.active {
    color: #3436b5;
    background: #eeefff;
    border-color: #e2e3fb;
    box-shadow: none;
  }
  body[data-page] .topbar nav a.active::before {
    color: #4f51d7;
    background: #e0e2ff;
    border-color: #d7d9fb;
    box-shadow: none;
  }
  body[data-page] .topbar nav a.active::after { display: none; }
  body[data-page] .account {
    padding: 11px;
    background: #f5f7fa;
    border-color: #e5e9f0;
    border-radius: 15px;
  }
  body[data-page] .account-avatar {
    color: #494bc8;
    background: #e8e9ff;
    border-color: #dcdef9;
    box-shadow: none;
  }
  body[data-page] .account-copy strong { color: var(--ink); }
  body[data-page] .account-copy small { color: #7d8797; }
  body[data-page] .account .ghost {
    color: #626d7e;
    background: white;
    border-color: #e1e5ec;
  }
  body[data-page] .account .ghost:hover { color: var(--ink); background: #eef1f5; }
  body[data-page] .shell {
    width: calc(100% - 266px);
    margin-left: 248px;
    padding-right: 24px;
  }
  body[data-page] > footer {
    width: calc(100% - 280px);
    margin-left: 266px;
  }
}

@media (min-width: 651px) and (max-width: 1100px) {
  body[data-page] .topbar {
    color: var(--ink);
    background: rgba(250, 252, 255, .94);
    border-color: #dfe5ee;
    box-shadow: 0 15px 42px rgba(18, 30, 58, .07);
  }
  body[data-page] .brand, body[data-page] .account-copy strong { color: var(--ink); }
  body[data-page] .brand small, body[data-page] .account-copy small { color: #7f8999; }
  body[data-page] .topbar nav { background: #f2f4f8; border-color: #e5e8ee; }
  body[data-page] .topbar nav a { color: #687386; }
  body[data-page] .topbar nav a.active { color: #3335b7; background: #fff; }
  body[data-page] .account .ghost { color: #5f6979; background: #f3f5f8; border-color: #e4e8ee; }
}

@media (max-width: 650px) {
  body[data-page] .topbar {
    color: var(--ink);
    background: rgba(250, 252, 255, .96);
    border-color: #dfe5ee;
    box-shadow: 0 13px 38px rgba(18, 30, 58, .07);
  }
  body[data-page] .brand { color: var(--ink); }
  body[data-page] .brand small { color: #7f8999; }
  body[data-page] .account .ghost { color: #4f5968; background: #f1f3f7; border-color: #e3e7ed; }
}

/* Compact focus dock */
@media (min-width: 1101px) {
  body[data-page] .topbar {
    width: 66px;
    height: auto;
    min-height: 0;
    display: flex;
    align-items: center;
    padding: 11px 9px;
    overflow: visible;
    top: 50%;
    right: auto;
    bottom: auto;
    left: 14px;
    z-index: 50;
    opacity: .58;
    filter: saturate(.7);
    border-radius: 22px;
    box-shadow: 0 10px 30px rgba(18, 30, 58, .055), inset 0 1px white;
    transform: translateY(-50%) translateX(-3px) scale(.985);
    transition: opacity .24s ease, filter .24s ease, transform .24s ease, box-shadow .24s ease, border-color .24s ease;
    animation: none !important;
  }
  body[data-page] .topbar:hover,
  body[data-page] .topbar:focus-within {
    opacity: 1;
    filter: none;
    border-color: #d5dce7;
    box-shadow: 0 20px 52px rgba(18, 30, 58, .14), inset 0 1px white;
    transform: translateY(-50%) translateX(0) scale(1.02);
  }
  body[data-page] .brand {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    overflow: visible;
    font-size: 0;
  }
  body[data-page] .brand::before {
    width: 38px;
    height: 38px;
    margin: 0;
    border-radius: 12px;
    font-size: 14px;
  }
  body[data-page] .brand span,
  body[data-page] .brand small { display: none; }
  body[data-page] .topbar nav {
    align-items: center;
    gap: 5px;
    margin: 13px 0 0;
  }
  body[data-page] .topbar nav::before { display: none; }
  body[data-page] .topbar nav a {
    width: 42px;
    min-height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    overflow: visible;
    position: relative;
    font-size: 0;
    border-radius: 12px;
  }
  body[data-page] .topbar nav a::before {
    width: 34px;
    height: 34px;
    font-size: 11px;
    border-radius: 10px;
  }
  body[data-page] .topbar nav a::after,
  body[data-page] .account .ghost::after {
    width: max-content;
    display: block;
    padding: 7px 9px;
    position: absolute;
    top: 50%;
    right: auto;
    bottom: auto;
    left: 53px;
    opacity: 0;
    visibility: hidden;
    color: #273247;
    background: rgba(255, 255, 255, .97);
    border: 1px solid #dfe4ec;
    border-radius: 9px;
    box-shadow: 0 10px 28px rgba(18, 30, 58, .13);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0;
    pointer-events: none;
    transform: translate(-5px, -50%);
    transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
  }
  body[data-page] .topbar nav a[data-route="home"]::after { content: "Übersicht"; }
  body[data-page] .topbar nav a[data-route="envelopes"]::after { content: "Vorgänge"; }
  body[data-page] .topbar nav a[data-route="templates"]::after { content: "Vorlagen"; }
  body[data-page] .topbar nav a[data-route="team"]::after { content: "Team & Sicherheit"; }
  body[data-page] .topbar nav a:hover::after,
  body[data-page] .topbar nav a:focus-visible::after,
  body[data-page] .account .ghost:hover::after,
  body[data-page] .account .ghost:focus-visible::after {
    opacity: 1;
    visibility: visible;
    transform: translate(0, -50%);
  }
  body[data-page] .topbar nav a.active { background: #eeefff; border-color: #e0e2f9; }
  body[data-page] .topbar nav a.active::before { color: #4d4fd1; background: transparent; border-color: transparent; }
  body[data-page] .account {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 7px;
    margin-top: 11px;
    padding: 11px 2px 0;
    background: transparent;
    border: 0;
    border-top: 1px solid #e6eaf0;
    border-radius: 0;
  }
  body[data-page] .account-avatar { width: 36px; height: 36px; }
  body[data-page] .account-copy { display: none; }
  body[data-page] .account .ghost {
    width: 36px;
    min-height: 32px;
    display: grid;
    place-items: center;
    padding: 0;
    position: relative;
    font-size: 0;
    border-radius: 10px;
  }
  body[data-page] .account .ghost::before { content: "↪"; font-size: 13px; }
  body[data-page] .account .ghost::after { content: "Abmelden"; left: 47px; }
  body[data-page] .shell {
    width: calc(100% - 108px);
    max-width: 1540px;
    margin-left: 90px;
    padding-left: 16px;
  }
  body[data-page] > footer {
    width: calc(100% - 122px);
    margin-left: 108px;
  }
}

/* Stable dock geometry: no hover jump */
@media (min-width: 1101px) {
  body[data-page] .topbar {
    width: 60px;
    padding: 9px 7px;
    left: 15px;
    opacity: .76;
    filter: none;
    background: rgba(252, 253, 255, .86);
    border-radius: 20px;
    transform: translateY(-50%);
    transition: none;
  }
  body.app-ready[data-page] .topbar {
    transition: opacity .2s ease, background .2s ease, box-shadow .2s ease, border-color .2s ease;
  }
  body[data-page] .topbar:hover,
  body[data-page] .topbar:focus-within {
    opacity: 1;
    background: rgba(255, 255, 255, .98);
    transform: translateY(-50%);
  }
  body[data-page] .brand { width: 38px; height: 38px; }
  body[data-page] .brand::before { width: 34px; height: 34px; border-radius: 11px; font-size: 12px; }
  body[data-page] .topbar nav { gap: 3px; margin-top: 10px; }
  body[data-page] .topbar nav a {
    width: 38px;
    height: 38px;
    min-height: 38px;
    flex: 0 0 38px;
  }
  body[data-page] .topbar nav a::before { width: 31px; height: 31px; }
  body[data-page] .topbar nav a::after { left: 48px; }
  body[data-page] .account {
    gap: 5px;
    margin-top: 9px;
    padding-top: 9px;
  }
  body[data-page] .account-avatar { width: 32px; height: 32px; font-size: 10px; }
  body[data-page] .account .ghost { width: 32px; min-height: 28px; }
  body[data-page] .account .ghost::after { left: 43px; }
  body[data-page] .shell {
    width: calc(100% - 94px);
    margin-left: 78px;
  }
  body[data-page] > footer {
    width: calc(100% - 108px);
    margin-left: 94px;
  }
}

/* Discoverable compact navigation */
body[data-page="home"] .topbar .route-new { display: flex; }

@media (min-width: 1101px) {
  body[data-page] .topbar {
    width: 176px;
    padding: 11px 10px;
    left: 16px;
    opacity: .9;
    background: rgba(252, 253, 255, .91);
    border-radius: 22px;
    box-shadow: 0 12px 38px rgba(18, 30, 58, .08), inset 0 1px white;
    transition: width .22s cubic-bezier(.2, .8, .2, 1), opacity .2s ease, background .2s ease, box-shadow .2s ease, border-color .2s ease;
  }
  body.app-ready[data-page] .topbar {
    transition:
      width .48s cubic-bezier(.16, 1, .3, 1),
      opacity .3s ease,
      background .34s ease,
      box-shadow .38s ease,
      border-color .34s ease;
  }
  body[data-page] .topbar:hover,
  body[data-page] .topbar:focus-within {
    width: 188px;
    opacity: 1;
    background: rgba(255, 255, 255, .98);
    border-color: #d7dee9;
    box-shadow: 0 22px 58px rgba(18, 30, 58, .14), inset 0 1px white;
  }
  body[data-page] .brand {
    width: 100%;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 2px 5px;
    overflow: hidden;
    font-size: 13px;
    white-space: nowrap;
  }
  body[data-page] .brand::before {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    margin: 0;
  }
  body[data-page] .brand span { display: inline; }
  body[data-page] .brand small { display: none; }
  body[data-page] .topbar nav {
    width: 100%;
    align-items: stretch;
    gap: 4px;
    margin-top: 12px;
  }
  body[data-page] .topbar nav a {
    width: 100%;
    height: 39px;
    min-height: 39px;
    flex: 0 0 39px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    padding: 3px 6px;
    overflow: visible;
    color: #667184;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
  }
  body[data-page] .topbar nav a::before {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    font-size: 11px;
    border-radius: 9px;
  }
  body[data-page] .topbar nav a::after,
  body[data-page] .account .ghost::after { display: none; }
  body[data-page] .topbar nav a:hover {
    color: #202a3c;
    background: #f5f7fa;
    border-color: #e9edf3;
  }
  body[data-page] .topbar nav a:hover::before { color: #4d4fd1; transform: none; }
  body[data-page] .topbar nav .nav-create {
    margin-bottom: 5px;
    color: white;
    background: linear-gradient(135deg, #171f36, #27235f);
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(24, 28, 67, .16);
  }
  body[data-page] .topbar nav .nav-create::before {
    content: "+";
    color: white;
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .08);
    font-size: 17px;
    font-weight: 500;
  }
  body[data-page] .topbar nav .nav-create:hover {
    color: white;
    background: linear-gradient(135deg, #202943, #353078);
    border-color: transparent;
  }
  body[data-page] .topbar nav .nav-create:hover::before { color: white; }
  body[data-page] .topbar nav a.active {
    color: #3436b5;
    background: #eeefff;
    border-color: #e0e2f9;
  }
  body[data-page] .account {
    width: 100%;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: center;
    gap: 6px 7px;
    margin-top: 11px;
    padding: 10px 5px 0;
  }
  body[data-page] .account-avatar {
    width: 32px;
    height: 32px;
    font-size: 10px;
  }
  body[data-page] .account-copy {
    display: block;
    min-width: 0;
    line-height: 1.1;
  }
  body[data-page] .account-copy strong,
  body[data-page] .account-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body[data-page] .account-copy strong { font-size: 9px; }
  body[data-page] .account-copy small { margin-top: 3px; font-size: 8px; }
  body[data-page] .account .ghost {
    width: 100%;
    min-height: 30px;
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    padding: 5px 8px;
    font-size: 9px;
    border-radius: 9px;
  }
  body[data-page] .account .ghost::before { content: "↪"; font-size: 12px; }
  body[data-page] .shell {
    width: calc(100% - 222px);
    margin-left: 206px;
    padding-left: 16px;
  }
  body[data-page] > footer {
    width: calc(100% - 236px);
    margin-left: 222px;
  }
}

@media (max-width: 650px) {
  body[data-page] .topbar nav .nav-create {
    font-size: 0;
    color: white;
    background: #4f51d7;
  }
  body[data-page] .topbar nav .nav-create::after {
    content: "Neu";
    font-size: 10px;
  }
}

/* Dietz & Wetzel branding */
.brand.brand-dw {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 34px;
  overflow: visible;
  line-height: 0;
  letter-spacing: 0;
}
.brand.brand-dw::before {
  display: none !important;
  content: none !important;
}
.brand-logo {
  width: 172px;
  height: auto;
  max-width: 100%;
  display: block;
  filter: brightness(0) saturate(100%) invert(12%) sepia(19%) saturate(1386%) hue-rotate(184deg) brightness(88%) contrast(95%);
}
.auth-brand-panel .brand-logo,
.brand-inverse .brand-logo {
  width: 220px;
  filter: none;
}
.sign-page .brand-logo,
.legal-page .brand-logo { width: 180px; }
body[data-page] .brand.brand-dw {
  width: 100%;
  height: 48px;
  padding: 5px;
}
body[data-page] .brand.brand-dw::before { display: none !important; }
body[data-page] .brand.brand-dw .brand-logo {
  width: 154px;
  max-width: none;
  flex: 0 0 auto;
}

@media (max-width: 650px) {
  .auth-brand-panel .brand-logo,
  .brand-inverse .brand-logo { width: 190px; }
  .sign-page .brand-logo,
  .legal-page .brand-logo { width: 158px; }
}

/* Interactive signature placement */
.workflow-progress {
  grid-template-columns: auto 1fr auto 1fr auto 1fr auto 1fr auto;
}
.signature-position-step { min-height: 0; }
.signature-preview {
  min-height: 0;
  overflow: hidden;
  background: #f7f8fc;
  border: 1px solid #e1e5ee;
  border-radius: 20px;
}
.signature-preview-placeholder {
  min-height: clamp(340px, calc(100dvh - 380px), 560px);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 7px;
  padding: 32px;
  text-align: center;
}
.signature-preview-placeholder > span {
  width: 52px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  color: white;
  background: linear-gradient(145deg, #6d6ffa, #4749d9);
  border-radius: 14px;
  box-shadow: 0 14px 32px rgba(72, 74, 220, .18);
  font-size: 10px;
  font-weight: 900;
}
.signature-preview-placeholder strong { font-size: 13px; }
.signature-preview-placeholder small { max-width: 360px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.preview-loading .signature-preview-placeholder > span { animation: pulse 1.25s ease-in-out infinite alternate; }
.preview-error .signature-preview-placeholder > span { background: var(--danger); }
.signature-preview-layout {
  height: clamp(340px, calc(100dvh - 380px), 560px);
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
}
.signature-preview-guide {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding: 16px 14px;
  background: linear-gradient(180deg, #fcfcff, #f3f4fa);
  border-right: 1px solid #e1e5ee;
}
.position-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  color: #087653;
  background: #edf9f5;
  border: 1px solid #d6eee6;
  border-radius: 14px;
  transition: color .2s, background .2s, border-color .2s;
}
.position-status.adjusted { color: #4345bd; background: #eeeeff; border-color: #dcdcff; }
.position-status > span {
  width: 27px;
  height: 27px;
  display: grid;
  flex: none;
  place-items: center;
  color: white;
  background: #0b8a64;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 900;
}
.position-status.adjusted > span { background: #5557dc; }
.position-status > div { display: grid; gap: 2px; }
.position-status small,
.position-meta small {
  color: #7c8595;
  font-size: 7.5px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.position-status strong { color: var(--ink); font-size: 10px; }
.position-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.position-meta > div {
  display: grid;
  gap: 4px;
  padding: 10px;
  background: white;
  border: 1px solid #e1e5ed;
  border-radius: 12px;
}
.position-meta strong { font-size: 9.5px; }
.signature-preview-guide > p { margin: 0; color: #667085; font-size: 10px; line-height: 1.55; }
.signature-field-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 7px;
  overflow: auto;
  scrollbar-width: thin;
}
.signature-field-button {
  width: 100%;
  min-height: 53px;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 9px;
  position: relative;
  color: #60697a;
  background: rgba(255, 255, 255, .72);
  border: 1px solid #e0e4ec;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(24, 35, 54, .025);
  text-align: left;
  transition: color .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.signature-field-button:hover {
  color: var(--ink);
  background: white;
  border-color: #cfd4e2;
  transform: translateY(-1px);
}
.signature-field-button.active {
  color: #34369e;
  background: #f0f0ff;
  border-color: #cfd0ff;
  box-shadow: 0 7px 18px rgba(69, 71, 190, .09);
}
.signature-field-button > span {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  color: #6b7382;
  background: #edf0f5;
  border-radius: 8px;
  font-size: 8px;
  font-weight: 900;
}
.signature-field-button.active > span { color: white; background: #5759dd; }
.signature-field-button > div { min-width: 0; display: grid; align-content: center; gap: 1px; }
.signature-field-button strong,
.signature-field-button small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.signature-field-button strong { color: inherit; font-size: 9.5px; }
.signature-field-button small { color: #7b8493; font-size: 7.5px; }
.signature-field-button em {
  grid-column: 2;
  color: #929aa7;
  font-size: 7px;
  font-style: normal;
  font-weight: 750;
}
.position-reset { width: 100%; min-height: 34px; padding: 7px 10px; font-size: 8.5px; }
.signature-exclusion-note {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #657081;
}
.signature-exclusion-note > span {
  width: 20px;
  height: 20px;
  display: grid;
  flex: none;
  place-items: center;
  background: #e7ebf1;
  border-radius: 7px;
  font-size: 8px;
  font-weight: 900;
}
.signature-exclusion-note small { font-size: 7.5px; line-height: 1.35; }
.position-tip {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #7a8494;
}
.position-tip > span {
  width: 25px;
  height: 25px;
  display: grid;
  flex: none;
  place-items: center;
  background: #e9ebf2;
  border-radius: 8px;
  font-size: 10px;
}
.position-tip small { font-size: 8px; line-height: 1.4; }
.signature-document-viewer {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #eef1f6;
}
.signature-preview-toolbar {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid #dde2ea;
  backdrop-filter: blur(12px);
}
.page-switcher { display: flex; align-items: center; gap: 9px; }
.page-switcher strong { min-width: 78px; font-size: 9px; text-align: center; }
.page-switcher button { width: 34px; min-height: 32px; padding: 0; }
.place-on-page { white-space: nowrap; }
.place-on-page.active { color: #087653; background: #edf9f5; border-color: #d2eadf; cursor: default; }
.signature-canvas-scroll {
  height: auto;
  min-height: 0;
  padding: 22px;
  overflow: auto;
  background:
    radial-gradient(circle at 50% 0, rgba(92, 94, 222, .075), transparent 38%),
    #e9edf3;
}
.signature-page-surface {
  min-width: 260px;
  min-height: 360px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  background: white;
  border: 1px solid #dce1e9;
  border-radius: 3px;
  box-shadow: 0 18px 42px rgba(25, 34, 52, .15);
}
.signature-page-surface canvas { display: block; background: white; }
.signature-markers-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.signature-page-surface.rendering::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.62) 50%, transparent 65%);
  animation: previewShimmer 1.1s ease-in-out infinite;
  pointer-events: none;
}
.signature-position-marker {
  min-width: 0;
  min-height: 0;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 8px 32px 8px 12px;
  position: absolute;
  z-index: 3;
  color: #2f318e;
  background: rgba(231, 232, 255, .9);
  border: 1.5px solid #6668ea;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(67, 69, 184, .18), inset 0 0 0 1px rgba(255,255,255,.58);
  cursor: grab;
  touch-action: none;
  user-select: none;
  backdrop-filter: blur(5px);
  pointer-events: auto;
  opacity: .6;
  transition: opacity .16s, box-shadow .16s, background .16s, border-color .16s, transform .16s;
}
.signature-position-marker.active {
  z-index: 4;
  opacity: 1;
  transform: scale(1.012);
}
.signature-position-marker:hover,
.signature-position-marker:focus-visible {
  z-index: 5;
  opacity: 1;
  background: rgba(239, 239, 255, .96);
  border-color: #4446d5;
  box-shadow: 0 14px 34px rgba(67, 69, 184, .24), 0 0 0 4px rgba(87, 89, 226, .1);
  outline: none;
}
.signature-position-marker.dragging { cursor: grabbing; box-shadow: 0 18px 42px rgba(67, 69, 184, .3); }
.signature-position-marker span { overflow: hidden; font-size: 10px; font-weight: 900; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.signature-position-marker small { overflow: hidden; color: #6668a8; font-size: 7.5px; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.signature-position-marker i {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  position: absolute;
  top: 50%;
  right: 8px;
  background: rgba(255,255,255,.68);
  border: 1px solid rgba(80, 82, 202, .16);
  border-radius: 8px;
  font-size: 10px;
  font-style: normal;
  transform: translateY(-50%);
}
.review-position { grid-column: 1 / -1; }
@keyframes previewShimmer {
  from { transform: translateX(-110%); }
  to { transform: translateX(110%); }
}

@media (max-width: 760px) {
  .signature-position-step { min-height: calc(100dvh - 225px); }
  .signature-preview-layout { height: auto; grid-template-columns: 1fr; }
  .signature-preview-guide { gap: 10px; padding: 14px; border-right: 0; border-bottom: 1px solid #e1e5ee; }
  .signature-preview-guide > p, .position-tip { display: none; }
  .signature-field-list {
    grid-auto-flow: column;
    grid-auto-columns: minmax(180px, 1fr);
    overflow-x: auto;
    overflow-y: hidden;
  }
  .position-reset { width: auto; margin: 0; }
  .signature-exclusion-note { display: none; }
  .signature-preview-toolbar { align-items: stretch; flex-direction: column; }
  .page-switcher { justify-content: space-between; }
  .place-on-page { width: 100%; }
  .signature-canvas-scroll { height: 52vh; min-height: 390px; padding: 12px; }
}

@media (max-width: 480px) {
  .workflow-progress i { margin-inline: 4px; }
  .signature-preview { border-radius: 16px; }
  .position-meta { display: none; }
  .position-status { width: 100%; }
  .signature-preview-guide { align-items: stretch; flex-direction: column; }
  .position-reset { width: 100%; flex: none; padding-inline: 8px; }
  .signature-position-marker { padding-right: 27px; padding-left: 8px; }
  .signature-position-marker i { width: 20px; height: 20px; right: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
