.zmt-result-transfer-open {
  overflow: hidden;
}

.zmtr-dialog {
  width: min(860px, calc(100vw - 32px));
  max-width: 860px;
  max-height: min(820px, calc(100vh - 32px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #dce5e4;
  border-radius: 12px;
  background: #fff;
  color: #223337;
  box-shadow: 0 28px 80px rgba(20, 39, 43, 0.22);
  -webkit-font-smoothing: antialiased;
}

.zmtr-dialog::backdrop {
  background: rgba(15, 27, 31, 0.56);
  backdrop-filter: blur(3px);
}

.zmtr-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: min(820px, calc(100vh - 32px));
}

.zmtr-head,
.zmtr-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px;
  background: #fff;
}

.zmtr-head {
  border-bottom: 1px solid #e6eceb;
}

.zmtr-head span {
  display: block;
  margin-bottom: 4px;
  color: #1d746d;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.zmtr-head h2 {
  margin: 0;
  color: #17272b;
  font-size: clamp(20px, 3vw, 26px);
  line-height: 1.25;
  text-wrap: balance;
}

.zmtr-head p {
  margin: 6px 0 0;
  color: #65767a;
  font-size: 13px;
}

.zmtr-close {
  display: grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid #dce5e4;
  border-radius: 8px;
  background: #f8faf9;
  color: #536569;
  cursor: pointer;
  font: inherit;
  font-size: 24px;
  line-height: 1;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.zmtr-close:hover {
  border-color: #b9cfcc;
  background: #eef6f4;
}

.zmtr-close:active,
.zmtr-button:active {
  transform: scale(0.97);
}

.zmtr-body {
  overflow: auto;
  padding: 22px 24px 28px;
  background: #f8faf9;
}

.zmtr-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 24px 0 10px;
}

.zmtr-step:first-child {
  margin-top: 0;
}

.zmtr-step-number {
  display: grid;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: #dff1ee;
  color: #176e67;
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.zmtr-step h3 {
  margin: 1px 0 3px;
  color: #1c3034;
  font-size: 15px;
}

.zmtr-step p {
  margin: 0;
  color: #6a7a7e;
  font-size: 12px;
  line-height: 1.55;
}

.zmtr-preview,
.zmtr-projects {
  display: grid;
  gap: 9px;
}

.zmtr-source {
  overflow: hidden;
  border: 1px solid #dce6e4;
  border-radius: 9px;
  background: #fff;
}

.zmtr-source > header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 11px 13px;
  border-bottom: 1px solid #edf1f0;
}

.zmtr-source > header span {
  color: #728185;
  font-size: 11px;
}

.zmtr-source > header strong {
  color: #26393d;
  font-size: 13px;
}

.zmtr-field {
  padding: 12px 13px;
}

.zmtr-field + .zmtr-field {
  border-top: 1px solid #edf1f0;
}

.zmtr-field > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.zmtr-field > header strong {
  color: #34474b;
  font-size: 12px;
}

.zmtr-field > header span {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: #edf5f3;
  color: #55716e;
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.zmtr-field-value {
  margin: 8px 0 0;
}

.zmtr-value-text,
.zmtr-empty-value {
  margin: 0;
  padding: 10px 11px;
  border: 1px solid #e3eae9;
  border-radius: 7px;
  background: #fbfcfc;
  color: #425458;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-line;
  word-break: break-word;
}

.zmtr-value-text.is-boundary {
  border-color: #eadfbe;
  background: #fffbf1;
  color: #655b42;
}

.zmtr-empty-value {
  color: #7c8a8d;
  font-style: italic;
}

.zmtr-platform {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid #cde2de;
  border-radius: 999px;
  background: #eff9f7;
  color: #1d6d66;
  font-size: 12px;
  font-weight: 800;
}

.zmtr-text-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  counter-reset: zmtr-list;
  list-style: none;
}

.zmtr-text-list li {
  position: relative;
  min-height: 30px;
  padding: 7px 10px 7px 34px;
  border: 1px solid #e3eae9;
  border-radius: 7px;
  background: #fbfcfc;
  color: #425458;
  font-size: 12px;
  line-height: 1.55;
  counter-increment: zmtr-list;
}

