/* signASAP — e-signature workspace. Navy chrome, blue action, quiet greys. */
:root {
  --navy: #0b1b4d;
  --navy-2: #172a66;
  --blue: #1a6bfa;
  --blue-2: #0f5be0;
  --blue-50: #eef4ff;
  --ink: #141a2e;
  --muted: #5f6678;
  --line: #dfe2ea;
  --canvas: #eceef3;
  --bg: #f7f8fa;
  --ok: #12805c;
  --warn: #b4540a;
  --bad: #c0262d;
  --r: 8px;
  font:
    14px/1.45 ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #fff;
}
.hidden {
  display: none !important;
}
.grow {
  flex: 1;
}
.muted {
  color: var(--muted);
}
.error {
  color: var(--bad);
  font-weight: 600;
}
.row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.stack > * + * {
  margin-top: 12px;
}
h1 {
  font-size: 26px;
  font-weight: 500;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}
h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}
h3 {
  font-size: 12px;
  font-weight: 700;
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
a {
  color: var(--blue);
}
code {
  font-size: 12px;
  word-break: break-all;
}

/* ── buttons + inputs ── */
button,
.btn {
  font: inherit;
  font-weight: 600;
  border: 1px solid #b9bfcc;
  background: #fff;
  color: var(--ink);
  padding: 7px 14px;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}
button:hover,
.btn:hover {
  border-color: var(--ink);
}
button.primary {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
button.primary:hover {
  background: var(--navy-2);
}
button.action {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
button.action:hover {
  background: var(--blue-2);
}
button.ghost {
  border-color: transparent;
  background: transparent;
}
button.ghost:hover {
  background: #f0f1f5;
}
button.danger {
  color: var(--bad);
}
button.small,
.btn.small {
  padding: 4px 10px;
  font-size: 13px;
}
button.block {
  width: 100%;
  padding: 10px;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
}
label .req {
  color: var(--bad);
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
select {
  font: inherit;
  font-weight: 400;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid #b9bfcc;
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
}
textarea {
  resize: vertical;
}
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible,
.field:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

/* ── top navigation ── */
.topnav {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 56px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 30;
}
.topnav .brand {
  height: 26px;
  display: block;
}
.tabs {
  display: flex;
  gap: 4px;
  align-self: stretch;
}
.tabs a {
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 3px solid transparent;
}
.tabs a.on {
  border-color: var(--navy);
  font-weight: 700;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue-50);
  color: var(--navy);
  font-weight: 700;
  font-size: 12px;
  display: grid;
  place-items: center;
}

/* ── app shell: sidebar + content ── */
.shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: calc(100vh - 56px);
}
.sidebar {
  background: var(--bg);
  border-right: 1px solid var(--line);
  padding: 16px 0;
}
.sidebar > button {
  margin: 0 14px 14px;
  width: calc(100% - 28px);
}
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  color: var(--ink);
  text-decoration: none;
}
.sidebar nav a:hover {
  background: #eef0f4;
}
.sidebar nav a.on {
  background: #e3e6ee;
  font-weight: 700;
}
.sidebar nav .count {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}
.content {
  padding: 28px 40px 60px;
  min-width: 0;
}

/* ── agreements table ── */
.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.toolbar input {
  max-width: 320px;
  margin: 0;
}
table.list {
  width: 100%;
  border-collapse: collapse;
}
table.list th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
table.list td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.list tr.click {
  cursor: pointer;
}
table.list tr.click:hover td {
  background: #fafbfd;
}
.doc-name {
  font-weight: 600;
}
.doc-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.status {
  min-width: 160px;
  font-size: 12px;
}
.status .bar {
  height: 4px;
  background: #e3e6ee;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
  max-width: 170px;
}
.status .bar i {
  display: block;
  height: 100%;
  background: var(--blue);
}
.status .ok {
  color: var(--ok);
  font-weight: 600;
}
.status .bad {
  color: var(--bad);
  font-weight: 600;
}
.when {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

/* ── full-screen send flow ── */
.flow {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 40;
  display: flex;
  flex-direction: column;
}
.taskbar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 52px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.taskbar .sep {
  width: 1px;
  height: 22px;
  background: var(--line);
}
.steps {
  display: flex;
  gap: 18px;
  font-size: 13px;
  color: var(--muted);
}
.steps b {
  color: var(--ink);
}
.flow-body {
  flex: 1;
  overflow: auto;
}
.flow-inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 24px 24px 80px;
}
.flow-section {
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
}
.flow-section > h2 {
  margin-bottom: 16px;
}
.footerbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: #f3f4f7;
  border: 1px dashed transparent;
  border-radius: 6px;
  padding: 36px;
  cursor: pointer;
  text-align: center;
}
.drop.over {
  border-color: var(--blue);
  background: var(--blue-50);
}
.drop .ico {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: #e1e4ea;
  display: grid;
  place-items: center;
}
.doc-card {
  display: flex;
  gap: 16px;
  align-items: center;
}
.doc-card .thumb {
  width: 120px;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
  flex: none;
}
.doc-card .thumb canvas {
  width: 100%;
  display: block;
}
.recipient {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr 1fr auto;
  gap: 12px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(20, 26, 46, 0.06);
}
.recipient .role {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 9px;
}
.opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* prepare (field placement) */
.prepare {
  flex: 1;
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 0;
}
.palette {
  border-right: 1px solid var(--line);
  padding: 14px;
  overflow: auto;
}
.palette select {
  margin: 0 0 16px;
}
.palette .tool {
  display: flex;
  width: 100%;
  justify-content: flex-start;
  gap: 10px;
  border: 0;
  background: none;
  padding: 7px 6px;
  font-weight: 500;
  border-radius: 4px;
  cursor: grab;
}
.palette .tool:hover {
  background: #f0f1f5;
}
.palette .tool[aria-pressed="true"] {
  background: var(--blue-50);
  outline: 1px solid var(--blue);
}
.palette .tool .ico {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--c, var(--blue)) 16%, #fff);
  color: var(--c, var(--blue));
  border: 1px solid color-mix(in srgb, var(--c, var(--blue)) 50%, #fff);
}
.canvas {
  background: var(--canvas);
  overflow: auto;
  padding: 24px;
}
.canvas.placing .page {
  cursor: crosshair;
}

