.account-merge {
  --am-orange: #df6538;
  --am-orange-soft: rgba(223, 101, 56, 0.12);
  --am-source: #c45a33;
  --am-dest: #2f6f4e;
  --am-dest-soft: rgba(47, 111, 78, 0.12);
  --am-ink: #2b303b;
  --am-muted: #6c757d;
  --am-line: #e6e9ef;
  --am-panel: #ffffff;
  --am-rail: #f4f6f9;
  max-width: 100%;
  margin: 0;
  padding: 0 0 16px;
}

.account-merge__intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--am-muted);
  font-size: 0.9rem;
}

.account-merge__intro p {
  margin: 0;
  max-width: 48rem;
}

.account-merge__intro-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--am-orange-soft);
  color: var(--am-orange);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.account-merge__scroller {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.account-merge__board {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) 140px minmax(300px, 1fr);
  gap: 12px;
  align-items: stretch;
  min-width: 760px;
}

.account-merge__panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--am-panel);
  border: 1px solid var(--am-line);
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.06);
  overflow: hidden;
}

.account-merge__panel.is-source {
  border-color: rgba(196, 90, 51, 0.45);
  box-shadow: 0 8px 22px rgba(196, 90, 51, 0.12);
}

.account-merge__panel.is-destination {
  border-color: rgba(47, 111, 78, 0.4);
  box-shadow: 0 8px 22px rgba(47, 111, 78, 0.1);
}

.account-merge__panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--am-line);
  background: #fafbfc;
}

.account-merge__panel-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--am-ink);
}

.account-merge__role {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.account-merge__role--source {
  background: rgba(196, 90, 51, 0.12);
  color: var(--am-source);
}

.account-merge__role--destination {
  background: var(--am-dest-soft);
  color: var(--am-dest);
}

.account-merge__role--idle {
  background: #eef1f5;
  color: var(--am-muted);
}

.account-merge__panel-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 12px;
  gap: 10px;
  min-height: 0;
}

.account-merge__search label {
  font-weight: 600;
  color: var(--am-ink);
  margin-bottom: 4px;
  font-size: 0.85rem;
}

.account-merge__profile {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px;
  border-radius: 10px;
  background: #f7f8fb;
  border: 1px solid var(--am-line);
}

.account-merge__avatar {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  background: linear-gradient(145deg, #df6538, #b84a22);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.account-merge__panel.is-destination .account-merge__avatar {
  background: linear-gradient(145deg, #3f8f65, #2f6f4e);
}

.account-merge__profile-meta {
  min-width: 0;
}

.account-merge__profile-meta strong {
  display: block;
  font-size: 0.98rem;
  color: var(--am-ink);
}

.account-merge__profile-meta .email {
  color: var(--am-muted);
  word-break: break-all;
  font-size: 0.85rem;
}

.account-merge__ids {
  margin-top: 2px;
  font-size: 0.75rem;
  color: #8791a1;
}

.account-merge__metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.account-merge__metric {
  padding: 8px 8px 6px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--am-line);
  text-align: center;
}

.account-merge__metric-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--am-ink);
}

.account-merge__metric-label {
  display: block;
  margin-top: 2px;
  font-size: 0.65rem;
  color: var(--am-muted);
  line-height: 1.2;
}

.account-merge__logs {
  flex: 1 1 auto;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--am-line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.account-merge__logs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid var(--am-line);
  background: #fafbfc;
  font-weight: 600;
  font-size: 0.85rem;
}

.account-merge__logs-list {
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: auto;
  max-height: 200px;
}

.account-merge__logs-list li {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: baseline;
  padding: 6px 10px;
  border-bottom: 1px solid #f0f2f6;
  font-size: 0.78rem;
}

.account-merge__logs-list li:last-child {
  border-bottom: 0;
}

.account-merge__logs-list .date {
  color: #8791a1;
  font-variant-numeric: tabular-nums;
}

.account-merge__logs-list .spot {
  color: var(--am-ink);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-merge__logs-list .vis {
  color: var(--am-orange);
  font-weight: 700;
}

.account-merge__empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 12px;
  color: #98a2b3;
  font-size: 0.85rem;
  text-align: center;
}

.account-merge__rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 8px;
  border-radius: 12px;
  background: var(--am-rail);
  border: 1px dashed #d5dae3;
  align-self: stretch;
}

.account-merge__rail-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  text-align: center;
}

