:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  --background: #e6e7ea;
  --surface: #ffffff;
  --surface-muted: #f3f4f6;
  --surface-subtle: #f9fafb;
  --text: #06090f;
  --text-soft: #3a424e;
  --muted: #4e5660;
  --border: #d3d5d9;
  --border-strong: #9fa4ac;
  --primary: #1b5de0;
  --primary-hover: #1549b2;
  --primary-pressed: #103889;
  --danger: #dc2626;
  --danger-surface: #fef2f2;
  --success-surface: #dcfce7;
  --focus: rgba(27, 93, 224, 0.18);
  --shadow-panel: 0 0 0.5px rgba(21, 22, 25, 0.18), 0 3px 8px rgba(21, 22, 25, 0.1), 0 1px 3px rgba(21, 22, 25, 0.1);
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  background: var(--background);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

* {
  box-sizing: border-box;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.icon {
  --icon-url: none;

  display: inline-block;
  flex: 0 0 auto;
  background-color: currentColor;
  -webkit-mask-image: var(--icon-url);
  mask-image: var(--icon-url);
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.icon--angle-down {
  --icon-url: url("assets/icons/angle-down.svg");

  width: 11px;
  height: 6px;
  color: var(--text);
}

.icon--chevron-left {
  --icon-url: url("assets/icons/angle-down.svg");

  width: 11px;
  height: 6px;
  transform: rotate(90deg);
}

.icon--arrow-left {
  --icon-url: url("assets/icons/arrow-left.svg");

  width: 25px;
  height: 18px;
  color: var(--muted);
}

.icon--file-import {
  --icon-url: url("assets/icons/file-import.svg");

  width: 13px;
  height: 14px;
  color: var(--primary-hover);
}

.icon--file-pdf {
  --icon-url: url("assets/icons/file-pdf.svg");

  width: 19px;
  height: 20px;
  color: var(--danger);
}

.icon--plus-light,
.icon--plus-muted {
  width: 13px;
  height: 13px;
}

.icon--plus-light {
  --icon-url: url("assets/icons/plus.svg");

  color: #ffffff;
}

.icon--plus-muted {
  --icon-url: url("assets/icons/plus-2.svg");

  color: var(--muted);
}

.icon--trash {
  --icon-url: url("assets/icons/plus-1.svg");

  width: 13px;
  height: 15px;
  color: #450a0a;
}

.icon--user {
  --icon-url: url("assets/icons/user.svg");

  width: 14px;
  height: 16px;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.sideload {
  min-height: 100vh;
  padding: 6px;
}

.app {
  min-height: 100vh;
  background: var(--surface);
  border-radius: 4px;
  box-shadow: var(--shadow-panel);
  flex-direction: column;
  gap: 0;
  overflow: visible;
  padding: 0;
}

.view {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px 10px;
}

.app-header__title {
  flex: 1;
  min-width: 0;
}

.app-header img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
}

.app-header h1 {
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
}

.app-nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  padding: 0 12px;
}

.app-nav::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: var(--border);
  content: "";
}

.nav-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: 36px;
  border: 0;
  border-radius: 4px 4px 0 0;
  background: transparent;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  padding: 8px;
  transition:
    background-color 150ms ease,
    color 150ms ease;
  z-index: 1;
}

.nav-button:hover:not(:disabled) {
  background: transparent;
  color: var(--text);
}

.nav-button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.nav-button--active,
.nav-button--active:hover:not(:disabled) {
  background: transparent;
  color: var(--text);
}

.nav-button--active::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  content: "";
}

.nav-button:not(.nav-button--active):hover::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--border);
  content: "";
}

.eyebrow {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0;
  text-transform: none;
}

.user-avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: #7133f8;
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
}

.user-avatar__tooltip {
  position: absolute;
  top: 50%;
  right: calc(100% + 10px);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 218px;
  border-radius: 5px;
  background: #232a33;
  color: #ffffff;
  opacity: 0;
  padding: 4px 8px;
  pointer-events: none;
  transform: translateY(-50%);
  transition:
    opacity 150ms ease,
    visibility 150ms ease;
  visibility: hidden;
}