/* ── document pages + fields ── */
.pages {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}
.page {
  position: relative;
  width: 100%;
  max-width: 816px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(20, 26, 46, 0.18);
  user-select: none;
}
.page canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.field {
  position: absolute;
  border: 1.5px solid var(--c, var(--blue));
  background: color-mix(in srgb, var(--c, var(--blue)) 14%, transparent);
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  color: var(--c, var(--blue));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
}
.field img {
  max-width: 100%;
  max-height: 100%;
}
.field input {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  padding: 0 4px;
  margin: 0;
}
.field .x {
  position: absolute;
  top: 0;
  right: 0;
  border: 0;
  border-radius: 0 0 0 3px;
  background: var(--c);
  color: #fff;
  padding: 0 5px;
  font-size: 11px;
  line-height: 16px;
}
.field .grip {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 10px;
  height: 10px;
  background: var(--c);
  cursor: nwse-resize;
}
/* signer-side tags: solid "Sign here" blocks */
.field.tag {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  flex-direction: column;
  gap: 1px;
  cursor: pointer;
  font-size: 10px;
}
.field.tag svg {
  width: 14px;
  height: 14px;
}
.field.tag:hover {
  background: var(--blue-2);
}
.field.done {
  background: transparent;
  border: 1.5px dashed var(--blue);
  color: var(--ink);
}
.field.textin {
  background: #fff8db;
  border-color: #d9b400;
}
.field.textin.done {
  background: transparent;
}
.flag {
  position: absolute;
  left: -128px;
  transform: translateY(-50%);
  height: 34px;
  padding: 0 22px 0 16px;
  background: var(--navy);
  color: #fff;
  border: 0;
  border-radius: 3px 0 0 3px;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%);
  font-weight: 600;
  z-index: 5;
}
.flag:hover {
  background: var(--navy-2);
  border: 0;
}

/* ── envelope detail ── */
.back {
  display: inline-block;
  margin-bottom: 14px;
  text-decoration: none;
  font-weight: 600;
}
.title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.title-row h1 {
  margin: 0;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  background: #eef0f4;
  color: var(--muted);
}
.pill.sent {
  background: #fff4e5;
  color: var(--warn);
}
.pill.completed {
  background: #e3f5ec;
  color: var(--ok);
}
.pill.voided {
  background: #fdecec;
  color: var(--bad);
}
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  margin-top: 22px;
  align-items: start;
}
.panel {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  background: #fff;
}
.who {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.who:first-of-type {
  border-top: 0;
  padding-top: 0;
}
.who .n {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--c);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  display: grid;
  place-items: center;
}
.who .st {
  font-size: 12px;
  color: var(--muted);
  margin: 2px 0 8px;
}
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.timeline li {
  position: relative;
  padding: 0 0 12px 18px;
  font-size: 13px;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b9bfcc;
}
.timeline li.key::before {
  background: var(--blue);
}
.timeline .when {
  display: block;
}
.viewer {
  background: var(--canvas);
  border-radius: var(--r);
  padding: 18px;
}