.zmtr-text-list li::before {
  position: absolute;
  top: 8px;
  left: 10px;
  color: #257a73;
  content: counter(zmtr-list, decimal-leading-zero);
  font-size: 10px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.zmtr-evidence-list,
.zmtr-object-list {
  display: grid;
  gap: 8px;
}

.zmtr-evidence {
  margin: 0;
  padding: 10px 11px;
  border: 1px solid #e2e9e8;
  border-left: 3px solid #5e9993;
  border-radius: 7px;
  background: #fbfcfc;
}

.zmtr-evidence p {
  margin: 0;
  color: #33484c;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-line;
  word-break: break-word;
}

.zmtr-evidence footer {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin-top: 7px;
  color: #758487;
  font-size: 10px;
  line-height: 1.5;
}

.zmtr-evidence footer span:first-child {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zmtr-evidence a {
  color: #1d746d;
  font-weight: 800;
  text-decoration: none;
}

.zmtr-evidence a:hover {
  text-decoration: underline;
}

.zmtr-more {
  margin: 0;
  padding: 7px 10px;
  border-radius: 7px;
  background: #f1f5f4;
  color: #66787b;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.zmtr-object-card {
  padding: 10px 11px;
  border: 1px solid #e2e9e8;
  border-radius: 7px;
  background: #fbfcfc;
}

.zmtr-object-card h4 {
  margin: 0 0 8px;
  color: #263b3f;
  font-size: 12px;
  line-height: 1.5;
}

.zmtr-object-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  margin: 0;
}

.zmtr-object-card dl > div {
  min-width: 0;
}

.zmtr-object-card dl > div.is-wide {
  grid-column: 1 / -1;
}

.zmtr-object-card dt {
  margin-bottom: 2px;
  color: #7a898c;
  font-size: 10px;
  font-weight: 800;
}

.zmtr-object-card dd {
  margin: 0;
  color: #405559;
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.zmtr-targets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.zmtr-target,
.zmtr-project {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #dce5e4;
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.zmtr-target:has(input:checked),
.zmtr-project:has(input:checked) {
  border-color: #31877f;
  background: #f2fbf9;
  box-shadow: 0 0 0 2px rgba(49, 135, 127, 0.11);
}

.zmtr-target input,
.zmtr-project input {
  flex: 0 0 auto;
  margin: 3px 0 0;
  accent-color: #19766f;
}

.zmtr-target span,
.zmtr-project span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.zmtr-target strong,
.zmtr-project strong {
  overflow: hidden;
  color: #26393d;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zmtr-target small,
.zmtr-project small {
  color: #708084;
  font-size: 11px;
  line-height: 1.5;
}

.zmtr-project em {
  margin-top: 3px;
  color: #586b6f;
  font-size: 11px;
  font-style: normal;
  line-height: 1.5;
}

.zmtr-project.is-new {
  border-style: dashed;
}

.zmtr-loading,
.zmtr-failure {
  display: flex;
  min-height: 100px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #65777b;
  font-size: 13px;
}

.zmtr-loading span {
  width: 18px;
  height: 18px;
  border: 2px solid #c9d9d7;
  border-top-color: #207d75;
  border-radius: 50%;
  animation: zmtr-spin 700ms linear infinite;
}

.zmtr-failure {
  flex-direction: column;
  text-align: center;
}

.zmtr-failure strong {
  color: #9b3e3a;
}

.zmtr-failure p {
  margin: 0;
}

.zmtr-safety,
.zmtr-receive-banner {
  display: grid;
  gap: 4px;
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid #cfe4df;
  border-left: 4px solid #1c7a72;
  border-radius: 8px;
  background: #eef9f6;
}

.zmtr-safety strong,
.zmtr-receive-banner strong {
  color: #1b5e59;
  font-size: 13px;
}

.zmtr-safety span,
.zmtr-receive-banner p {
  margin: 0;
  color: #526d6a;
  font-size: 12px;
  line-height: 1.55;
}

.zmtr-footer {
  border-top: 1px solid #e3eae9;
}

.zmtr-footer > p {
  max-width: 480px;
  margin: 0;
  color: #64767a;
  font-size: 12px;
  line-height: 1.5;
}

.zmtr-footer > p[data-tone="error"] {
  color: #a34641;
}

.zmtr-footer > p[data-tone="success"] {
  color: #176d59;
}

.zmtr-footer > div,
.zmtr-receive-actions {
  display: flex;
  gap: 8px;
}

.zmtr-button {
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.zmtr-button.is-primary {
  background: #18766f;
  color: #fff;
}

.zmtr-button.is-primary:hover {
  background: #125f59;
}

.zmtr-button.is-secondary {
  border-color: #d4dfdd;
  background: #fff;
  color: #45585c;
}

.zmtr-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.zmtr-receive-banner {
  margin: 14px 0;
}

.zmtr-receive-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.zmtr-receive-preview,
.zmtr-compare {
  max-height: 160px;
  margin: 7px 0 0;
  padding: 9px 10px;
  overflow: auto;
  border: 1px solid #d5e6e2;
  border-radius: 7px;
  background: #fff;
  color: #465b5f;
  white-space: pre-wrap;
  word-break: break-word;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.zmtr-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.zmtr-compare-grid label {
  display: grid;
  gap: 4px;
  color: #52666a;
  font-size: 11px;
  font-weight: 800;
}

@keyframes zmtr-spin { to { transform: rotate(360deg); } }

@media (max-width: 680px) {
  .zmtr-dialog {
    width: 100%;
    max-width: none;
    max-height: 92vh;
    margin: auto 0 0;
    border-radius: 14px 14px 0 0;
  }
  .zmtr-shell { max-height: 92vh; }
  .zmtr-head, .zmtr-footer { padding: 16px; }
  .zmtr-body { padding: 18px 16px 22px; }
  .zmtr-targets, .zmtr-compare-grid { grid-template-columns: 1fr; }
  .zmtr-receive-head { align-items: stretch; flex-direction: column; }
  .zmtr-receive-head .zmtr-button { align-self: flex-start; white-space: nowrap; }
  .zmtr-footer { align-items: stretch; flex-direction: column; }
  .zmtr-footer > div { justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  .zmtr-close,
  .zmtr-button,
  .zmtr-target,
  .zmtr-project { transition: none; }
  .zmtr-loading span { animation-duration: 1400ms; }
}
