/**
 * Menu sync tab.
 *
 * Scoped to .ptai-ms so it cannot leak into the rest of wp-admin. Logical properties are
 * used throughout so the layout mirrors correctly in RTL.
 */

.ptai-ms {
  max-width: 1000px;
}

.ptai-ms-title {
  margin-bottom: 4px;
}

.ptai-ms-intro {
  margin-top: 0;
  color: #646970;
}

.ptai-ms-panel {
  background: #fff;
  border: 1px solid #c3c4c7;
  border-radius: 4px;
  box-shadow: 0 1px 1px rgb(0 0 0 / 4%);
  margin-top: 16px;
}

.ptai-ms-section-title {
  margin: 0;
  padding: 16px 20px 12px;
  font-size: 14px;
  font-weight: 600;
  border-bottom: 1px solid #f0f0f1;
}

.ptai-ms-cards {
  display: grid;
  gap: 12px;
  padding: 16px 20px;
}

.ptai-ms-card {
  border: 1px solid #dcdcde;
  border-radius: 4px;
  padding: 14px 16px;
  background: #fff;
}

.ptai-ms-card.is-busy {
  opacity: 0.7;
}

.ptai-ms-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ptai-ms-card-titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ptai-ms-card-name {
  font-size: 14px;
  font-weight: 600;
  color: #1d2327;
}

.ptai-ms-card-subtitle {
  margin-top: 2px;
  font-size: 12px;
  color: #646970;
}

.ptai-ms-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ptai-ms-saved {
  font-size: 12px;
  font-weight: 500;
  color: #007017;
  min-width: 40px;
  text-align: end;
}

.ptai-ms-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.6;
  white-space: nowrap;
  border: 1px solid #dcdcde;
  background: #f6f7f7;
  color: #646970;
}

.ptai-ms-pill.is-synced {
  border-color: #b8e0c2;
  background: #f6fbf7;
  color: #007017;
}

.ptai-ms-pill.is-idle {
  border-color: #f0d9a8;
  background: #fdf8ee;
  color: #8a5a00;
}

/* Toggle switch */
.ptai-ms-toggle-label {
  font-size: 12px;
  color: #646970;
  white-space: nowrap;
}

.ptai-ms-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: #c3c4c7;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease-in-out;
  flex: none;
}

.ptai-ms-switch[aria-checked="true"] {
  background: #2271b1;
}

.ptai-ms-switch:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ptai-ms-switch:focus-visible {
  outline: 2px solid #2271b1;
  outline-offset: 2px;
}

.ptai-ms-knob {
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: inset-inline-start 0.15s ease-in-out;
}

.ptai-ms-switch[aria-checked="true"] .ptai-ms-knob {
  inset-inline-start: 21px;
}

/* Language chips */
.ptai-ms-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.ptai-ms-chip {
  display: inline-block;
  padding: 3px 12px;
  border: 1px solid #c3c4c7;
  border-radius: 999px;
  background: #fff;
  color: #50575e;
  font-size: 12px;
  line-height: 1.7;
  cursor: pointer;
}

.ptai-ms-chip:hover:not(.is-reference):not(.is-disabled) {
  border-color: #2271b1;
  color: #2271b1;
}

.ptai-ms-chip[aria-pressed="true"] {
  border-color: #2271b1;
  background: #f0f6fc;
  color: #2271b1;
}

.ptai-ms-chip:focus-visible {
  outline: 2px solid #2271b1;
  outline-offset: 1px;
}

.ptai-ms-chip.is-reference {
  background: #f6f7f7;
  border-color: #dcdcde;
  color: #646970;
  cursor: default;
}

.ptai-ms-chip.is-disabled {
  border-style: dashed;
  background: transparent;
  color: #8c8f94;
  cursor: default;
}

.ptai-ms-chip.is-create {
  border-style: dashed;
  color: #2271b1;
  font-weight: 500;
}

.ptai-ms-check {
  margin-inline-end: 4px;
  font-weight: 700;
}

.ptai-ms-error {
  margin: 8px 0 0;
  font-size: 12px;
  color: #b32d2e;
}

/* Footer */
.ptai-ms-note {
  margin: 0;
  padding: 0 20px 16px;
  font-size: 12px;
  color: #646970;
}

.ptai-ms-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid #f0f0f1;
}

.ptai-ms-last-sync {
  font-size: 12px;
  color: #646970;
}

.ptai-ms-footer .button-primary[disabled] {
  pointer-events: none;
}