/* ── confirmation ── */
.confirm {
  max-width: 640px;
  margin: 48px auto;
  padding: 0 20px;
}
.confirm .pill {
  margin-bottom: 14px;
}
.links li {
  margin: 10px 0;
  list-style: none;
}
.links {
  padding: 0;
}
.links code {
  display: block;
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 6px 8px;
  border-radius: 4px;
  margin: 4px 0 6px;
}

/* ── dialogs ── */
dialog {
  border: 0;
  border-radius: 6px;
  padding: 0;
  width: min(640px, 95vw);
  box-shadow: 0 18px 50px rgba(11, 27, 77, 0.28);
}
dialog::backdrop {
  background: rgba(11, 27, 77, 0.45);
}
.dlg-head {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.dlg-head h2 {
  flex: 1;
}
.dlg-body {
  padding: 18px 20px;
}
.dlg-foot {
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}
.tabbar {
  display: flex;
  gap: 22px;
  border-bottom: 1px solid var(--line);
  margin: 16px 0;
}
.tabbar button {
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: none;
  padding: 8px 0;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.tabbar button[aria-selected="true"] {
  color: var(--blue);
  border-color: var(--blue);
}
.pad {
  width: 100%;
  aspect-ratio: 3 / 1;
  border: 1px dashed #9aa2b4;
  border-radius: 4px;
  background: #fff;
  touch-action: none;
  display: block;
  margin-top: 4px;
}
.pad.small {
  aspect-ratio: 3 / 1;
  max-width: 220px;
}
.style-preview {
  display: flex;
  gap: 28px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px 16px;
}
.style-preview small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
}
.typed {
  font-family: "Caveat", cursive;
  font-size: 40px;
  line-height: 1.1;
  color: var(--navy);
}
.legal {
  font-size: 12px;
  color: var(--muted);
  margin-top: 16px;
}

/* ── signer chrome ── */
.signbar {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 52px;
  padding: 0 16px;
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 30;
}
.signbar img {
  height: 22px;
  display: block;
}
.signbar .sep {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.25);
}
.signbar b {
  font-weight: 500;
  font-size: 16px;
}
.signbar button {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.6);
}
.signbar button:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.signbar button.lit {
  background: #fff;
  color: var(--navy);
  border-color: #fff;
}
.sign-canvas {
  background: var(--canvas);
  min-height: calc(100vh - 52px);
  padding: 24px 24px 120px;
}
.intro {
  max-width: 816px;
  margin: 0 auto 18px;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(20, 26, 46, 0.18);
  padding: 18px 20px;
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}
.intro .grow {
  min-width: 240px;
}
.intro label {
  font-weight: 400;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 10px;
}
.readybar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(20, 26, 46, 0.08);
  padding: 14px 20px;
  z-index: 20;
}
.readybar .inner {
  max-width: 816px;
  margin: 0 auto;
  display: flex;
  gap: 16px;
  align-items: center;
}
.readybar h2 {
  font-weight: 500;
  font-size: 18px;
}
.done-card {
  max-width: 816px;
  margin: 0 auto 18px;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(20, 26, 46, 0.18);
  padding: 24px;
}
.center-card {
  max-width: 520px;
  margin: 60px auto;
  text-align: center;
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px 0;
  }
  .sidebar nav {
    display: flex;
    overflow-x: auto;
  }
  .sidebar nav a {
    white-space: nowrap;
  }
  .content {
    padding: 20px 16px 60px;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .prepare {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .palette {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
  }
  .palette select {
    margin: 0;
    width: 100%;
  }
  .palette .tool {
    width: auto;
  }
  .palette h3,
  .palette p {
    display: none;
  }
  .recipient,
  .opts {
    grid-template-columns: 1fr;
  }
  .flag {
    display: none;
  }
  table.list .hide-sm {
    display: none;
  }
}
@media (max-width: 600px) {
  .topnav {
    gap: 12px;
    padding: 0 12px;
  }
  .topnav .brand {
    height: 20px;
  }
  .signbar {
    gap: 10px;
    padding: 0 10px;
  }
  .signbar img,
  .signbar .sep {
    display: none;
  }
  .sign-canvas {
    padding: 12px 10px 140px;
  }
  .readybar .inner {
    flex-wrap: wrap;
  }
}
.field > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 14px 0 4px;
  max-width: 100%;
}

/* recipient colour = a numbered badge (same as the agreement page), not a side stripe */
.badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--c, var(--blue));
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  display: grid;
  place-items: center;
  flex: none;
  align-self: center;
}
.palette .pick {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0 0 16px;
}
.palette .pick select {
  margin: 0;
}