.user-avatar__tooltip::after {
  position: absolute;
  top: 50%;
  right: -5px;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 5px solid #232a33;
  content: "";
  transform: translateY(-50%);
}

.user-avatar:hover .user-avatar__tooltip,
.user-avatar:focus-within .user-avatar__tooltip {
  opacity: 1;
  visibility: visible;
}

.user-avatar__tooltip p,
.user-avatar__tooltip strong {
  overflow: hidden;
  max-width: 100%;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-avatar__tooltip p {
  color: var(--border);
}

.user-avatar__tooltip strong {
  color: #ffffff;
}

.panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 12px 16px 16px;
}

.panel--settings {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.first-run {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 6px 16px;
}

.first-run h2 {
  color: var(--text);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
}

.first-run h3 {
  margin-top: 6px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.first-run p {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.45;
}

.settings-domain-card {
  margin: 0 0 16px;
  border-radius: 4px;
  background: var(--surface-muted);
  padding: 14px;
}

.settings-domain-card h2,
.settings-auth-row h2,
.account-acquisition h2,
.sent-card h2 {
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
}

.settings-domain-card p,
.settings-auth-row p,
.account-acquisition p,
.sent-card p {
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

.settings-domain-card p,
.settings-auth-row p,
.account-acquisition p {
  margin-top: 4px;
}

.settings-domain-form {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  padding: 16px 6px;
}

.settings-language-form {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  margin-right: -6px;
  margin-left: -6px;
  border-top: 1px solid var(--border);
  padding: 16px 12px;
}

.settings-field {
  width: 100%;
  gap: 8px;
}

.settings-field > span:first-child {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.field-error {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-radius: 4px;
  background: var(--danger-surface);
  color: #b91c1c;
  font-size: 12px;
  line-height: 1.45;
  padding: 10px 12px;
}

.field-error strong {
  color: #b91c1c;
  font-weight: 500;
}

.tenant-input {
  display: flex;
  align-items: center;
  width: 100%;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  padding: 12px;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.tenant-input:hover {
  border-color: var(--muted);
}

.tenant-input:focus-within {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.tenant-input input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.tenant-input input:hover,
.tenant-input input:focus {
  border-color: transparent;
  box-shadow: none;
}

.tenant-input__suffix {
  flex: 0 0 auto;
  margin-left: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  white-space: nowrap;
}

.settings-auth-row {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-right: -6px;
  margin-left: -6px;
  border-top: 1px solid var(--border);
  padding: 24px 12px;
}

.settings-auth-row__text {
  flex: 1 1 auto;
  min-width: 0;
}

.settings-auth-row__text p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-auth-row__actions {
  flex: 0 0 auto;
}

.account-acquisition {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-right: -6px;
  margin-left: -6px;
  border-top: 1px solid var(--border);
  padding: 18px 12px 4px;
}

.account-acquisition__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.text-link {
  color: var(--primary-hover);
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
}

.text-link:hover {
  color: var(--primary-pressed);
  text-decoration: underline;
}

.text-link:focus-visible {
  border-radius: 2px;
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.sent-panel {
  padding: 12px 16px 16px;
}

.sent-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  border-radius: 4px;
  background: #e8effc;
  color: var(--primary-pressed);
  padding: 14px;
}

.sent-card h2,
.sent-card p {
  color: var(--primary-pressed);
}

.sent-card__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.section-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 6px;
  border-radius: 4px;
  background: var(--surface-muted);
  padding: 14px;
}

.section-heading h2,
.recipient-title h2 {
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
}

.section-heading p {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.45;
}

.form-stack,
.recipients {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.recipients {
  margin: 12px -6px 0;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-stack > label {
  display: grid;
  grid-template-columns: minmax(120px, 24%) minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 4px 0;
}

.form-stack > label > span {
  display: flex;
  align-items: center;
  min-height: 44px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.document-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 0 16px;
}

.document-field__label {
  display: flex;
  align-items: flex-end;
  width: 100px;
  min-height: 32px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}

.document-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 52px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-subtle);
  padding: 14px 12px;
  overflow: hidden;
}

.document-card__icon {
  flex: 0 0 22px;
  color: var(--danger);
}

.document-card__name {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-card__overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 44px;
  background: linear-gradient(90deg, rgba(249, 250, 251, 0), var(--surface-subtle));
  pointer-events: none;
}

.dev-preview-field {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.dev-preview-field__note {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.4;
}

label span {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
  padding: 12px;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    box-shadow 150ms ease,
    opacity 150ms ease;
}

select {
  appearance: none;
  padding-right: 40px;
}

.select-field {
  position: relative;
  display: flex;
  width: 100%;
  min-width: 0;
}

.select-field select {
  flex: 1 1 auto;
  min-width: 0;
}

.select-field__icon {
  position: absolute;
  top: 50%;
  right: 12px;
  pointer-events: none;
  transform: translateY(-50%);
}

input:hover:not(:disabled),
select:hover:not(:disabled),
textarea:hover:not(:disabled) {
  border-color: var(--muted);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
  outline: none;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 32px;
  border: 1px solid var(--border-strong);
  border-radius: 40px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  padding: 6px 16px;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    opacity 150ms ease;
}

.button:hover:not(:disabled) {
  border-color: var(--muted);
  background: var(--surface-muted);
}

.button:active:not(:disabled) {
  border-color: var(--text-soft);
  background: var(--border);
}

.button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.button--primary,
.button[type="submit"]:not(.button--secondary) {
  border-color: transparent;
  background: var(--primary);
  color: #ffffff;
}

.button--primary:hover:not(:disabled),
.button[type="submit"]:not(.button--secondary):hover:not(:disabled) {
  border-color: transparent;
  background: var(--primary-hover);
}

.button--primary:active:not(:disabled),
.button[type="submit"]:not(.button--secondary):active:not(:disabled) {
  background: var(--primary-pressed);
}

.button--primary:disabled,
.button[type="submit"]:disabled {
  opacity: 0.5;
}

.button--secondary {
  border-color: var(--border-strong);
  background: var(--surface-subtle);
  color: var(--text);
}

.button--secondary:hover:not(:disabled) {
  border-color: var(--muted);
  background: var(--surface-muted);
}

.button--secondary:active:not(:disabled) {
  border-color: var(--text-soft);
  background: var(--border);
}

.button--secondary:disabled {
  border-color: var(--border);
  background: var(--surface);
  color: var(--border-strong);
}

.button--danger {
  border-color: transparent;
  background: var(--danger);
  color: #ffffff;
}

.button--danger:hover:not(:disabled) {
  border-color: transparent;
  background: #b91c1c;
}

.button--danger:active:not(:disabled) {
  background: #991b1b;
}

.button--with-icon {
  gap: 8px;
}

.alert,
.progress {
  font-size: 13px;
  line-height: 1.45;
  margin: 12px 16px 0;
  border-radius: 4px;
  padding: 12px;
}

.alert--success {
  background: var(--success-surface);
  color: #052e16;
  font-size: 12px;
}

.alert--stacked {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.alert strong {
  font-weight: 500;
}

.alert--error {
  background: var(--danger-surface);
  color: #b91c1c;
  font-size: 12px;
}

.progress {
  background: #e8effc;
  border: 1px solid #d1dffa;
  color: var(--primary-pressed);
}

.recipient-title {
  display: none;
}

.recipient {
  border: 0;
  background: var(--surface);
  color: var(--text);
  overflow: visible;
}

.recipient__summary {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  border: 0;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  list-style: none;
  padding: 8px 12px;
  text-align: left;
  transition: background-color 150ms ease;
}

.recipient__summary::before,
.recipient__summary::after {
  position: absolute;
  right: 0;
  left: 12px;
  z-index: 1;
  height: 1px;
  background: var(--border);
  content: "";
  pointer-events: none;
  transition:
    left 150ms ease,
    background-color 150ms ease,
    opacity 150ms ease;
}

.recipient__summary::before {
  top: 0;
  transform: translateY(-50%);
}

.recipient__summary::after {
  bottom: 0;
  opacity: 0;
  transform: translateY(50%);
}

.recipient__summary::-webkit-details-marker {
  display: none;
}

.recipient--ordered .recipient__summary {
  cursor: grab;
}

.recipient--ordered .recipient__summary:active {
  cursor: grabbing;
}

.recipient__summary:hover {
  background: var(--surface-subtle);
  z-index: 2;
}

.recipient__summary:hover::before,
.recipient__summary:hover::after {
  left: 0;
  background: var(--muted);
  opacity: 1;
}

.recipient__summary:focus-visible {
  box-shadow: inset 0 0 0 1px var(--primary);
  outline: none;
  z-index: 2;
}

.recipient__summary:focus-visible::before,
.recipient__summary:focus-visible::after {
  left: 0;
  background: var(--primary);
  opacity: 1;
}

.recipient--drop-target .recipient__summary {
  background: #e8effc;
  z-index: 3;
}

.recipient--drop-target .recipient__summary::before,
.recipient--drop-target .recipient__summary::after {
  left: 0;
  background: var(--primary);
  opacity: 1;
}

.recipient--dragging .recipient__summary {
  background: var(--surface);
  opacity: 0.32;
}

.recipient__drag {
  position: relative;
  flex: 0 0 0;
  width: 0;
  height: 14px;
  color: var(--muted);
  cursor: grab;
  opacity: 0;
  overflow: hidden;
  transition:
    flex-basis 150ms ease,
    opacity 150ms ease,
    width 150ms ease;
}

.recipient__drag::before,
.recipient__drag::after {
  position: absolute;
  left: 1px;
  width: 13px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  content: "";
}

.recipient__drag::before {
  top: 4px;
}

.recipient__drag::after {
  bottom: 4px;
}

.recipient__drag:active {
  cursor: grabbing;
}

.recipient--ordered .recipient__summary:hover .recipient__drag,
.recipient--ordered .recipient__summary:focus-visible .recipient__drag,
.recipient--ordered.recipient--drop-target .recipient__drag,
.recipient--ordered.recipient--dragging .recipient__drag {
  flex-basis: 18px;
  width: 18px;
  opacity: 1;
}

.recipient__person-icon {
  flex: 0 0 auto;
  margin: 0 2px;
  color: var(--border-strong);
}

.recipient--ordered .recipient__summary:hover .recipient__person-icon,
.recipient--ordered.recipient--drop-target .recipient__person-icon,
.recipient--ordered.recipient--dragging .recipient__person-icon {
  color: var(--text);
}

.recipient__identity {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.recipient__identity::after {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 14px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), var(--surface));
  content: "";
  pointer-events: none;
}

.recipient__summary:hover .recipient__identity::after {
  background: linear-gradient(90deg, rgba(249, 250, 251, 0), var(--surface-subtle));
}

.recipient--drop-target .recipient__identity::after,
.recipient-drag-ghost .recipient__identity::after {
  background: linear-gradient(90deg, rgba(232, 239, 252, 0), #e8effc);
}

.recipient__name,
.recipient__email {
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
  line-height: 1.4;
}

.recipient__name {
  flex: 0 1 auto;
  color: var(--text);
}

.recipient__email {
  flex: 1 1 auto;
  color: var(--muted);
}

.recipient__chevron {
  flex: 0 0 auto;
  color: var(--muted);
}

.recipient__status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  width: 66px;
  overflow: hidden;
  color: var(--primary-hover);
  font-size: 12px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recipient__order {
  flex: 0 0 auto;
  width: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  text-align: right;
}

.recipient-group-title {
  position: relative;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  padding: 12px 0 10px 12px;
}

.recipient-group-title::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 12px;
  height: 1px;
  background: var(--border);
  content: "";
}

.recipient-list {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.recipient-list .recipient:last-child .recipient__summary {
  z-index: 1;
}

.recipient-list .recipient:last-child .recipient__summary::after {
  opacity: 1;
}

.recipient-list .recipient:last-child .recipient__summary:hover::after {
  left: 0;
  background: var(--muted);
}

.recipient-list + .recipient-group-title {
  border-top: 0;
  margin-top: 0;
}

.recipient-drag-active {
  cursor: grabbing;
  user-select: none;
}

.recipient-drag-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  border: 1px solid var(--primary);
  border-radius: 2px;
  background: var(--surface);
  box-shadow:
    0 10px 24px rgba(21, 22, 25, 0.18),
    0 2px 8px rgba(21, 22, 25, 0.16);
  opacity: 0.98;
  pointer-events: none;
}

.recipient-drag-ghost::before,
.recipient-drag-ghost::after {
  left: 0;
  background: var(--primary);
  opacity: 1;
}

.recipient-drag-ghost .recipient__drag {
  flex-basis: 18px;
  width: 18px;
  opacity: 1;
}

.recipient-drag-ghost .recipient__person-icon {
  color: var(--text);
}

.recipient-actions {
  display: flex;
  justify-content: flex-end;
  margin: 12px -6px 16px;
  padding: 0 12px;
}

.signing-main {
  padding-bottom: 76px;
}

.signing-main > .form-stack {
  padding: 0 6px;
}

.signing-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  background: var(--surface);
  padding: 6px;
}

.signing-footer__inner {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 4px;
  background: #e8effc;
  padding: 14px;
}

.signing-footer__inner .button--primary {
  flex: 1 1 auto;
  min-width: 0;
}

.signing-footer__inner .button--secondary {
  flex: 0 0 auto;
}

.recipient-editor-view {
  min-height: 620px;
  margin-right: -6px;
  margin-left: -6px;
}

.recipient-editor-top {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 16px 12px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 0;
}

.icon-button:hover:not(:disabled) {
  background: var(--surface-subtle);
  color: var(--text-soft);
}

.icon-button:active:not(:disabled) {
  background: var(--border);
  color: var(--text);
}

.icon-button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.recipient-editor-heading {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.recipient-editor-heading strong,
.recipient-editor-heading p {
  overflow: hidden;
  font-size: 14px;
  line-height: 1.4;
  text-overflow: ellipsis;
}

.recipient-editor-heading strong {
  flex: 0 1 auto;
  color: var(--text);
  font-weight: 500;
}

.recipient-editor-heading p {
  flex: 1 1 auto;
  color: var(--muted);
}

.recipient-editor-heading .icon--chevron-left {
  flex: 0 0 auto;
  color: var(--muted);
}

.recipient-editor-form {
  border-bottom: 1px solid var(--border);
  padding: 8px 12px 12px;
}

.recipient-editor-form.form-stack > label {
  grid-template-columns: 110px minmax(0, 1fr);
}

.recipient-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px;
}

.recipient-editor-remove {
  display: flex;
  justify-content: flex-end;
  padding: 12px;
}

.button--danger-smooth {
  border-color: transparent;
  background: #fee2e2;
  color: #450a0a;
}

.button--danger-smooth:hover:not(:disabled) {
  border-color: transparent;
  background: #fecaca;
}

.button--danger-smooth:active:not(:disabled) {
  background: #fca5a5;
}

.button--danger-smooth:disabled {
  background: #fef2f2;
  color: #450a0a;
  opacity: 0.5;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 9, 15, 0.38);
  padding: 18px;
}

.modal {
  width: 100%;
  max-width: 340px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-panel);
  padding: 18px;
}

.modal h2 {
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

.modal p {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.45;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

@media (max-width: 360px) {
  .sideload {
    padding: 6px;
  }

  .recipient-title {
    align-items: stretch;
    flex-direction: column;
  }

  .form-stack > label {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .recipient-editor-form.form-stack > label {
    grid-template-columns: 1fr;
  }

  .form-stack > label > span {
    min-height: 0;
  }

  .app-header {
    gap: 10px;
  }

  .app-nav {
    width: 100%;
  }

  .nav-button {
    flex: 0 0 auto;
  }

  .recipient-editor-actions,
  .modal-actions,
  .signing-footer__inner {
    align-items: stretch;
    flex-direction: column;
  }

  .signing-footer__inner .button,
  .recipient-editor-actions .button {
    width: 100%;
  }

  .recipient-actions {
    margin-bottom: 24px;
  }

  .signing-main {
    padding-bottom: 172px;
  }
}
