#agd-sync-panel {
  position: relative;
  margin-top: 14px;
  overflow: hidden;
}

.qsync-head,
.qsync-section-head,
.qsync-unit,
.qsync-conflict,
.qsync-pairing-result,
.qsync-publish,
.qsync-actions {
  display: flex;
  align-items: center;
}

.qsync-head,
.qsync-section-head {
  justify-content: space-between;
  gap: 16px;
}

.qsync-head {
  padding: 18px 20px;
  border-bottom: 1px solid #dbe3ef;
}

.qsync-head h2,
.qsync-modal-head h3 {
  margin: 0;
  color: #172033;
}

.qsync-head p,
.qsync-modal-card p {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 13px;
}

.qsync-actions,
.qsync-publish {
  gap: 8px;
}

.qsync-section {
  padding: 18px 20px;
  border-bottom: 1px solid #e2e8f0;
}

.qsync-section:last-of-type {
  border-bottom: 0;
}

.qsync-section-head {
  margin-bottom: 12px;
}

.qsync-section-head strong,
.qsync-section-head span {
  display: block;
}

.qsync-section-head strong {
  color: #172033;
  font-size: 16px;
}

.qsync-section-head span {
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
}

.qsync-units,
.qsync-conflicts {
  display: grid;
  gap: 9px;
}

.qsync-unit,
.qsync-conflict {
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid #dbe3ef;
  border-radius: 7px;
  background: #fff;
}

.qsync-unit > div:first-child,
.qsync-conflict > div:first-child {
  min-width: 0;
  flex: 1;
}

.qsync-unit strong,
.qsync-unit span,
.qsync-conflict strong,
.qsync-conflict span,
.qsync-conflict small {
  display: block;
}

.qsync-unit span,
.qsync-conflict span,
.qsync-conflict small,
.qsync-unit-status small {
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
}

.qsync-unit-status {
  min-width: 155px;
  text-align: right;
}

.qsync-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
}

.qsync-badge.online,
.qsync-badge.active,
.qsync-badge.acknowledged {
  background: #dcfce7;
  color: #166534;
}

.qsync-badge.pending,
.qsync-badge.delivered,
.qsync-badge.published {
  background: #dbeafe;
  color: #1d4ed8;
}

.qsync-badge.conflict,
.qsync-badge.failed,
.qsync-badge.revoked {
  background: #fee2e2;
  color: #b91c1c;
}

.qsync-danger {
  color: #b91c1c !important;
}

.qsync-pairing-result {
  justify-content: space-between;
  gap: 18px;
  margin: 16px 20px 0;
  padding: 14px 16px;
  border: 1px solid #86efac;
  border-radius: 7px;
  background: #f0fdf4;
}

.qsync-pairing-result span,
.qsync-pairing-result strong,
.qsync-pairing-result small {
  display: block;
}

.qsync-pairing-result span,
.qsync-pairing-result small {
  color: #166534;
  font-size: 12px;
}

.qsync-pairing-result strong {
  margin: 4px 0;
  color: #14532d;
  font-size: 26px;
  letter-spacing: .12em;
}

.qsync-message {
  margin: 14px 20px 0;
  padding: 10px 12px;
  border: 1px solid;
  border-radius: 6px;
  font-size: 13px;
}

.qsync-message.ok {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.qsync-message.error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.qsync-table code {
  color: #334155;
  font-size: 12px;
}

.qsync-publish .agd-select {
  min-width: 220px;
}

.qsync-modal {
  position: fixed;
  inset: 0;
  z-index: 10100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, .5);
}

.qsync-modal[hidden] {
  display: none;
}

.qsync-modal-card {
  width: min(480px, 100%);
  padding: 20px;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
}

.qsync-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.qsync-modal-card label {
  display: block;
  margin-top: 12px;
}

.qsync-modal-card label span {
  display: block;
  margin-bottom: 5px;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
}

.qsync-modal-card > .qsync-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

@media (max-width: 900px) {
  .qsync-head,
  .qsync-section-head,
  .qsync-unit,
  .qsync-conflict {
    align-items: stretch;
    flex-direction: column;
  }

  .qsync-head .qsync-actions,
  .qsync-section-head .qsync-publish,
  .qsync-conflict .qsync-actions {
    width: 100%;
  }

  .qsync-publish {
    flex-wrap: wrap;
  }

  .qsync-publish .agd-select {
    min-width: 0;
    flex: 1;
  }

  .qsync-unit-status {
    min-width: 0;
    text-align: left;
  }
}