/* sign-in */
.signin {
  min-height: calc(100vh - 56px);
  display: grid;
  place-items: center;
  background: var(--bg);
  padding: 24px;
}
.signin-card {
  width: min(400px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 32px 28px;
  box-shadow: 0 1px 3px rgba(20, 26, 46, 0.06);
}
.signin-logo {
  height: 30px;
  display: block;
  margin: 0 auto 22px;
}
.signin-card h1 {
  font-size: 22px;
  text-align: center;
}
.btn.ms {
  width: 100%;
  padding: 10px;
  gap: 10px;
  border-color: #8c8c8c;
  color: #5e5e5e;
  font-weight: 600;
}
.or {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  margin: 18px 0;
}
.or::before,
.or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* white-label */
.topnav > a:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.topnav .brand.brand-logo {
  height: 34px;
}
.signbar img.brand-logo {
  height: 30px;
}
.powered {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.signbar .powered {
  color: rgba(255, 255, 255, 0.7);
  margin-left: -6px;
}
.powered {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.powered img {
  height: 15px;
  width: auto;
  display: block;
}
.signbar .powered img {
  height: 14px;
}

/* placing fields: the rectangle you are placing is always visible */
.field.ghost {
  pointer-events: none;
  border-style: dashed;
  opacity: 0.85;
}
.field.ghost.drawing {
  border-style: solid;
  background: color-mix(in srgb, var(--c, var(--blue)) 22%, transparent);
}
.field.carry {
  position: fixed;
  z-index: 100;
  box-shadow: 0 6px 18px rgba(20, 26, 46, 0.22);
}
.canvas.placing .page {
  cursor: crosshair;
}
.palette .tool {
  cursor: grab;
  touch-action: none;
}

/* line icons */
svg.i {
  width: 1.05em;
  height: 1.05em;
  flex: none;
  vertical-align: -0.17em;
}
.palette .tool .ico svg.i {
  width: 15px;
  height: 15px;
  vertical-align: 0;
}
.drop .ico svg.i {
  width: 20px;
  height: 20px;
  color: var(--muted);
}
.status .ok,
.status .bad,
.pill,
.recipient .role {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* ── mobile fixes ── */
.flow-body {
  min-height: 0;
} /* let the middle scroll so the action bar stays on screen */
.shell {
  grid-template-columns: 232px minmax(0, 1fr);
}
@media (max-width: 900px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar > button {
    width: calc(100% - 28px);
  }
  .sidebar nav {
    scrollbar-width: none;
  }
}
@media (max-width: 600px) {
  .topnav {
    gap: 6px;
    height: 52px;
  }
  .topnav .tabs a {
    padding: 0 8px;
    font-size: 13px;
  }
  .topnav .avatar {
    display: none;
  }
  .topnav #logout {
    padding: 4px 6px;
    font-size: 12px;
  }
  .topnav .powered {
    display: none;
  }
  .content {
    padding: 16px 14px 48px;
  }
  h1 {
    font-size: 22px;
  }
  .toolbar input {
    max-width: none;
  }
  /* agreements: one card-like row per agreement instead of a wide table */
  table.list thead {
    display: none;
  }
  table.list tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 10px;
    padding: 12px 2px;
    border-bottom: 1px solid var(--line);
  }
  table.list td {
    border: 0;
    padding: 0;
  }
  table.list td:first-child {
    grid-column: 1 / -1;
    margin-bottom: 8px;
  }
  table.list td.status {
    min-width: 0;
  }
  table.list td:last-child {
    align-self: center;
  }
  /* send flow */
  .taskbar {
    gap: 8px;
    padding: 0 8px;
  }
  .taskbar b {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }
  .taskbar .steps {
    font-size: 11px;
    gap: 8px;
    white-space: nowrap;
  }
  .flow-inner {
    padding: 12px 14px 32px;
  }
  .doc-card {
    flex-wrap: wrap;
  }
  .doc-card .thumb {
    width: 84px;
  }
  .footerbar {
    padding: 10px 12px;
  }
  .detail-grid {
    gap: 18px;
  }
  .viewer {
    padding: 8px;
  }
  dialog {
    width: 100vw;
    max-width: 100vw;
    margin: auto 0 0;
    border-radius: 12px 12px 0 0;
  }
}
@media (max-width: 600px) {
  .palette .pick {
    width: 100%;
    margin: 0 0 6px;
  }
  .palette #tools {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }
  .palette .tool {
    padding: 6px 8px;
  }
  .signbar b {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
  }
  .signbar .grow {
    display: none;
  }
  .signbar #progress {
    white-space: nowrap;
    font-size: 12px;
  }
}