.account-merge__rail-arrow {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--am-orange);
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 6px 14px rgba(223, 101, 56, 0.35);
}

.account-merge__rail-from,
.account-merge__rail-to {
  width: 100%;
  padding: 6px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--am-line);
  font-size: 0.68rem;
  word-break: break-all;
  color: var(--am-ink);
  font-weight: 600;
}

.account-merge__rail-from {
  border-left: 3px solid var(--am-source);
}

.account-merge__rail-to {
  border-left: 3px solid var(--am-dest);
}

.account-merge__actions {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--am-line);
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.05);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.account-merge__actions-copy {
  flex: 1 1 280px;
  margin: 0;
  color: var(--am-muted);
  font-size: 0.85rem;
}

.account-merge__actions .btn-merge {
  min-width: 160px;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: #df6538 !important;
  border-color: #df6538 !important;
  color: #fff !important;
  box-shadow: 0 6px 14px rgba(223, 101, 56, 0.28);
}

.account-merge__actions .btn-merge:disabled {
  opacity: 0.55;
}

.account-merge-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.account-merge-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 28, 36, 0.55);
}

.account-merge-modal__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(16, 24, 40, 0.28);
  overflow: hidden;
}

.account-merge-modal__header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 18px 12px;
  border-bottom: 1px solid #e6e9ef;
  background: linear-gradient(135deg, rgba(223, 101, 56, 0.12), #fff 60%);
}

.account-merge-modal__icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #df6538;
  color: #fff;
  font-size: 1.35rem;
}

.account-merge-modal__title {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 700;
  color: #2b303b;
}

.account-merge-modal__note {
  margin: 0;
  color: #6c757d;
  font-size: 0.88rem;
}

.account-merge-modal__close {
  margin-left: auto;
  padding: 0 4px;
  opacity: 0.55;
}

.account-merge-modal__body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.account-merge-modal__flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: stretch;
}

.account-merge-modal__party {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #e6e9ef;
  background: #f7f8fb;
  min-width: 0;
}

.account-merge-modal__party strong {
  color: #2b303b;
  font-size: 0.98rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-merge-modal__party span,
.account-merge-modal__party small {
  color: #6c757d;
  font-size: 0.8rem;
  word-break: break-all;
}

.account-merge-modal__party-role {
  display: inline-block;
  align-self: flex-start;
  margin-bottom: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.account-merge-modal__party--source {
  border-left: 3px solid #c45a33;
}

.account-merge-modal__party--source .account-merge-modal__party-role {
  background: rgba(196, 90, 51, 0.12);
  color: #c45a33;
}

.account-merge-modal__party--dest {
  border-left: 3px solid #2f6f4e;
}

.account-merge-modal__party--dest .account-merge-modal__party-role {
  background: rgba(47, 111, 78, 0.12);
  color: #2f6f4e;
}

.account-merge-modal__arrow {
  align-self: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #df6538;
  color: #fff;
  font-size: 1.1rem;
}

.account-merge-modal__metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.account-merge-modal__metric {
  text-align: center;
  padding: 8px 6px;
  border: 1px solid #e6e9ef;
  border-radius: 8px;
  background: #fff;
}

.account-merge-modal__metric-value {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  color: #2b303b;
  line-height: 1.1;
}

.account-merge-modal__metric-label {
  display: block;
  margin-top: 2px;
  font-size: 0.68rem;
  color: #6c757d;
}

.account-merge-modal__confirm {
  margin: 0;
  padding: 12px 12px 4px;
  border-radius: 10px;
  border: 1px solid rgba(223, 101, 56, 0.35);
  background: rgba(223, 101, 56, 0.08);
}

.account-merge-modal__confirm .demo-checkbox label {
  min-width: 0;
  max-width: 100%;
  height: auto;
  white-space: normal;
  line-height: 1.4;
  margin-bottom: 8px;
  font-weight: 600;
  color: #2b303b;
}

.account-merge-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px 18px;
  border-top: 1px solid #e6e9ef;
  background: #fafbfc;
}

.account-merge-modal__footer .btn-merge:disabled {
  opacity: 0.5;
}

@media (max-width: 575px) {
  .account-merge-modal__flow {
    grid-template-columns: 1fr;
  }

  .account-merge-modal__arrow {
    transform: rotate(90deg);
    justify-self: center;
  }

  .account-merge-modal__metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
