.dialog-toolbar {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 18px 26px 12px;
}

.dialog-search {
  display: block;
  flex: 1;
}

.dialog-search input {
  background: #f6f8f9;
  border: 1px solid #d6dfe5;
  border-radius: 9px;
  color: var(--ink);
  font-size: 14px;
  height: 44px;
  padding: 0 12px;
  width: 100%;
}

.dialog-search input:focus {
  background: white;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(17, 140, 131, 0.1);
  outline: none;
}

.drafts-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.drafts-list-panel {
  background: #f5f7f8;
  border-right: 1px solid #e0e6ea;
  display: grid;
  grid-template-rows: max-content minmax(0, 1fr);
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  padding: 18px;
}

.drafts-panel-toolbar {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.drafts-panel-toolbar .button {
  white-space: nowrap;
}

.draft-list {
  align-content: start;
  display: grid;
  gap: 8px;
  margin-right: -9px;
  margin-top: 12px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 9px;
  scrollbar-color: #b8c4cc transparent;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.draft-card {
  align-items: stretch;
  background: #f6f8f9;
  border: 1px solid #dce4e9;
  border-radius: 11px;
  display: grid;
  gap: 9px;
  grid-template-columns: minmax(0, 1fr);
  padding: 13px 14px;
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.draft-card[data-current="true"] {
  background: #edf7f5;
  border-color: #9bcfc9;
}

.draft-card[data-selected="true"] {
  background: #ffffff;
  border-color: var(--teal);
  box-shadow: inset 3px 0 0 var(--teal), 0 3px 9px rgba(16, 42, 67, 0.06);
}

.draft-card:focus-visible {
  box-shadow: inset 3px 0 0 var(--teal), 0 0 0 3px rgba(17, 140, 131, 0.14);
  outline: none;
}

.draft-card-main {
  min-width: 0;
}

.draft-name-input {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--navy);
  display: block;
  font-size: 15px;
  font-weight: 700;
  margin: -4px -6px 3px;
  max-width: calc(100% + 12px);
  padding: 4px 6px;
  width: calc(100% + 12px);
}

.draft-name-input:hover {
  border-color: #ced9e0;
}

.draft-name-input:focus {
  background: white;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(17, 140, 131, 0.1);
  outline: none;
}

.draft-card-meta {
  color: #71808e;
  display: block;
  font-size: 12px;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-card-actions {
  align-items: center;
  display: flex;
  gap: 5px;
}

.draft-preview-panel {
  display: grid;
  grid-template-rows: max-content minmax(0, 1fr);
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.draft-preview-heading {
  align-items: center;
  border-bottom: 1px solid #e2e8ec;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  min-height: 73px;
  padding: 14px 20px;
}

.draft-preview-heading > div {
  min-width: 0;
}

.draft-preview-heading span,
.draft-preview-heading strong,
.draft-preview-heading small {
  display: block;
}

.draft-preview-heading span {
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin-bottom: 3px;
  text-transform: uppercase;
}

.draft-preview-heading strong {
  color: var(--navy);
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-preview-heading small {
  color: #7a8792;
  font-size: 12px;
  margin-top: 3px;
}

.draft-current-status {
  align-items: center;
  color: #536674;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.draft-preview-stage {
  background: #edf1f3;
  min-height: 0;
  overflow: auto;
  scrollbar-color: #b8c4cc transparent;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.draft-preview-surface {
  align-items: start;
  display: grid;
  justify-items: center;
  min-height: 100%;
  min-width: 100%;
  padding: 18px;
  width: max-content;
}

.draft-preview-paper {
  box-shadow: 0 8px 24px rgba(16, 42, 67, 0.15);
  left: 0;
  min-height: 1123px;
  pointer-events: none;
  position: absolute;
  top: 0;
  transform: scale(var(--draft-preview-scale));
  transform-origin: top left;
  width: 794px;
}

.draft-preview-page-frame {
  --draft-preview-scale: 0.6483627204;
  flex: 0 0 auto;
  height: 728.08px;
  overflow: hidden;
  position: relative;
  width: 514.8px;
}

.draft-preview-print-marks {
  --mark-thickness: 1.542px;
}

.draft-preview-contact-address {
  white-space: pre-line;
}

.draft-preview-contact-email,
.draft-preview-contact-date {
  color: #000000;
  font: 400 9pt/1.35 Arial, Helvetica, sans-serif;
}

.draft-preview-signature-image-block {
  cursor: default;
  touch-action: auto;
}

.draft-preview-empty {
  color: #71808d;
  font-size: 13px;
  line-height: 1.5;
  max-width: 250px;
  text-align: center;
}

.draft-card-actions button,
.address-entry-actions button {
  background: white;
  border: 1px solid #d3dde3;
  border-radius: 7px;
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  height: 36px;
  min-height: 36px;
  padding: 0 7px;
  width: 96px;
}

.draft-card-actions button:hover,
.draft-card-actions button:focus-visible,
.address-entry-actions button:hover,
.address-entry-actions button:focus-visible {
  background: #eef4f6;
  border-color: #aebec9;
  outline: none;
}

.draft-card-actions .danger-action,
.address-entry-actions .danger-action {
  color: #a43e38;
}

.empty-management-state {
  align-items: center;
  border: 1px dashed #cbd6dd;
  border-radius: 11px;
  color: #71808d;
  display: flex;
  font-size: 13px;
  justify-content: center;
  min-height: 110px;
  padding: 20px;
  text-align: center;
}

.address-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.address-list-panel {
  align-content: start;
  background: #f5f7f8;
  border-right: 1px solid #e0e6ea;
  display: grid;
  grid-template-rows: max-content minmax(0, 1fr);
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  padding: 18px;
}

.address-list {
  align-items: stretch;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: flex-start;
  margin-top: 12px;
  margin-right: -9px;
  max-height: none;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 9px;
  scrollbar-color: #b8c4cc transparent;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.address-entry {
  background: white;
  border: 1px solid #dce3e8;
  border-radius: 10px;
  flex: 0 0 auto;
  min-width: 0;
  overflow: hidden;
  padding: 12px;
}

.address-entry strong {
  color: var(--navy);
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.address-entry address {
  color: #647382;
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.address-entry address span {
  display: block;
}

.address-entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.address-form {
  display: grid;
  gap: 11px;
  max-height: none;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 24px 24px;
  scrollbar-color: #b8c4cc transparent;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.address-form-heading {
  align-items: flex-start;
  display: flex;
  gap: 15px;
  justify-content: space-between;
  margin-bottom: 2px;
}

.address-form-heading strong {
  color: var(--navy);
  display: block;
  font-size: 16px;
}

.address-form-heading small {
  color: #778591;
  display: block;
  font-size: 12px;
  line-height: 1.45;
  margin-top: 3px;
}

.text-button {
  background: transparent;
  border: 0;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.address-form label,
.security-password-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.address-form label > span,
.security-password-field > span {
  color: #4c5d6e;
  font-size: 12px;
  font-weight: 700;
}

.address-form input,
.security-password-field input {
  background: white;
  border: 1px solid #cdd7de;
  border-radius: 8px;
  color: var(--ink);
  font-size: 14px;
  height: 44px;
  padding: 0 10px;
}

.address-form input:focus,
.security-password-field input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(17, 140, 131, 0.1);
  outline: none;
}

.address-form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 5px;
}

.address-form-actions .button,
.security-dialog-actions .button,
.confirmation-dialog-actions .button {
  width: var(--action-button-width);
}

